diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index eeac43dd04eb..1b173edc8083 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -302,7 +302,8 @@ struct inode *ceph_alloc_inode(struct super_block *sb) | |||
302 | ci->i_version = 0; | 302 | ci->i_version = 0; |
303 | ci->i_time_warp_seq = 0; | 303 | ci->i_time_warp_seq = 0; |
304 | ci->i_ceph_flags = 0; | 304 | ci->i_ceph_flags = 0; |
305 | ci->i_release_count = 0; | 305 | atomic_set(&ci->i_release_count, 1); |
306 | atomic_set(&ci->i_complete_count, 0); | ||
306 | ci->i_symlink = NULL; | 307 | ci->i_symlink = NULL; |
307 | 308 | ||
308 | memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); | 309 | memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); |
@@ -721,9 +722,9 @@ static int fill_inode(struct inode *inode, | |||
721 | ceph_snap(inode) == CEPH_NOSNAP && | 722 | ceph_snap(inode) == CEPH_NOSNAP && |
722 | (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && | 723 | (le32_to_cpu(info->cap.caps) & CEPH_CAP_FILE_SHARED) && |
723 | (issued & CEPH_CAP_FILE_EXCL) == 0 && | 724 | (issued & CEPH_CAP_FILE_EXCL) == 0 && |
724 | (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { | 725 | !__ceph_dir_is_complete(ci)) { |
725 | dout(" marking %p complete (empty)\n", inode); | 726 | dout(" marking %p complete (empty)\n", inode); |
726 | ci->i_ceph_flags |= CEPH_I_COMPLETE; | 727 | __ceph_dir_set_complete(ci, atomic_read(&ci->i_release_count)); |
727 | ci->i_max_offset = 2; | 728 | ci->i_max_offset = 2; |
728 | } | 729 | } |
729 | no_change: | 730 | no_change: |
@@ -857,7 +858,7 @@ static void ceph_set_dentry_offset(struct dentry *dn) | |||
857 | di = ceph_dentry(dn); | 858 | di = ceph_dentry(dn); |
858 | 859 | ||
859 | spin_lock(&ci->i_ceph_lock); | 860 | spin_lock(&ci->i_ceph_lock); |
860 | if ((ceph_inode(inode)->i_ceph_flags & CEPH_I_COMPLETE) == 0) { | 861 | if (!__ceph_dir_is_complete(ci)) { |
861 | spin_unlock(&ci->i_ceph_lock); | 862 | spin_unlock(&ci->i_ceph_lock); |
862 | return; | 863 | return; |
863 | } | 864 | } |
@@ -1061,8 +1062,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
1061 | /* | 1062 | /* |
1062 | * d_move() puts the renamed dentry at the end of | 1063 | * d_move() puts the renamed dentry at the end of |
1063 | * d_subdirs. We need to assign it an appropriate | 1064 | * d_subdirs. We need to assign it an appropriate |
1064 | * directory offset so we can behave when holding | 1065 | * directory offset so we can behave when dir is |
1065 | * I_COMPLETE. | 1066 | * complete. |
1066 | */ | 1067 | */ |
1067 | ceph_set_dentry_offset(req->r_old_dentry); | 1068 | ceph_set_dentry_offset(req->r_old_dentry); |
1068 | dout("dn %p gets new offset %lld\n", req->r_old_dentry, | 1069 | dout("dn %p gets new offset %lld\n", req->r_old_dentry, |