From b2e489e0c1532fe18e573896c32c484318cdf279 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sat, 27 Jan 2024 00:45:30 -0600 Subject: [PATCH] mergerfs.cpp --- src/mergerfs.cpp | 122 +++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 63 deletions(-) diff --git a/src/mergerfs.cpp b/src/mergerfs.cpp index f8524e18..a36a09a1 100644 --- a/src/mergerfs.cpp +++ b/src/mergerfs.cpp @@ -91,67 +91,63 @@ #include - -namespace l -{ - static - void - get_fuse_operations(struct fuse_operations &ops_, - const bool nullrw_) - { - ops_.access = FUSE::access; - ops_.bmap = FUSE::bmap; - ops_.chmod = FUSE::chmod; - ops_.chown = FUSE::chown; - ops_.copy_file_range = FUSE::copy_file_range; - ops_.create = FUSE::create; - ops_.destroy = FUSE::destroy; - ops_.fallocate = FUSE::fallocate; - ops_.fchmod = FUSE::fchmod; - ops_.fchown = FUSE::fchown; - ops_.fgetattr = FUSE::fgetattr; - ops_.flock = FUSE::flock; - ops_.flush = FUSE::flush; - ops_.free_hide = FUSE::free_hide; - ops_.fsync = FUSE::fsync; - ops_.fsyncdir = FUSE::fsyncdir; - ops_.ftruncate = FUSE::ftruncate; - ops_.futimens = FUSE::futimens; - ops_.getattr = FUSE::getattr; - ops_.getxattr = FUSE::getxattr; - ops_.init = FUSE::init; - ops_.ioctl = FUSE::ioctl; - ops_.link = FUSE::link; - ops_.listxattr = FUSE::listxattr; - ops_.lock = FUSE::lock; - ops_.mkdir = FUSE::mkdir; - ops_.mknod = FUSE::mknod; - ops_.open = FUSE::open; - ops_.opendir = FUSE::opendir; - ops_.poll = FUSE::poll;; - ops_.prepare_hide = FUSE::prepare_hide; - ops_.read = (nullrw_ ? FUSE::read_null : FUSE::read); - ops_.readdir = FUSE::readdir; - ops_.readdir_plus = FUSE::readdir_plus; - ops_.readlink = FUSE::readlink; - ops_.release = FUSE::release; - ops_.releasedir = FUSE::releasedir; - ops_.removemapping = FUSE::removemapping; - ops_.removexattr = FUSE::removexattr; - ops_.rename = FUSE::rename; - ops_.rmdir = FUSE::rmdir; - ops_.setupmapping = FUSE::setupmapping; - ops_.setxattr = FUSE::setxattr; - ops_.statfs = FUSE::statfs; - ops_.symlink = FUSE::symlink; - ops_.syncfs = FUSE::syncfs; - ops_.tmpfile = FUSE::tmpfile; - ops_.truncate = FUSE::truncate; - ops_.unlink = FUSE::unlink; - ops_.utimens = FUSE::utimens; - ops_.write = (nullrw_ ? FUSE::write_null : FUSE::write); - - return; +namespace l { +static void get_fuse_operations(struct fuse_operations &ops_, + const bool nullrw_) { + ops_.access = FUSE::access; + ops_.bmap = FUSE::bmap; + ops_.chmod = FUSE::chmod; + ops_.chown = FUSE::chown; + ops_.copy_file_range = FUSE::copy_file_range; + ops_.create = FUSE::create; + ops_.destroy = FUSE::destroy; + ops_.fallocate = FUSE::fallocate; + ops_.fchmod = FUSE::fchmod; + ops_.fchown = FUSE::fchown; + ops_.fgetattr = FUSE::fgetattr; + ops_.flock = FUSE::flock; + ops_.flush = FUSE::flush; + ops_.free_hide = FUSE::free_hide; + ops_.fsync = FUSE::fsync; + ops_.fsyncdir = FUSE::fsyncdir; + ops_.ftruncate = FUSE::ftruncate; + ops_.futimens = FUSE::futimens; + ops_.getattr = FUSE::getattr; + ops_.getxattr = FUSE::getxattr; + ops_.init = FUSE::init; + ops_.ioctl = FUSE::ioctl; + ops_.link = FUSE::link; + ops_.listxattr = FUSE::listxattr; + ops_.lock = FUSE::lock; + ops_.mkdir = FUSE::mkdir; + ops_.mknod = FUSE::mknod; + ops_.open = FUSE::open; + ops_.opendir = FUSE::opendir; + ops_.poll = FUSE::poll; + ; + ops_.prepare_hide = FUSE::prepare_hide; + ops_.read = (nullrw_ ? FUSE::read_null : FUSE::read); + ops_.readdir = FUSE::readdir; + ops_.readdir_plus = FUSE::readdir_plus; + ops_.readlink = FUSE::readlink; + ops_.release = FUSE::release; + ops_.releasedir = FUSE::releasedir; + ops_.removemapping = FUSE::removemapping; + ops_.removexattr = FUSE::removexattr; + ops_.rename = FUSE::rename; + ops_.rmdir = FUSE::rmdir; + ops_.setupmapping = FUSE::setupmapping; + ops_.setxattr = FUSE::setxattr; + ops_.statfs = FUSE::statfs; + ops_.symlink = FUSE::symlink; + ops_.syncfs = FUSE::syncfs; + ops_.tmpfile = FUSE::tmpfile; + ops_.truncate = FUSE::truncate; + ops_.unlink = FUSE::unlink; + ops_.utimens = FUSE::utimens; + ops_.write = (nullrw_ ? FUSE::write_null : FUSE::write); + + return; } static @@ -296,13 +292,13 @@ namespace l return rv; } -} + } // namespace l int main(int argc_, char **argv_) { - auto data = toml::parse("config.toml"); + auto data = toml::parse("config.toml"); std::cout << data["branches"] << '\n'; // Branches2 b(data["branches"]);