diff options
-rw-r--r-- | netfs/fuse/fuseApp.h | 1 | ||||
-rw-r--r-- | netfs/fuse/fuseConfig.ice | 3 | ||||
-rw-r--r-- | netfs/fuse/fuseFiles.cpp | 12 | ||||
-rw-r--r-- | netfs/unittests/defaultFuse.xml | 1 | ||||
-rw-r--r-- | netfs/unittests/testEdgeCases.cpp | 1 |
5 files changed, 18 insertions, 0 deletions
diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h index 0d2dd1d..a15d150 100644 --- a/netfs/fuse/fuseApp.h +++ b/netfs/fuse/fuseApp.h @@ -76,6 +76,7 @@ namespace NetFS { // files int open(const char * p, struct fuse_file_info * fi) override; int create(const char *, mode_t, struct fuse_file_info *) override; + int flush(const char *, struct fuse_file_info * fi) override; int release(const char *, struct fuse_file_info * fi) override; int read(const char *, char * buf, size_t s, off_t o, struct fuse_file_info * fi) override; int write(const char *, const char * buf, size_t s, off_t o, struct fuse_file_info * fi) override; diff --git a/netfs/fuse/fuseConfig.ice b/netfs/fuse/fuseConfig.ice index 3e17017..1e6aed3 100644 --- a/netfs/fuse/fuseConfig.ice +++ b/netfs/fuse/fuseConfig.ice @@ -17,6 +17,9 @@ module NetFS { ["slicer:name:authtoken"] string AuthToken; + + ["slicer:name:async"] + bool Async; }; ["slicer:key:name","slicer:value:resource","slicer:item:resource"] diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp index fcc58a9..5268f4a 100644 --- a/netfs/fuse/fuseFiles.cpp +++ b/netfs/fuse/fuseFiles.cpp @@ -77,6 +77,18 @@ NetFS::FuseApp::release(const char *, struct fuse_file_info * fi) } int +NetFS::FuseApp::flush(const char *, struct fuse_file_info * fi) +{ + try { + (void)fi; + return 0; + } + catch (NetFS::SystemError & e) { + return -e.syserrno; + } +} + +int NetFS::FuseApp::read(const char *, char * buf, size_t s, off_t o, struct fuse_file_info * fi) { try { diff --git a/netfs/unittests/defaultFuse.xml b/netfs/unittests/defaultFuse.xml index 37f55a3..0e95066 100644 --- a/netfs/unittests/defaultFuse.xml +++ b/netfs/unittests/defaultFuse.xml @@ -5,6 +5,7 @@ <name>testvol</name> <resource> <export>testvol</export> + <async>true</async> <endpoints> <endpoint>overridden</endpoint> </endpoints> diff --git a/netfs/unittests/testEdgeCases.cpp b/netfs/unittests/testEdgeCases.cpp index 31cdf03..aeaa725 100644 --- a/netfs/unittests/testEdgeCases.cpp +++ b/netfs/unittests/testEdgeCases.cpp @@ -41,6 +41,7 @@ BOOST_AUTO_TEST_CASE ( createAndDaemonRestart ) BOOST_REQUIRE_EQUAL(0, fuse.fuse->fgetattr(fileName, &st, &fh)); BOOST_REQUIRE_EQUAL(st.st_size, sizeof(someData)); + BOOST_REQUIRE_EQUAL(0, fuse.fuse->flush(fileName, &fh)); BOOST_TEST_CHECKPOINT("Restart daemon object"); daemon.restart(); |