diff options
author | Sage Weil <sage@newdream.net> | 2012-01-10 12:12:55 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-01-12 14:00:40 -0500 |
commit | a40dc6cc2e121abcbd1b22583ef5447763df510c (patch) | |
tree | 1c747cfabf33c6c9ad56811fabd22285816fc27a /fs/ceph/dir.c | |
parent | 46f72b349290d2bd7aecea38f02609d814332df6 (diff) |
ceph: enable/disable dentry complete flags via mount option
Enable/disable use of the dentry dir 'complete' flag via a mount option.
This lets the admin control whether ceph uses the dcache to satisfy
negative lookups or readdir when it has the entire directory contents in
its cache.
This is purely a performance optimization; correctness is guaranteed
whether it is enabled or not.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r-- | fs/ceph/dir.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 974ef1e4d268..5259abfb5dd9 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -1094,17 +1094,36 @@ static int ceph_snapdir_d_revalidate(struct dentry *dentry, | |||
1094 | */ | 1094 | */ |
1095 | void ceph_dir_set_complete(struct inode *inode) | 1095 | void ceph_dir_set_complete(struct inode *inode) |
1096 | { | 1096 | { |
1097 | /* not yet implemented */ | 1097 | struct dentry *dentry = d_find_any_alias(inode); |
1098 | |||
1099 | if (dentry && ceph_dentry(dentry) && | ||
1100 | ceph_test_mount_opt(ceph_sb_to_client(dentry->d_sb), DCACHE)) { | ||
1101 | dout(" marking %p (%p) complete\n", inode, dentry); | ||
1102 | set_bit(CEPH_D_COMPLETE, &ceph_dentry(dentry)->flags); | ||
1103 | } | ||
1104 | dput(dentry); | ||
1098 | } | 1105 | } |
1099 | 1106 | ||
1100 | void ceph_dir_clear_complete(struct inode *inode) | 1107 | void ceph_dir_clear_complete(struct inode *inode) |
1101 | { | 1108 | { |
1102 | /* not yet implemented */ | 1109 | struct dentry *dentry = d_find_any_alias(inode); |
1110 | |||
1111 | if (dentry && ceph_dentry(dentry)) { | ||
1112 | dout(" marking %p (%p) complete\n", inode, dentry); | ||
1113 | set_bit(CEPH_D_COMPLETE, &ceph_dentry(dentry)->flags); | ||
1114 | } | ||
1115 | dput(dentry); | ||
1103 | } | 1116 | } |
1104 | 1117 | ||
1105 | bool ceph_dir_test_complete(struct inode *inode) | 1118 | bool ceph_dir_test_complete(struct inode *inode) |
1106 | { | 1119 | { |
1107 | /* not yet implemented */ | 1120 | struct dentry *dentry = d_find_any_alias(inode); |
1121 | |||
1122 | if (dentry && ceph_dentry(dentry)) { | ||
1123 | dout(" marking %p (%p) NOT complete\n", inode, dentry); | ||
1124 | clear_bit(CEPH_D_COMPLETE, &ceph_dentry(dentry)->flags); | ||
1125 | } | ||
1126 | dput(dentry); | ||
1108 | return false; | 1127 | return false; |
1109 | } | 1128 | } |
1110 | 1129 | ||