summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netfs/fuse/fuseApp.cpp3
-rw-r--r--netfs/fuse/fuseAppBase.h93
2 files changed, 47 insertions, 49 deletions
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp
index cfd9689..f9b6884 100644
--- a/netfs/fuse/fuseApp.cpp
+++ b/netfs/fuse/fuseApp.cpp
@@ -20,6 +20,9 @@ namespace AdHoc {
template class CallCacheable<struct stat, std::string>;
}
+static_assert(NetFS::FuseApp::operations.access);
+static_assert(!NetFS::FuseApp::operations.destroy);
+
NetFS::FuseApp::FuseApp(Ice::StringSeq && a) : iceArgs(std::move(a)) { }
NetFS::FuseApp::~FuseApp()
diff --git a/netfs/fuse/fuseAppBase.h b/netfs/fuse/fuseAppBase.h
index ab47476..e4c1c62 100644
--- a/netfs/fuse/fuseAppBase.h
+++ b/netfs/fuse/fuseAppBase.h
@@ -82,58 +82,53 @@ public:
getInternalHelper<decltype(&FuseAppBase::func), decltype(&FuseApp::func), &FuseAppBase::func>(&FuseAppBase::func)
#define GetHelper(func) \
getHelper<decltype(&FuseAppBase::func), decltype(&FuseApp::func), &FuseAppBase::func>(&FuseAppBase::func)
- FuseAppBaseT() :
- operations({
- GetHelper(getattr),
- GetHelper(readlink),
- GetHelper(mknod),
- GetHelper(mkdir),
- GetHelper(unlink),
- GetHelper(rmdir),
- GetHelper(symlink),
- GetHelper(rename),
- GetHelper(link),
- GetHelper(chmod),
- GetHelper(chown),
- GetHelper(truncate),
- GetHelper(open),
- GetHelper(read),
- GetHelper(write),
- GetHelper(statfs),
- GetHelper(flush),
- GetHelper(release),
- GetHelper(fsync),
- GetHelper(setxattr),
- GetHelper(getxattr),
- GetHelper(listxattr),
- GetHelper(removexattr),
- GetHelper(opendir),
- GetHelper(readdir),
- GetHelper(releasedir),
- GetHelper(fsyncdir),
- GetIntHelper(init),
- nullptr, // fuseDestroy
- GetHelper(access),
- GetHelper(create),
- GetHelper(lock),
- GetHelper(utimens),
- GetHelper(bmap),
- GetHelper(ioctl),
- GetHelper(poll),
- GetHelper(write_buf),
- GetHelper(read_buf),
- GetHelper(flock),
- GetHelper(fallocate),
- GetHelper(copy_file_range),
- GetHelper(lseek),
- })
- {
- }
+ constexpr static fuse_operations operations {
+ GetHelper(getattr),
+ GetHelper(readlink),
+ GetHelper(mknod),
+ GetHelper(mkdir),
+ GetHelper(unlink),
+ GetHelper(rmdir),
+ GetHelper(symlink),
+ GetHelper(rename),
+ GetHelper(link),
+ GetHelper(chmod),
+ GetHelper(chown),
+ GetHelper(truncate),
+ GetHelper(open),
+ GetHelper(read),
+ GetHelper(write),
+ GetHelper(statfs),
+ GetHelper(flush),
+ GetHelper(release),
+ GetHelper(fsync),
+ GetHelper(setxattr),
+ GetHelper(getxattr),
+ GetHelper(listxattr),
+ GetHelper(removexattr),
+ GetHelper(opendir),
+ GetHelper(readdir),
+ GetHelper(releasedir),
+ GetHelper(fsyncdir),
+ GetIntHelper(init),
+ nullptr, // fuseDestroy
+ GetHelper(access),
+ GetHelper(create),
+ GetHelper(lock),
+ GetHelper(utimens),
+ GetHelper(bmap),
+ GetHelper(ioctl),
+ GetHelper(poll),
+ GetHelper(write_buf),
+ GetHelper(read_buf),
+ GetHelper(flock),
+ GetHelper(fallocate),
+ GetHelper(copy_file_range),
+ GetHelper(lseek),
+ };
#undef GetHelper
#undef GetIntHelper
- const struct fuse_operations operations;
-
private:
template<typename BFunc, typename IFunc, BFunc bfunc, typename Rtn, typename... Args>
constexpr static auto