From e2e4ac2c990a9b09740e4be6ae2de811154cc5b3 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 18 May 2004 08:45:28 +0000 Subject: added flush() call --- lib/fuse.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/fuse.c') 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; -- cgit v1.2.3