aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2004-05-18 08:45:28 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2004-05-18 08:45:28 +0000
commite2e4ac2c990a9b09740e4be6ae2de811154cc5b3 (patch)
tree8648e21445e9c3a905b64e7acb6f58500b03249d /lib/fuse.c
parent43a20ad720402cf852fc8a6cdd20b98c74dcd816 (diff)
downloadlibfuse-e2e4ac2c990a9b09740e4be6ae2de811154cc5b3.tar.gz
added flush() call
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index fddcc33..9f5e8a9 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -829,6 +829,22 @@ static void do_open(struct fuse *f, struct fuse_in_header *in,
}
}
+static void do_flush(struct fuse *f, struct fuse_in_header *in)
+{
+ char *path;
+ int res;
+
+ res = -ENOENT;
+ path = get_path(f, in->ino);
+ if(path != NULL) {
+ res = -ENOSYS;
+ if(f->op.flush)
+ res = f->op.flush(path);
+ free(path);
+ }
+ send_reply(f, in, res, NULL, 0);
+}
+
static void do_release(struct fuse *f, struct fuse_in_header *in,
struct fuse_open_in *arg)
{
@@ -1215,6 +1231,10 @@ void __fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd)
do_open(f, in, (struct fuse_open_in *) inarg);
break;
+ case FUSE_FLUSH:
+ do_flush(f, in);
+ break;
+
case FUSE_RELEASE:
do_release(f, in, (struct fuse_open_in *) inarg);
break;