summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-10-25 17:44:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-12-16 20:51:55 +0000
commit4a69e4a845865272473020da2004d69be6228c55 (patch)
tree0be361b4c898321be3cb24bb48c7fda98cb278f4
parentRemove calls to stringbf in favour of CTF (diff)
downloadnetfs-4a69e4a845865272473020da2004d69be6228c55.tar.bz2
netfs-4a69e4a845865272473020da2004d69be6228c55.tar.xz
netfs-4a69e4a845865272473020da2004d69be6228c55.zip
Adds a (currently NOOP) flush implementation
-rw-r--r--netfs/fuse/fuseApp.h1
-rw-r--r--netfs/fuse/fuseConfig.ice3
-rw-r--r--netfs/fuse/fuseFiles.cpp12
-rw-r--r--netfs/unittests/defaultFuse.xml1
-rw-r--r--netfs/unittests/testEdgeCases.cpp1
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();