diff options
author | Sage Weil <sage@newdream.net> | 2010-05-14 13:02:57 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-05-17 18:25:40 -0400 |
commit | 167c9e352deb7e25568c926c49c3eafad69cbe76 (patch) | |
tree | b420c256e60accca30704059ab676e878cf49603 /fs/ceph/inode.c | |
parent | 85792d0dd6e7a7a18fba55c97e49871211b28fe0 (diff) |
ceph: use common helper for aborted dir request invalidation
We invalidate I_COMPLETE and dentry leases in two places: on aborted mds
request and on request replay. Use common helper to avoid duplicate code.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 1bcf98bd0255..a81b8b662c7b 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -941,21 +941,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
941 | 941 | ||
942 | if (!rinfo->head->is_target && !rinfo->head->is_dentry) { | 942 | if (!rinfo->head->is_target && !rinfo->head->is_dentry) { |
943 | dout("fill_trace reply is empty!\n"); | 943 | dout("fill_trace reply is empty!\n"); |
944 | if (rinfo->head->result == 0 && req->r_locked_dir) { | 944 | if (rinfo->head->result == 0 && req->r_locked_dir) |
945 | struct ceph_inode_info *ci = | 945 | ceph_invalidate_dir_request(req); |
946 | ceph_inode(req->r_locked_dir); | ||
947 | dout(" clearing %p complete (empty trace)\n", | ||
948 | req->r_locked_dir); | ||
949 | spin_lock(&req->r_locked_dir->i_lock); | ||
950 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | ||
951 | ci->i_release_count++; | ||
952 | spin_unlock(&req->r_locked_dir->i_lock); | ||
953 | |||
954 | if (req->r_dentry) | ||
955 | ceph_invalidate_dentry_lease(req->r_dentry); | ||
956 | if (req->r_old_dentry) | ||
957 | ceph_invalidate_dentry_lease(req->r_old_dentry); | ||
958 | } | ||
959 | return 0; | 946 | return 0; |
960 | } | 947 | } |
961 | 948 | ||