Commit c74d79af authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

ceph: comment cleanups and clarifications

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 16d68903
...@@ -1922,12 +1922,24 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, ...@@ -1922,12 +1922,24 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
retry: retry:
spin_lock(&ci->i_ceph_lock); spin_lock(&ci->i_ceph_lock);
retry_locked: retry_locked:
/* Caps wanted by virtue of active open files. */
file_wanted = __ceph_caps_file_wanted(ci); file_wanted = __ceph_caps_file_wanted(ci);
/* Caps which have active references against them */
used = __ceph_caps_used(ci); used = __ceph_caps_used(ci);
/*
* "issued" represents the current caps that the MDS wants us to have.
* "implemented" is the set that we have been granted, and includes the
* ones that have not yet been returned to the MDS (the "revoking" set,
* usually because they have outstanding references).
*/
issued = __ceph_caps_issued(ci, &implemented); issued = __ceph_caps_issued(ci, &implemented);
revoking = implemented & ~issued; revoking = implemented & ~issued;
want = file_wanted; want = file_wanted;
/* The ones we currently want to retain (may be adjusted below) */
retain = file_wanted | used | CEPH_CAP_PIN; retain = file_wanted | used | CEPH_CAP_PIN;
if (!mdsc->stopping && inode->i_nlink > 0) { if (!mdsc->stopping && inode->i_nlink > 0) {
if (file_wanted) { if (file_wanted) {
...@@ -2005,6 +2017,10 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, ...@@ -2005,6 +2017,10 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
/* NOTE: no side-effects allowed, until we take s_mutex */ /* NOTE: no side-effects allowed, until we take s_mutex */
/*
* If we have an auth cap, we don't need to consider any
* overlapping caps as used.
*/
cap_used = used; cap_used = used;
if (ci->i_auth_cap && cap != ci->i_auth_cap) if (ci->i_auth_cap && cap != ci->i_auth_cap)
cap_used &= ~ci->i_auth_cap->issued; cap_used &= ~ci->i_auth_cap->issued;
......
...@@ -393,7 +393,7 @@ struct ceph_mds_client { ...@@ -393,7 +393,7 @@ struct ceph_mds_client {
struct ceph_mds_session **sessions; /* NULL for mds if no session */ struct ceph_mds_session **sessions; /* NULL for mds if no session */
atomic_t num_sessions; atomic_t num_sessions;
int max_sessions; /* len of s_mds_sessions */ int max_sessions; /* len of sessions array */
int stopping; /* true if shutting down */ int stopping; /* true if shutting down */
atomic64_t quotarealms_count; /* # realms with quota */ atomic64_t quotarealms_count; /* # realms with quota */
......
...@@ -160,7 +160,8 @@ struct ceph_cap { ...@@ -160,7 +160,8 @@ struct ceph_cap {
int issued; /* latest, from the mds */ int issued; /* latest, from the mds */
int implemented; /* implemented superset of int implemented; /* implemented superset of
issued (for revocation) */ issued (for revocation) */
int mds, mds_wanted; int mds; /* mds index for this cap */
int mds_wanted; /* caps wanted from this mds */
}; };
/* caps to release */ /* caps to release */
struct { struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment