diff options
author | Jeff Layton <jlayton@kernel.org> | 2020-04-01 17:07:52 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-06-01 13:22:52 +0200 |
commit | 1cf03a68e791b1673bc4daaa88a0820f34f538f8 (patch) | |
tree | f264e092d23e310ce86bf25052dd592e7cb5e141 /fs/ceph/mds_client.h | |
parent | 6f05b30ea063a2a05dda47a4105a69267ae5270f (diff) | |
download | linux-1cf03a68e791b1673bc4daaa88a0820f34f538f8.tar.gz linux-1cf03a68e791b1673bc4daaa88a0820f34f538f8.tar.bz2 linux-1cf03a68e791b1673bc4daaa88a0820f34f538f8.zip |
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>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r-- | fs/ceph/mds_client.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index cceeb33f2ff9..788182adcc51 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h @@ -199,8 +199,10 @@ struct ceph_mds_session { struct list_head s_cap_releases; /* waiting cap_release messages */ struct work_struct s_cap_release_work; - /* protected by mutex */ + /* both protected by s_mdsc->cap_dirty_lock */ + struct list_head s_cap_dirty; /* inodes w/ dirty caps */ struct list_head s_cap_flushing; /* inodes w/ flushing caps */ + unsigned long s_renew_requested; /* last time we sent a renew req */ u64 s_renew_seq; @@ -424,7 +426,6 @@ struct ceph_mds_client { u64 last_cap_flush_tid; struct list_head cap_flush_list; - struct list_head cap_dirty; /* inodes with dirty caps */ struct list_head cap_dirty_migrating; /* ...that are migration... */ int num_cap_flushing; /* # caps we are flushing */ spinlock_t cap_dirty_lock; /* protects above items */ |