diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-02-06 17:29:01 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-02-07 08:25:44 -0500 |
commit | 634734b63ac39e137a1c623ba74f3e062b6577db (patch) | |
tree | 65e2414fb7d31005d473719f7158f29bc9ca48d0 /fs/fuse/inode.c | |
parent | 7e98d53086d18c877cb44e9065219335184024de (diff) |
fuse: allow control of adaptive readdirplus use
For some filesystems (e.g. GlusterFS), the cost of performing a
normal readdir and readdirplus are identical. Since adaptively
using readdirplus has no benefit for those systems, give
users/filesystems the option to control adaptive readdirplus use.
v2 of this patch incorporates Miklos's suggestion to simplify the code,
as well as improving consistency of macro names and documentation.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 9876a87255fe..01353ed75750 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -866,6 +866,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req) | |||
866 | fc->auto_inval_data = 1; | 866 | fc->auto_inval_data = 1; |
867 | if (arg->flags & FUSE_DO_READDIRPLUS) | 867 | if (arg->flags & FUSE_DO_READDIRPLUS) |
868 | fc->do_readdirplus = 1; | 868 | fc->do_readdirplus = 1; |
869 | if (arg->flags & FUSE_READDIRPLUS_AUTO) | ||
870 | fc->readdirplus_auto = 1; | ||
869 | } else { | 871 | } else { |
870 | ra_pages = fc->max_read / PAGE_CACHE_SIZE; | 872 | ra_pages = fc->max_read / PAGE_CACHE_SIZE; |
871 | fc->no_lock = 1; | 873 | fc->no_lock = 1; |
@@ -893,7 +895,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req) | |||
893 | FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES | FUSE_DONT_MASK | | 895 | FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES | FUSE_DONT_MASK | |
894 | FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ | | 896 | FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ | |
895 | FUSE_FLOCK_LOCKS | FUSE_IOCTL_DIR | FUSE_AUTO_INVAL_DATA | | 897 | FUSE_FLOCK_LOCKS | FUSE_IOCTL_DIR | FUSE_AUTO_INVAL_DATA | |
896 | FUSE_DO_READDIRPLUS; | 898 | FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO; |
897 | req->in.h.opcode = FUSE_INIT; | 899 | req->in.h.opcode = FUSE_INIT; |
898 | req->in.numargs = 1; | 900 | req->in.numargs = 1; |
899 | req->in.args[0].size = sizeof(*arg); | 901 | req->in.args[0].size = sizeof(*arg); |