diff --git a/fs/cifsd/oplock.c b/fs/cifsd/oplock.c index f694c14be0df..e56c938a8f7a 100644 --- a/fs/cifsd/oplock.c +++ b/fs/cifsd/oplock.c @@ -21,11 +21,10 @@ static LIST_HEAD(lease_table_list); static DEFINE_RWLOCK(lease_list_lock); /** - * get_new_opinfo() - allocate a new opinfo object for oplock info - * @conn: connection instance + * alloc_opinfo() - allocate a new opinfo object for oplock info + * @work: smb work * @id: fid of open file * @Tid: tree id of connection - * @lctx: lease context information * * Return: allocated opinfo object on success, otherwise NULL */ @@ -462,14 +461,6 @@ static void grant_none_oplock(struct oplock_info *opinfo_new, } } -/** - * find_opinfo() - find lease object for given client guid and lease key - * @head: oplock list(read,write or none) head - * @guid1: client guid of matching lease owner - * @key1: lease key of matching lease owner - * - * Return: oplock(lease) object on success, otherwise NULL - */ static inline int compare_guid_key(struct oplock_info *opinfo, const char *guid1, const char *key1) { @@ -610,9 +601,9 @@ static inline int allocate_oplock_break_buf(struct ksmbd_work *work) } /** - * smb2_oplock_break_noti() - send smb2 oplock break cmd from conn + * __smb2_oplock_break_noti() - send smb2 oplock break cmd from conn * to client - * @work: smb work object + * @wk: smb work object * * There are two ways this function can be called. 1- while file open we break * from exclusive/batch lock to levelII oplock and 2- while file write/truncate @@ -686,10 +677,9 @@ static void __smb2_oplock_break_noti(struct work_struct *wk) } /** - * smb2_oplock_break() - send smb2 exclusive/batch to level2 oplock + * smb2_oplock_break_noti() - send smb2 exclusive/batch to level2 oplock * break command from server to client * @opinfo: oplock info object - * @ack_required if requiring ack * * Return: 0 on success, otherwise error */ @@ -734,7 +724,7 @@ static int smb2_oplock_break_noti(struct oplock_info *opinfo) /** * __smb2_lease_break_noti() - send lease break command from server * to client - * @work: smb work object + * @wk: smb work object */ static void __smb2_lease_break_noti(struct work_struct *wk) { @@ -790,10 +780,9 @@ static void __smb2_lease_break_noti(struct work_struct *wk) } /** - * smb2_break_lease() - break lease when a new client request + * smb2_lease_break_noti() - break lease when a new client request * write lease * @opinfo: conains lease state information - * @ack_required: if requring ack * * Return: 0 on success, otherwise error */ @@ -1085,12 +1074,13 @@ static void set_oplock_level(struct oplock_info *opinfo, int level, /** * smb_grant_oplock() - handle oplock/lease request on file open - * @fp: ksmbd file pointer - * @oplock: granted oplock type - * @id: fid of open file - * @Tid: Tree id of connection - * @lctx: lease context information on file open - * @attr_only: attribute only file open type + * @work: smb work + * @req_op_level: oplock level + * @pid: id of open file + * @fp: ksmbd file pointer + * @tid: Tree id of connection + * @lctx: lease context information on file open + * @share_ret: share mode * * Return: 0 on success, otherwise error */ @@ -1222,10 +1212,10 @@ err_out: } /** - * smb_break_write_oplock() - break batch/exclusive oplock to level2 + * smb_break_all_write_oplock() - break batch/exclusive oplock to level2 * @work: smb work * @fp: ksmbd file pointer - * @openfile: open file object + * @is_trunc: truncate on open */ static void smb_break_all_write_oplock(struct ksmbd_work *work, struct ksmbd_file *fp, int is_trunc) @@ -1250,7 +1240,7 @@ static void smb_break_all_write_oplock(struct ksmbd_work *work, /** * smb_break_all_levII_oplock() - send level2 oplock or read lease break command * from server to client - * @conn: connection instance + * @work: smb work * @fp: ksmbd file pointer * @is_trunc: truncate on open */ @@ -1351,7 +1341,7 @@ __u8 smb2_map_lease_to_oplock(__le32 lease_state) /** * create_lease_buf() - create lease context for open cmd response * @rbuf: buffer to create lease context response - * @lreq: buffer to stored parsed lease state information + * @lease: buffer to stored parsed lease state information */ void create_lease_buf(u8 *rbuf, struct lease *lease) { @@ -1378,7 +1368,6 @@ void create_lease_buf(u8 *rbuf, struct lease *lease) /** * parse_lease_state() - parse lease context containted in file open request * @open_req: buffer containing smb2 file open(create) request - * @lreq: buffer to stored parsed lease state information * * Return: oplock state, -ENOENT if create lease context not found */ @@ -1426,7 +1415,7 @@ struct lease_ctx_info *parse_lease_state(void *open_req) /** * smb2_find_context_vals() - find a particular context info in open request * @open_req: buffer containing smb2 file open(create) request - * @str: context name to search for + * @tag: context name to search for * * Return: pointer to requested context, NULL if @str context not found */ @@ -1458,7 +1447,7 @@ struct create_context *smb2_find_context_vals(void *open_req, const char *tag) } /** - * create_durable_buf() - create durable handle context + * create_durable_rsp__buf() - create durable handle context * @cc: buffer to create durable context response */ void create_durable_rsp_buf(char *cc) @@ -1481,8 +1470,9 @@ void create_durable_rsp_buf(char *cc) } /** - * create_durable_buf() - create durable handle v2 context + * create_durable_v2_rsp_buf() - create durable handle v2 context * @cc: buffer to create durable context response + * @fp: ksmbd file pointer */ void create_durable_v2_rsp_buf(char *cc, struct ksmbd_file *fp) { @@ -1508,8 +1498,9 @@ void create_durable_v2_rsp_buf(char *cc, struct ksmbd_file *fp) } /** - * create_mxac_buf() - create query maximal access context - * @cc: buffer to create maximal access context response + * create_mxac_rsp_buf() - create query maximal access context + * @cc: buffer to create maximal access context response + * @maximal_access: maximal access */ void create_mxac_rsp_buf(char *cc, int maximal_access) { @@ -1533,10 +1524,6 @@ void create_mxac_rsp_buf(char *cc, int maximal_access) buf->MaximalAccess = cpu_to_le32(maximal_access); } -/** - * create_mxac_buf() - create query maximal access context - * @cc: buffer to create query disk on id context response - */ void create_disk_id_rsp_buf(char *cc, __u64 file_id, __u64 vol_id) { struct create_disk_id_rsp *buf; @@ -1560,8 +1547,9 @@ void create_disk_id_rsp_buf(char *cc, __u64 file_id, __u64 vol_id) } /** - * create_posix_buf() - create posix extension context + * create_posix_rsp_buf() - create posix extension context * @cc: buffer to create posix on posix response + * @fp: ksmbd file pointer */ void create_posix_rsp_buf(char *cc, struct ksmbd_file *fp) { diff --git a/fs/cifsd/server.c b/fs/cifsd/server.c index 3670dcc9ba03..85862c3ea7c0 100644 --- a/fs/cifsd/server.c +++ b/fs/cifsd/server.c @@ -86,7 +86,7 @@ char *ksmbd_work_group(void) /** * check_conn_state() - check state of server thread connection - * @ksmbd_work: smb work containing server thread information + * @work: smb work containing server thread information * * Return: 0 on valid connection, otherwise 1 to reconnect */ @@ -248,7 +248,7 @@ send: /** * handle_ksmbd_work() - process pending smb work requests - * @ksmbd_work: smb work containing request command buffer + * @wk: smb work containing request command buffer * * called by kworker threads to processing remaining smb work requests */ @@ -604,7 +604,7 @@ error: } /** - * exit_smb_server() - shutdown forker thread and free memory at module exit + * ksmbd_server_exit() - shutdown forker thread and free memory at module exit */ static void __exit ksmbd_server_exit(void) { diff --git a/fs/cifsd/smb2pdu.c b/fs/cifsd/smb2pdu.c index 730bddbc8152..e4b91838d35c 100644 --- a/fs/cifsd/smb2pdu.c +++ b/fs/cifsd/smb2pdu.c @@ -88,8 +88,7 @@ struct channel *lookup_chann_list(struct ksmbd_session *sess) /** * smb2_get_ksmbd_tcon() - get tree connection information for a tree id - * @sess: session containing tree list - * @tid: match tree connection with tree id + * @work: smb work * * Return: matching tree connection on success, otherwise error */ @@ -209,6 +208,7 @@ uint16_t get_smb2_cmd_val(struct ksmbd_work *work) /** * set_smb2_rsp_status() - set error response code on smb2 header * @work: smb work containing response buffer + * @err: error response code */ void set_smb2_rsp_status(struct ksmbd_work *work, __le32 err) { @@ -633,9 +633,10 @@ static void destroy_previous_session(struct ksmbd_user *user, uint64_t id) /** * smb2_get_name() - get filename string from on the wire smb format + * @share: ksmbd_share_config pointer * @src: source buffer * @maxlen: maxlen of source string - * @work: smb work containing smb request buffer + * @nls_table: nls_table pointer * * Return: matching converted filename on success, otherwise error ptr */ @@ -747,6 +748,7 @@ static __le32 smb2_get_reparse_tag_special_file(umode_t mode) /** * smb2_get_dos_mode() - get file mode in dos format from unix mode * @stat: kstat containing file mode + * @attribute: attribute flags * * Return: converted dos mode */ @@ -1797,7 +1799,6 @@ out_err1: * @file_present: is file already present * @access: file access flags * @disposition: file disposition flags - * @work: smb work containing smb request buffer * * Return: file open flags */ @@ -4112,12 +4113,6 @@ static void get_internal_info_pipe(struct smb2_query_info_rsp *rsp, inc_rfc1001_len(rsp, sizeof(struct smb2_file_internal_info)); } -/** - * smb2_info_file_pipe() - handler for smb2 query info on IPC pipe - * @work: smb work containing query info command buffer - * - * Return: 0 on success, otherwise error - */ static int smb2_get_info_file_pipe(struct ksmbd_session *sess, struct smb2_query_info_req *req, struct smb2_query_info_rsp *rsp) { @@ -4157,10 +4152,10 @@ static int smb2_get_info_file_pipe(struct ksmbd_session *sess, /** * smb2_get_ea() - handler for smb2 get extended attribute command * @work: smb work containing query info command buffer - * @path: path of file/dir to query info command - * @rq: get extended attribute request - * @resp: response buffer pointer - * @resp_org: base response buffer pointer in case of chained response + * @fp: ksmbd_file pointer + * @req: get extended attribute request + * @rsp: response buffer pointer + * @rsp_org: base response buffer pointer in case of chained response * * Return: 0 on success, otherwise error */ @@ -4761,12 +4756,6 @@ static int find_file_posix_info(struct smb2_query_info_rsp *rsp, return 0; } -/** - * smb2_get_info_file() - handler for smb2 query info command - * @work: smb work containing query info request buffer - * - * Return: 0 on success, otherwise error - */ static int smb2_get_info_file(struct ksmbd_work *work, struct smb2_query_info_req *req, struct smb2_query_info_rsp *rsp, @@ -4901,13 +4890,6 @@ static int smb2_get_info_file(struct ksmbd_work *work, return rc; } -/** - * smb2_get_info_filesystem() - handler for smb2 query info command - * @work: smb work containing query info request buffer - * - * Return: 0 on success, otherwise error - * TODO: need to implement STATUS_INFO_LENGTH_MISMATCH error handling - */ static int smb2_get_info_filesystem(struct ksmbd_work *work, struct smb2_query_info_req *req, struct smb2_query_info_rsp *rsp, @@ -5416,14 +5398,6 @@ int smb2_echo(struct ksmbd_work *work) return 0; } -/** - * smb2_rename() - handler for rename using smb2 setinfo command - * @work: smb work containing set info command buffer - * @filp: file pointer of source file - * @old_fid: file id of source file - * - * Return: 0 on success, otherwise error - */ static int smb2_rename(struct ksmbd_work *work, struct ksmbd_file *fp, struct smb2_file_rename_info *file_info, struct nls_table *local_nls) @@ -5544,14 +5518,6 @@ out: return rc; } -/** - * smb2_create_link() - handler for creating hardlink using smb2 - * set info command - * @work: smb work containing set info command buffer - * @filp: file pointer of source file - * - * Return: 0 on success, otherwise error - */ static int smb2_create_link(struct ksmbd_work *work, struct ksmbd_share_config *share, struct smb2_file_link_info *file_info, @@ -5914,6 +5880,9 @@ static int set_file_mode_info(struct ksmbd_file *fp, /** * smb2_set_info_file() - handler for smb2 set info command * @work: smb work containing set info command buffer + * @fp: ksmbd_file pointer + * @info_class: smb2 set info class + * @share: ksmbd_share_config pointer * * Return: 0 on success, otherwise error * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH @@ -8057,7 +8026,7 @@ int smb2_oplock_break(struct ksmbd_work *work) /** * smb2_notify() - handler for smb2 notify request - * @ksmbd_work: smb work containing notify command buffer + * @work: smb work containing notify command buffer * * Return: 0 */ @@ -8081,7 +8050,8 @@ int smb2_notify(struct ksmbd_work *work) /** * smb2_is_sign_req() - handler for checking packet signing status - * @work:smb work containing notify command buffer + * @work: smb work containing notify command buffer + * @command: SMB2 command id * * Return: true if packed is signed, false otherwise */ diff --git a/fs/cifsd/smb_common.c b/fs/cifsd/smb_common.c index 7eb6d98656c7..f779aae3fd6c 100644 --- a/fs/cifsd/smb_common.c +++ b/fs/cifsd/smb_common.c @@ -107,8 +107,8 @@ int ksmbd_lookup_protocol_idx(char *str) } /** - * check_message() - check for valid smb2 request header - * @buf: smb2 header to be checked + * ksmbd_verify_smb_message() - check for valid smb2 request header + * @work: smb work * * check for valid smb signature and packet direction(request/response) * @@ -125,9 +125,8 @@ int ksmbd_verify_smb_message(struct ksmbd_work *work) } /** - * is_smb_request() - check for valid smb request type + * ksmbd_smb_request() - check for valid smb request type * @conn: connection instance - * @type: smb request type * * Return: true on success, otherwise false */ diff --git a/fs/cifsd/transport_tcp.c b/fs/cifsd/transport_tcp.c index 60ec9b2e0370..359401227d93 100644 --- a/fs/cifsd/transport_tcp.c +++ b/fs/cifsd/transport_tcp.c @@ -173,7 +173,7 @@ static unsigned short ksmbd_tcp_get_port(const struct sockaddr *sa) /** * ksmbd_tcp_new_connection() - create a new tcp session on mount - * @sock: socket associated with new connection + * @client_sk: socket associated with new connection * * whenever a new connection is requested, create a conn thread * (session thread) to handle new incoming smb requests from the connection @@ -252,7 +252,8 @@ static int ksmbd_kthread_fn(void *p) } /** - * ksmbd_create_ksmbd_kthread() - start forker thread + * ksmbd_tcp_run_kthread() - start forker thread + * @iface: pointer to struct interface * * start forker thread(ksmbd/0) at module init time to listen * on port 445 for new SMB connection requests. It creates per connection