diff options
author | Yan, Zheng <zyan@redhat.com> | 2019-01-23 04:20:00 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-03-05 18:55:17 +0100 |
commit | 32f6511a69eb36db9c6b9d77b8429837079f73b6 (patch) | |
tree | 375c8c7cf9d968fff66c70423de97496a2584488 /fs/ceph | |
parent | ceph: pass inclusive lend parameter to filemap_write_and_wait_range() (diff) | |
download | linux-32f6511a69eb36db9c6b9d77b8429837079f73b6.tar.xz linux-32f6511a69eb36db9c6b9d77b8429837079f73b6.zip |
ceph: touch existing cap when handling reply
Move cap to tail of session->s_caps list. So ceph_trim_caps() will
trim older caps first.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index da5b56e14cc7..6fbdc1a0afbe 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -657,6 +657,10 @@ void ceph_add_cap(struct inode *inode, session->s_nr_caps++; spin_unlock(&session->s_cap_lock); } else { + spin_lock(&session->s_cap_lock); + list_move_tail(&cap->session_caps, &session->s_caps); + spin_unlock(&session->s_cap_lock); + if (cap->cap_gen < session->s_cap_gen) cap->issued = cap->implemented = CEPH_CAP_PIN; |