From d915a6b4a84ae6e82f3756df9ca695395e5aacfe Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 19 May 2011 15:26:37 +0200 Subject: Allow batching of forget requests This allows forget requests to be processed faster and doesn't require a modification to fuse filesystems. Reported by Terje Malmedal --- lib/fuse_loop_mt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/fuse_loop_mt.c') diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 694f98c..ab5fd11 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -99,9 +99,13 @@ static void *fuse_do_work(void *data) * This disgusting hack is needed so that zillions of threads * are not created on a burst of FORGET messages */ - if (!(fbuf.flags & FUSE_BUF_IS_FD) && - ((struct fuse_in_header *) fbuf.mem)->opcode == FUSE_FORGET) - isforget = 1; + if (!(fbuf.flags & FUSE_BUF_IS_FD)) { + struct fuse_in_header *in = fbuf.mem; + + if (in->opcode == FUSE_FORGET || + in->opcode == FUSE_BATCH_FORGET) + isforget = 1; + } if (!isforget) mt->numavail--; -- cgit v1.2.3