+2004-07-13 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Add FUSE_HARD_REMOVE flag, and '-i' option to fuse main, which
+ disable the "hide if open" behavior of unlink/rename.
+
2004-07-12 Miklos Szeredi <miklos@szeredi.hu>
* Fix bug in do_open() in libfuse: open count was incremented
/** Enable debuging output */
#define FUSE_DEBUG (1 << 1)
+/** If a file is removed but it's still open, don't hide the file but
+ remove it immediately */
+#define FUSE_HARD_REMOVE (1 << 2)
+
#ifdef __cplusplus
extern "C" {
#endif
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);
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);
" -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"
background = 0;
break;
+ case 'i':
+ flags |= FUSE_HARD_REMOVE;
+ break;
+
case 'f':
background = 0;
break;