aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_ll.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2018-08-14 21:37:02 +0200
committerNikolaus Rath <Nikolaus@rath.org>2018-10-10 10:49:48 +0100
commitaca50428c0d30f02d7599b5345145604986914f8 (patch)
tree75304dbdf78cd394a4829b405ac43131cc40a1d7 /example/passthrough_ll.c
parente164f3ddb59716fac1243b018d6fe035d6b5779c (diff)
downloadlibfuse-aca50428c0d30f02d7599b5345145604986914f8.tar.gz
passthrough_ll: add forget_multi()
Add method forget_multi() to forget multiple inodes in a single message. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'example/passthrough_ll.c')
-rw-r--r--example/passthrough_ll.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index 0c496de..1899e1e 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -518,7 +518,7 @@ static void unref_inode(struct lo_data *lo, struct lo_inode *inode, uint64_t n)
}
}
-static void lo_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
+static void lo_forget_one(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
{
struct lo_data *lo = lo_data(req);
struct lo_inode *inode = lo_inode(req, ino);
@@ -531,7 +531,21 @@ static void lo_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
}
unref_inode(lo, inode, nlookup);
+}
+
+static void lo_forget(fuse_req_t req, fuse_ino_t ino, uint64_t nlookup)
+{
+ lo_forget_one(req, ino, nlookup);
+ fuse_reply_none(req);
+}
+
+static void lo_forget_multi(fuse_req_t req, size_t count,
+ struct fuse_forget_data *forgets)
+{
+ int i;
+ for (i = 0; i < count; i++)
+ lo_forget_one(req, forgets[i].ino, forgets[i].nlookup);
fuse_reply_none(req);
}
@@ -886,6 +900,7 @@ static struct fuse_lowlevel_ops lo_oper = {
.rmdir = lo_rmdir,
.rename = lo_rename,
.forget = lo_forget,
+ .forget_multi = lo_forget_multi,
.getattr = lo_getattr,
.setattr = lo_setattr,
.readlink = lo_readlink,