aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/file.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2004-06-03 14:45:04 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2004-06-03 14:45:04 +0000
commit63b8c1c99797322bb873803b0296ac302d5de4d2 (patch)
tree0ed50a9e1a1e0bd45e2c47aa49fc26aec0e56e30 /kernel/file.c
parentff8753578ac425bf64502f6b26c85c5a4cb0d17b (diff)
downloadlibfuse-63b8c1c99797322bb873803b0296ac302d5de4d2.tar.gz
cache ENOSYS on some optional functions
Diffstat (limited to 'kernel/file.c')
-rw-r--r--kernel/file.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/file.c b/kernel/file.c
index c9a44fd..2067bd7 100644
--- a/kernel/file.c
+++ b/kernel/file.c
@@ -99,11 +99,16 @@ static int fuse_flush(struct file *file)
struct fuse_in in = FUSE_IN_INIT;
struct fuse_out out = FUSE_OUT_INIT;
+ if (fc->no_flush)
+ return 0;
+
in.h.opcode = FUSE_FLUSH;
in.h.ino = inode->i_ino;
request_send(fc, &in, &out);
- if (out.h.error == -ENOSYS)
+ if (out.h.error == -ENOSYS) {
+ fc->no_flush = 1;
return 0;
+ }
else
return out.h.error;
}
@@ -116,6 +121,9 @@ static int fuse_fsync(struct file *file, struct dentry *de, int datasync)
struct fuse_out out = FUSE_OUT_INIT;
struct fuse_fsync_in inarg;
+ if (fc->no_fsync)
+ return 0;
+
memset(&inarg, 0, sizeof(inarg));
inarg.datasync = datasync;
@@ -125,6 +133,11 @@ static int fuse_fsync(struct file *file, struct dentry *de, int datasync)
in.args[0].size = sizeof(inarg);
in.args[0].value = &inarg;
request_send(fc, &in, &out);
+
+ if (out.h.error == -ENOSYS) {
+ fc->no_fsync = 1;
+ return 0;
+ }
return out.h.error;
/* FIXME: need to ensure, that all write requests issued