diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-04-08 10:36:01 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-05-07 13:22:37 -0400 |
commit | ffb61c55b2501c3dcd266856e25430ae8e3753d6 (patch) | |
tree | 2e384e32c9decb899ba6bc25e07fcb962e314dcc | |
parent | 0384892c2d839033566b53453be44b1f5812cd00 (diff) |
ceph: remove superfluous inode_lock in ceph_fsync
Originally, filemap_write_and_wait took the i_mutex internally, but
commit 02c24a82187d pushed the mutex acquisition into the individual
fsync routines, leaving it up to the subsystem maintainers to remove
it if it wasn't needed.
For ceph, I see no reason to take the inode_lock here. All of the
operations inside that lock are protected by their own locking.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r-- | fs/ceph/caps.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 36a8dc699448..f976939f771f 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -2257,8 +2257,6 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2257 | if (datasync) | 2257 | if (datasync) |
2258 | goto out; | 2258 | goto out; |
2259 | 2259 | ||
2260 | inode_lock(inode); | ||
2261 | |||
2262 | dirty = try_flush_caps(inode, &flush_tid); | 2260 | dirty = try_flush_caps(inode, &flush_tid); |
2263 | dout("fsync dirty caps are %s\n", ceph_cap_string(dirty)); | 2261 | dout("fsync dirty caps are %s\n", ceph_cap_string(dirty)); |
2264 | 2262 | ||
@@ -2273,7 +2271,6 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2273 | ret = wait_event_interruptible(ci->i_cap_wq, | 2271 | ret = wait_event_interruptible(ci->i_cap_wq, |
2274 | caps_are_flushed(inode, flush_tid)); | 2272 | caps_are_flushed(inode, flush_tid)); |
2275 | } | 2273 | } |
2276 | inode_unlock(inode); | ||
2277 | out: | 2274 | out: |
2278 | dout("fsync %p%s result=%d\n", inode, datasync ? " datasync" : "", ret); | 2275 | dout("fsync %p%s result=%d\n", inode, datasync ? " datasync" : "", ret); |
2279 | return ret; | 2276 | return ret; |