diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-03-04 03:05:04 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-20 10:30:22 -0400 |
commit | e2c3de046c5a1f3525772b4cacc7731cb626ab61 (patch) | |
tree | dc8b34b50527d97a49f26610c25a150e007fcfdb /fs/ceph | |
parent | 6e6f09231a134e7523514ed504380f5caafc9334 (diff) |
ceph: fix dcache/nocache mount option
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/dir.c | 2 | ||||
-rw-r--r-- | fs/ceph/super.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 83e9976f7189..92a6b6018511 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -281,6 +281,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) | |||
281 | /* can we use the dcache? */ | 281 | /* can we use the dcache? */ |
282 | spin_lock(&ci->i_ceph_lock); | 282 | spin_lock(&ci->i_ceph_lock); |
283 | if ((ctx->pos == 2 || fi->dentry) && | 283 | if ((ctx->pos == 2 || fi->dentry) && |
284 | ceph_test_mount_opt(fsc, DCACHE) && | ||
284 | !ceph_test_mount_opt(fsc, NOASYNCREADDIR) && | 285 | !ceph_test_mount_opt(fsc, NOASYNCREADDIR) && |
285 | ceph_snap(inode) != CEPH_SNAPDIR && | 286 | ceph_snap(inode) != CEPH_SNAPDIR && |
286 | __ceph_dir_is_complete_ordered(ci) && | 287 | __ceph_dir_is_complete_ordered(ci) && |
@@ -629,6 +630,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, | |||
629 | fsc->mount_options->snapdir_name, | 630 | fsc->mount_options->snapdir_name, |
630 | dentry->d_name.len) && | 631 | dentry->d_name.len) && |
631 | !is_root_ceph_dentry(dir, dentry) && | 632 | !is_root_ceph_dentry(dir, dentry) && |
633 | ceph_test_mount_opt(fsc, DCACHE) && | ||
632 | __ceph_dir_is_complete(ci) && | 634 | __ceph_dir_is_complete(ci) && |
633 | (__ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1))) { | 635 | (__ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1))) { |
634 | spin_unlock(&ci->i_ceph_lock); | 636 | spin_unlock(&ci->i_ceph_lock); |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 04c8124ed30e..f8ea7ebe9d1f 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -36,7 +36,8 @@ | |||
36 | #define CEPH_MOUNT_OPT_DCACHE (1<<9) /* use dcache for readdir etc */ | 36 | #define CEPH_MOUNT_OPT_DCACHE (1<<9) /* use dcache for readdir etc */ |
37 | #define CEPH_MOUNT_OPT_FSCACHE (1<<10) /* use fscache */ | 37 | #define CEPH_MOUNT_OPT_FSCACHE (1<<10) /* use fscache */ |
38 | 38 | ||
39 | #define CEPH_MOUNT_OPT_DEFAULT (CEPH_MOUNT_OPT_RBYTES) | 39 | #define CEPH_MOUNT_OPT_DEFAULT (CEPH_MOUNT_OPT_RBYTES | \ |
40 | CEPH_MOUNT_OPT_DCACHE) | ||
40 | 41 | ||
41 | #define ceph_set_mount_opt(fsc, opt) \ | 42 | #define ceph_set_mount_opt(fsc, opt) \ |
42 | (fsc)->mount_options->flags |= CEPH_MOUNT_OPT_##opt; | 43 | (fsc)->mount_options->flags |= CEPH_MOUNT_OPT_##opt; |