Lines Matching full:mid
36 cifs_wake_up_task(struct mid_q_entry *mid) in cifs_wake_up_task() argument
38 wake_up_process(mid->callback_data); in cifs_wake_up_task()
54 temp->mid = get_mid(smb_buffer); in alloc_mid()
59 /* when mid allocated can be before when sent */ in alloc_mid()
64 * The default is for the mid to be synchronous, so the in alloc_mid()
103 cifs_server_dbg(VFS, "Invalid mid allocation time\n"); in __release_mid()
139 trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid, in __release_mid()
142 pr_debug("slow rsp: cmd %d mid %llu", in __release_mid()
143 midEntry->command, midEntry->mid); in __release_mid()
156 void release_mid(struct mid_q_entry *mid) in release_mid() argument
158 struct TCP_Server_Info *server = mid->server; in release_mid()
161 kref_put(&mid->refcount, __release_mid); in release_mid()
166 delete_mid(struct mid_q_entry *mid) in delete_mid() argument
168 spin_lock(&mid->server->mid_lock); in delete_mid()
169 if (!(mid->mid_flags & MID_DELETED)) { in delete_mid()
170 list_del_init(&mid->qhead); in delete_mid()
171 mid->mid_flags |= MID_DELETED; in delete_mid()
173 spin_unlock(&mid->server->mid_lock); in delete_mid()
175 release_mid(mid); in delete_mid()
403 * mid entry to be kept in the pending requests queue thus allowing in __smb_send_rqst()
681 * processes a missing mid) and we exhausted most available in wait_for_compound_request()
770 struct mid_q_entry *mid; in cifs_setup_async_request() local
780 mid = alloc_mid(hdr, server); in cifs_setup_async_request()
781 if (mid == NULL) in cifs_setup_async_request()
784 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
786 release_mid(mid); in cifs_setup_async_request()
790 return mid; in cifs_setup_async_request()
794 * Send a SMB request and set the callback function in the mid to handle
804 struct mid_q_entry *mid; in cifs_call_async() local
833 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
834 if (IS_ERR(mid)) { in cifs_call_async()
837 return PTR_ERR(mid); in cifs_call_async()
840 mid->receive = receive; in cifs_call_async()
841 mid->callback = callback; in cifs_call_async()
842 mid->callback_data = cbdata; in cifs_call_async()
843 mid->handle = handle; in cifs_call_async()
844 mid->mid_state = MID_REQUEST_SUBMITTED; in cifs_call_async()
848 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
852 * Need to store the time in mid before calling I/O. For call_async, in cifs_call_async()
853 * I/O response may come back and free the mid entry on another thread. in cifs_call_async()
855 cifs_save_when_sent(mid); in cifs_call_async()
861 revert_current_mid(server, mid->credits); in cifs_call_async()
863 delete_mid(mid); in cifs_call_async()
903 cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) in cifs_sync_mid_result() argument
907 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n", in cifs_sync_mid_result()
908 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state); in cifs_sync_mid_result()
911 switch (mid->mid_state) { in cifs_sync_mid_result()
925 if (!(mid->mid_flags & MID_DELETED)) { in cifs_sync_mid_result()
926 list_del_init(&mid->qhead); in cifs_sync_mid_result()
927 mid->mid_flags |= MID_DELETED; in cifs_sync_mid_result()
929 cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n", in cifs_sync_mid_result()
930 __func__, mid->mid, mid->mid_state); in cifs_sync_mid_result()
935 release_mid(mid); in cifs_sync_mid_result()
941 struct mid_q_entry *mid) in send_cancel() argument
944 server->ops->send_cancel(server, rqst, mid) : 0; in send_cancel()
948 cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, in cifs_check_receive() argument
951 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4; in cifs_check_receive()
953 dump_smb(mid->resp_buf, min_t(u32, 92, len)); in cifs_check_receive()
962 iov[0].iov_base = mid->resp_buf; in cifs_check_receive()
964 iov[1].iov_base = (char *)mid->resp_buf + 4; in cifs_check_receive()
968 mid->sequence_number); in cifs_check_receive()
975 return map_and_check_smb_error(mid, log_error); in cifs_check_receive()
984 struct mid_q_entry *mid; in cifs_setup_request() local
990 rc = allocate_mid(ses, hdr, &mid); in cifs_setup_request()
993 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
995 delete_mid(mid); in cifs_setup_request()
998 return mid; in cifs_setup_request()
1002 cifs_compound_callback(struct mid_q_entry *mid) in cifs_compound_callback() argument
1004 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback()
1007 credits.value = server->ops->get_credits(mid); in cifs_compound_callback()
1010 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
1014 cifs_compound_last_callback(struct mid_q_entry *mid) in cifs_compound_last_callback() argument
1016 cifs_compound_callback(mid); in cifs_compound_last_callback()
1017 cifs_wake_up_task(mid); in cifs_compound_last_callback()
1021 cifs_cancelled_callback(struct mid_q_entry *mid) in cifs_cancelled_callback() argument
1023 cifs_compound_callback(mid); in cifs_cancelled_callback()
1024 release_mid(mid); in cifs_cancelled_callback()
1177 * we will collect credits granted by the server in the mid callbacks in compound_send_recv()
1203 cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n", in compound_send_recv()
1204 midQ[i]->mid, le16_to_cpu(midQ[i]->command)); in compound_send_recv()
1223 /* mark this mid as cancelled to not free it below */ in compound_send_recv()
1231 cifs_dbg(FYI, "Bad MID state?\n"); in compound_send_recv()
1437 cifs_server_dbg(VFS, "Bad MID state?\n"); in SendReceive()
1470 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1621 cifs_tcon_dbg(VFS, "Bad MID state?\n"); in SendReceiveBlockingLock()
1662 __cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid, in __cifs_readv_discard() argument
1668 dequeue_mid(mid, malformed); in __cifs_readv_discard()
1669 mid->resp_buf = server->smallbuf; in __cifs_readv_discard()
1675 cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_discard() argument
1677 struct cifs_readdata *rdata = mid->callback_data; in cifs_readv_discard()
1679 return __cifs_readv_discard(server, mid, rdata->result); in cifs_readv_discard()
1683 cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_receive() argument
1687 struct cifs_readdata *rdata = mid->callback_data; in cifs_readv_receive()
1692 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%u\n", in cifs_readv_receive()
1693 __func__, mid->mid, rdata->offset, rdata->bytes); in cifs_readv_receive()
1698 * the Mid. in cifs_readv_receive()
1738 return __cifs_readv_discard(server, mid, false); in cifs_readv_receive()
1747 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1766 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1790 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1804 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1806 dequeue_mid(mid, false); in cifs_readv_receive()
1807 mid->resp_buf = server->smallbuf; in cifs_readv_receive()