diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-03-13 07:44:32 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:07 -0400 |
commit | 2f276c511137d97e56b19e29865e1e6569315ccb (patch) | |
tree | f29a8088a6f312ec40f03b96d96b34e69154627a /fs/ceph/caps.c | |
parent | 8a166d05369f6a0369bb194a795e6e3928ac6e34 (diff) |
ceph: use i_release_count to indicate dir's completeness
Current ceph code tracks directory's completeness in two places.
ceph_readdir() checks i_release_count to decide if it can set the
I_COMPLETE flag in i_ceph_flags. All other places check the I_COMPLETE
flag. This indirection introduces locking complexity.
This patch adds a new variable i_complete_count to ceph_inode_info.
Set i_release_count's value to it when marking a directory complete.
By comparing the two variables, we know if a directory is complete
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index bc575a4a813e..f9563108d189 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -490,7 +490,7 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, | |||
490 | ci->i_rdcache_gen++; | 490 | ci->i_rdcache_gen++; |
491 | 491 | ||
492 | /* | 492 | /* |
493 | * if we are newly issued FILE_SHARED, clear I_COMPLETE; we | 493 | * if we are newly issued FILE_SHARED, mark dir not complete; we |
494 | * don't know what happened to this directory while we didn't | 494 | * don't know what happened to this directory while we didn't |
495 | * have the cap. | 495 | * have the cap. |
496 | */ | 496 | */ |
@@ -499,7 +499,7 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, | |||
499 | ci->i_shared_gen++; | 499 | ci->i_shared_gen++; |
500 | if (S_ISDIR(ci->vfs_inode.i_mode)) { | 500 | if (S_ISDIR(ci->vfs_inode.i_mode)) { |
501 | dout(" marking %p NOT complete\n", &ci->vfs_inode); | 501 | dout(" marking %p NOT complete\n", &ci->vfs_inode); |
502 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | 502 | __ceph_dir_clear_complete(ci); |
503 | } | 503 | } |
504 | } | 504 | } |
505 | } | 505 | } |