summaryrefslogtreecommitdiff
path: root/lib/libfuse/fuse_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfuse/fuse_ops.c')
-rw-r--r--lib/libfuse/fuse_ops.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/libfuse/fuse_ops.c b/lib/libfuse/fuse_ops.c
index 4f7800922a8..6d173933123 100644
--- a/lib/libfuse/fuse_ops.c
+++ b/lib/libfuse/fuse_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_ops.c,v 1.14 2013/11/21 22:03:26 syl Exp $ */
+/* $OpenBSD: fuse_ops.c,v 1.15 2013/12/03 09:59:40 syl Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -757,6 +757,20 @@ ifuse_ops_destroy(struct fuse *f)
return (0);
}
+static int
+ifuse_ops_reclaim(struct fuse *f, struct fusebuf *fbuf)
+{
+ struct fuse_vnode *vn;
+
+ vn = tree_pop(&f->vnode_tree, fbuf->fb_ino);
+ if (vn) {
+ remove_vnode_from_name_tree(f, vn);
+ free(vn);
+ }
+
+ return (0);
+}
+
int
ifuse_exec_opcode(struct fuse *f, struct fusebuf *fbuf)
{
@@ -832,6 +846,9 @@ ifuse_exec_opcode(struct fuse *f, struct fusebuf *fbuf)
case FBT_DESTROY:
ret = ifuse_ops_destroy(f);
break;
+ case FBT_RECLAIM:
+ ret = ifuse_ops_reclaim(f, fbuf);
+ break;
default:
DPRINTF("Opcode:\t%i not supported\n", fbuf->fb_type);
DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino);