From 2529ca23efd245afa9fb941626bb6caa5551f3f6 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 13 Jul 2004 15:36:52 +0000 Subject: add flag to turn off hiding removed but open files --- lib/fuse.c | 5 +++-- lib/helper.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/fuse.c b/lib/fuse.c index 6689bf3..cebca07 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -814,7 +814,7 @@ static void do_unlink(struct fuse *f, struct fuse_in_header *in, char *name) if (path != NULL) { res = -ENOSYS; if (f->op.unlink) { - if (is_open(f, in->ino, name)) + if (!(f->flags & FUSE_HARD_REMOVE) && is_open(f, in->ino, name)) res = hide_node(f, path, in->ino, name); else { res = f->op.unlink(path); @@ -894,7 +894,8 @@ static void do_rename(struct fuse *f, struct fuse_in_header *in, res = -ENOSYS; if (f->op.rename) { res = 0; - if (is_open(f, newdir, newname)) + if (!(f->flags & FUSE_HARD_REMOVE) && + is_open(f, newdir, newname)) res = hide_node(f, newpath, newdir, newname); if (res == 0) { res = f->op.rename(oldpath, newpath); diff --git a/lib/helper.c b/lib/helper.c index e639d68..d597c46 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -30,6 +30,7 @@ static void usage(char *progname) " -d enable debug output (implies -f)\n" " -f foreground operation\n" " -s disable multithreaded operation\n" + " -i immediate removal (don't delay until last release)\n" " -h print help\n" "\n" "Fusermount options:\n" @@ -134,6 +135,10 @@ void fuse_main(int argc, char *argv[], const struct fuse_operations *op) background = 0; break; + case 'i': + flags |= FUSE_HARD_REMOVE; + break; + case 'f': background = 0; break; -- cgit v1.2.3