aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-11-03 12:23:36 -0400
committerSage Weil <sage@newdream.net>2011-11-06 00:10:10 -0400
commitc6ffe10015f4e6fba8a915318b319c43aed1836f (patch)
treedd39730aeb6d00713ca27a1bf34b116d31479151 /fs/ceph/inode.c
parentb58dc4100b9190f2cb437f1f67ffcb9f9acc4923 (diff)
ceph: use new D_COMPLETE dentry flag
We used to use a flag on the directory inode to track whether the dcache contents for a directory were a complete cached copy. Switch to a dentry flag CEPH_D_COMPLETE that is safely updated by ->d_prune(). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 1616a0d37cbd..e392bfce84a3 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -771,9 +771,9 @@ no_change:
771 ceph_snap(inode) == CEPH_NOSNAP && 771 ceph_snap(inode) == CEPH_NOSNAP &&
772 (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && 772 (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) &&
773 (issued & CEPH_CAP_FILE_EXCL) == 0 && 773 (issued & CEPH_CAP_FILE_EXCL) == 0 &&
774 (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { 774 !ceph_dir_test_complete(inode)) {
775 dout(" marking %p complete (empty)\n", inode); 775 dout(" marking %p complete (empty)\n", inode);
776 /* ci->i_ceph_flags |= CEPH_I_COMPLETE; */ 776 ceph_dir_set_complete(inode);
777 ci->i_max_offset = 2; 777 ci->i_max_offset = 2;
778 } 778 }
779 779
@@ -856,7 +856,7 @@ static void ceph_set_dentry_offset(struct dentry *dn)
856 di = ceph_dentry(dn); 856 di = ceph_dentry(dn);
857 857
858 spin_lock(&inode->i_lock); 858 spin_lock(&inode->i_lock);
859 if ((ceph_inode(inode)->i_ceph_flags & CEPH_I_COMPLETE) == 0) { 859 if (!ceph_dir_test_complete(inode)) {
860 spin_unlock(&inode->i_lock); 860 spin_unlock(&inode->i_lock);
861 return; 861 return;
862 } 862 }
@@ -1056,7 +1056,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
1056 * d_move() puts the renamed dentry at the end of 1056 * d_move() puts the renamed dentry at the end of
1057 * d_subdirs. We need to assign it an appropriate 1057 * d_subdirs. We need to assign it an appropriate
1058 * directory offset so we can behave when holding 1058 * directory offset so we can behave when holding
1059 * I_COMPLETE. 1059 * D_COMPLETE.
1060 */ 1060 */
1061 ceph_set_dentry_offset(req->r_old_dentry); 1061 ceph_set_dentry_offset(req->r_old_dentry);
1062 dout("dn %p gets new offset %lld\n", req->r_old_dentry, 1062 dout("dn %p gets new offset %lld\n", req->r_old_dentry,