]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: convert mdsc->cap_dirty to a per-session list
authorJeff Layton <jlayton@kernel.org>
Wed, 1 Apr 2020 21:07:52 +0000 (17:07 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 1 Jun 2020 11:22:52 +0000 (13:22 +0200)
commit9f2e9a13ef12bd901693d9336491e94bcef4ae23
treef264e092d23e310ce86bf25052dd592e7cb5e141
parent500f2acee5b1c590705aa2ffddd836a8c28833db
ceph: convert mdsc->cap_dirty to a per-session list

This is a per-sb list now, but that makes it difficult to tell when
the cap is the last dirty one associated with the session. Switch
this to be a per-session list, but continue using the
mdsc->cap_dirty_lock to protect the lists.

This list is only ever walked in ceph_flush_dirty_caps, so change that
to walk the sessions array and then flush the caps for inodes on each
session's list.

If the auth cap ever changes while the inode has dirty caps, then
move the inode to the appropriate session for the new auth_cap. Also,
ensure that we never remove an auth cap while the inode is still on the
s_cap_dirty list.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/super.h