diff options
author | Sage Weil <sage@newdream.net> | 2011-05-27 09:24:26 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-06-07 21:34:11 -0700 |
commit | 70b666c3b4cb2b96098d80e6f515e4bc6d37db5a (patch) | |
tree | dd82036114adf9d0c28120500d58833cacfbc004 /fs/ceph/caps.c | |
parent | db3540522e955c1ebb391f4f5324dff4f20ecd09 (diff) | |
download | blackbird-op-linux-70b666c3b4cb2b96098d80e6f515e4bc6d37db5a.tar.gz blackbird-op-linux-70b666c3b4cb2b96098d80e6f515e4bc6d37db5a.zip |
ceph: use ihold when we already have an inode ref
We should use ihold whenever we already have a stable inode ref, even
when we aren't holding i_lock. This avoids adding new and unnecessary
locking dependencies.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 1f72b00447c4..f605753c8fe9 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2940,14 +2940,12 @@ void ceph_flush_dirty_caps(struct ceph_mds_client *mdsc) while (!list_empty(&mdsc->cap_dirty)) { ci = list_first_entry(&mdsc->cap_dirty, struct ceph_inode_info, i_dirty_item); - inode = igrab(&ci->vfs_inode); + inode = &ci->vfs_inode; + ihold(inode); dout("flush_dirty_caps %p\n", inode); spin_unlock(&mdsc->cap_dirty_lock); - if (inode) { - ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_FLUSH, - NULL); - iput(inode); - } + ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_FLUSH, NULL); + iput(inode); spin_lock(&mdsc->cap_dirty_lock); } spin_unlock(&mdsc->cap_dirty_lock); |