diff options
author | Yan, Zheng <zyan@redhat.com> | 2020-03-05 20:21:01 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-03-30 12:42:42 +0200 |
commit | a0d93e327fc424b94e78a1b25287bb4e632ee054 (patch) | |
tree | 3a8009ef9428cc1d4ca064a32aac93fa1abff9c1 /fs/ceph/file.c | |
parent | 719a2514e9bf313c3627078926d56bc2a8b290d1 (diff) |
ceph: remove delay check logic from ceph_check_caps()
__ceph_caps_file_wanted() already checks 'caps_wanted_delay_min' and
'caps_wanted_delay_max'. There is no need to duplicate the logic in
ceph_check_caps() and __send_cap()
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6239cff491e2..39b364a51c17 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1826,7 +1826,7 @@ retry_snap: if (dirty) __mark_inode_dirty(inode, dirty); if (ceph_quota_is_max_bytes_approaching(inode, iocb->ki_pos)) - ceph_check_caps(ci, CHECK_CAPS_NODELAY, NULL); + ceph_check_caps(ci, 0, NULL); } dout("aio_write %p %llx.%llx %llu~%u dropping cap refs on %s\n", @@ -2427,15 +2427,10 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off, inode_inc_iversion_raw(dst_inode); if (dst_off > size) { - int caps_flags = 0; - /* Let the MDS know about dst file size change */ - if (ceph_quota_is_max_bytes_approaching(dst_inode, dst_off)) - caps_flags |= CHECK_CAPS_NODELAY; - if (ceph_inode_set_size(dst_inode, dst_off)) - caps_flags |= CHECK_CAPS_AUTHONLY; - if (caps_flags) - ceph_check_caps(dst_ci, caps_flags, NULL); + if (ceph_inode_set_size(dst_inode, dst_off) || + ceph_quota_is_max_bytes_approaching(dst_inode, dst_off)) + ceph_check_caps(dst_ci, CHECK_CAPS_AUTHONLY, NULL); } /* Mark Fw dirty */ spin_lock(&dst_ci->i_ceph_lock); |