diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-05-19 15:26:37 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-05-19 15:26:37 +0200 |
commit | d915a6b4a84ae6e82f3756df9ca695395e5aacfe (patch) | |
tree | 9755b85c71fc7392b6253ba4715fc6fe3a08390b /lib/fuse_loop_mt.c | |
parent | 9c526a7a54b90608463380deffe94e1c9d17db15 (diff) |
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
Diffstat (limited to 'lib/fuse_loop_mt.c')
-rw-r--r-- | lib/fuse_loop_mt.c | 10 |
1 files changed, 7 insertions, 3 deletions
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--; |