From: Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx> We have a lot of declarations and not enough good comments on it. Claude AI generated comments for CephFS metadata structure declarations in include/linux/ceph/*.h. These comments have been reviewed, checked, and corrected. This patch adds comments for struct ceph_authorizer, struct ceph_auth_handshake, struct ceph_auth_client_ops, struct ceph_auth_client in /include/linux/ceph/auth.h. Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx> cc: Alex Markuze <amarkuze@xxxxxxxxxx> cc: Ilya Dryomov <idryomov@xxxxxxxxx> cc: Ceph Development <ceph-devel@xxxxxxxxxxxxxxx> --- include/linux/ceph/auth.h | 59 ++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/include/linux/ceph/auth.h b/include/linux/ceph/auth.h index 6b138fa97db8..339399cbabe9 100644 --- a/include/linux/ceph/auth.h +++ b/include/linux/ceph/auth.h @@ -15,22 +15,40 @@ struct ceph_auth_client; struct ceph_msg; +/* + * Abstract authorizer handle used for authentication with Ceph services. + * Each authentication protocol provides its own implementation. + */ struct ceph_authorizer { + /* Protocol-specific cleanup function */ void (*destroy)(struct ceph_authorizer *); }; +/* + * Authentication handshake state for communicating with a specific service. + * Contains authorizer data and cryptographic functions for message security. + */ struct ceph_auth_handshake { + /* The authorizer token for this service connection */ struct ceph_authorizer *authorizer; + /* Serialized authorizer data sent to the service */ void *authorizer_buf; size_t authorizer_buf_len; + /* Buffer for receiving authorizer reply from service */ void *authorizer_reply_buf; size_t authorizer_reply_buf_len; + /* Sign outgoing messages using session keys */ int (*sign_message)(struct ceph_auth_handshake *auth, struct ceph_msg *msg); + /* Verify signatures on incoming messages */ int (*check_message_signature)(struct ceph_auth_handshake *auth, struct ceph_msg *msg); }; +/* + * Protocol-specific operations for authentication with Ceph monitors. + * Each authentication method (cephx, etc.) implements these callbacks. + */ struct ceph_auth_client_ops { /* * true if we are authenticated and can connect to @@ -87,20 +105,35 @@ struct ceph_auth_client_ops { struct ceph_msg *msg); }; +/* + * Main authentication client state for communicating with Ceph monitors. + * Manages protocol negotiation, credentials, and service authorization. + */ struct ceph_auth_client { - u32 protocol; /* CEPH_AUTH_* */ - void *private; /* for use by protocol implementation */ - const struct ceph_auth_client_ops *ops; /* null iff protocol==0 */ - - bool negotiating; /* true if negotiating protocol */ - const char *name; /* entity name */ - u64 global_id; /* our unique id in system */ - const struct ceph_crypto_key *key; /* our secret key */ - unsigned want_keys; /* which services we want */ - - int preferred_mode; /* CEPH_CON_MODE_* */ - int fallback_mode; /* ditto */ - + /* Authentication protocol in use (CEPH_AUTH_*) */ + u32 protocol; + /* Protocol-specific private data */ + void *private; + /* Protocol operations vtable (null if protocol==0) */ + const struct ceph_auth_client_ops *ops; + + /* true if currently negotiating authentication protocol */ + bool negotiating; + /* Ceph entity name (e.g., "client.admin") */ + const char *name; + /* Unique identifier assigned by monitor */ + u64 global_id; + /* Secret key for authentication */ + const struct ceph_crypto_key *key; + /* Bitmask of services we want tickets for */ + unsigned want_keys; + + /* Preferred connection security mode */ + int preferred_mode; + /* Fallback connection security mode */ + int fallback_mode; + + /* Protects concurrent access to auth state */ struct mutex mutex; }; -- 2.51.0