Lines Matching full:mid
37 cifs_wake_up_task(struct mid_q_entry *mid) in cifs_wake_up_task() argument
39 if (mid->mid_state == MID_RESPONSE_RECEIVED) in cifs_wake_up_task()
40 mid->mid_state = MID_RESPONSE_READY; in cifs_wake_up_task()
41 wake_up_process(mid->callback_data); in cifs_wake_up_task()
57 temp->mid = get_mid(smb_buffer); in alloc_mid()
62 /* when mid allocated can be before when sent */ in alloc_mid()
67 * The default is for the mid to be synchronous, so the in alloc_mid()
107 cifs_server_dbg(VFS, "Invalid mid allocation time\n"); in __release_mid()
143 trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid, in __release_mid()
146 pr_debug("slow rsp: cmd %d mid %llu", in __release_mid()
147 midEntry->command, midEntry->mid); in __release_mid()
161 delete_mid(struct mid_q_entry *mid) in delete_mid() argument
163 spin_lock(&mid->server->mid_lock); in delete_mid()
164 if (!(mid->mid_flags & MID_DELETED)) { in delete_mid()
165 list_del_init(&mid->qhead); in delete_mid()
166 mid->mid_flags |= MID_DELETED; in delete_mid()
168 spin_unlock(&mid->server->mid_lock); in delete_mid()
170 release_mid(mid); in delete_mid()
375 * mid entry to be kept in the pending requests queue thus allowing in __smb_send_rqst()
655 * processes a missing mid) and we exhausted most available in wait_for_compound_request()
745 struct mid_q_entry *mid; in cifs_setup_async_request() local
755 mid = alloc_mid(hdr, server); in cifs_setup_async_request()
756 if (mid == NULL) in cifs_setup_async_request()
759 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
761 release_mid(mid); in cifs_setup_async_request()
765 return mid; in cifs_setup_async_request()
769 * Send a SMB request and set the callback function in the mid to handle
779 struct mid_q_entry *mid; in cifs_call_async() local
808 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
809 if (IS_ERR(mid)) { in cifs_call_async()
812 return PTR_ERR(mid); in cifs_call_async()
815 mid->receive = receive; in cifs_call_async()
816 mid->callback = callback; in cifs_call_async()
817 mid->callback_data = cbdata; in cifs_call_async()
818 mid->handle = handle; in cifs_call_async()
819 mid->mid_state = MID_REQUEST_SUBMITTED; in cifs_call_async()
823 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
827 * Need to store the time in mid before calling I/O. For call_async, in cifs_call_async()
828 * I/O response may come back and free the mid entry on another thread. in cifs_call_async()
830 cifs_save_when_sent(mid); in cifs_call_async()
834 revert_current_mid(server, mid->credits); in cifs_call_async()
836 delete_mid(mid); in cifs_call_async()
876 cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) in cifs_sync_mid_result() argument
880 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n", in cifs_sync_mid_result()
881 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state); in cifs_sync_mid_result()
884 switch (mid->mid_state) { in cifs_sync_mid_result()
898 if (!(mid->mid_flags & MID_DELETED)) { in cifs_sync_mid_result()
899 list_del_init(&mid->qhead); in cifs_sync_mid_result()
900 mid->mid_flags |= MID_DELETED; in cifs_sync_mid_result()
903 cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n", in cifs_sync_mid_result()
904 __func__, mid->mid, mid->mid_state); in cifs_sync_mid_result()
911 release_mid(mid); in cifs_sync_mid_result()
917 struct mid_q_entry *mid) in send_cancel() argument
920 server->ops->send_cancel(server, rqst, mid) : 0; in send_cancel()
924 cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, in cifs_check_receive() argument
927 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4; in cifs_check_receive()
929 dump_smb(mid->resp_buf, min_t(u32, 92, len)); in cifs_check_receive()
938 iov[0].iov_base = mid->resp_buf; in cifs_check_receive()
940 iov[1].iov_base = (char *)mid->resp_buf + 4; in cifs_check_receive()
944 mid->sequence_number); in cifs_check_receive()
951 return map_and_check_smb_error(mid, log_error); in cifs_check_receive()
960 struct mid_q_entry *mid; in cifs_setup_request() local
966 rc = allocate_mid(ses, hdr, &mid); in cifs_setup_request()
969 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
971 delete_mid(mid); in cifs_setup_request()
974 return mid; in cifs_setup_request()
978 cifs_compound_callback(struct mid_q_entry *mid) in cifs_compound_callback() argument
980 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback()
982 .value = server->ops->get_credits(mid), in cifs_compound_callback()
986 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
988 if (mid->mid_state == MID_RESPONSE_RECEIVED) in cifs_compound_callback()
989 mid->mid_state = MID_RESPONSE_READY; in cifs_compound_callback()
993 cifs_compound_last_callback(struct mid_q_entry *mid) in cifs_compound_last_callback() argument
995 cifs_compound_callback(mid); in cifs_compound_last_callback()
996 cifs_wake_up_task(mid); in cifs_compound_last_callback()
1000 cifs_cancelled_callback(struct mid_q_entry *mid) in cifs_cancelled_callback() argument
1002 cifs_compound_callback(mid); in cifs_cancelled_callback()
1003 release_mid(mid); in cifs_cancelled_callback()
1184 * we will collect credits granted by the server in the mid callbacks in compound_send_recv()
1210 cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n", in compound_send_recv()
1211 midQ[i]->mid, le16_to_cpu(midQ[i]->command)); in compound_send_recv()
1231 /* mark this mid as cancelled to not free it below */ in compound_send_recv()
1239 cifs_dbg(FYI, "Bad MID state?\n"); in compound_send_recv()
1444 cifs_server_dbg(VFS, "Bad MID state?\n"); in SendReceive()
1477 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1629 cifs_tcon_dbg(VFS, "Bad MID state?\n"); in SendReceiveBlockingLock()
1670 __cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid, in __cifs_readv_discard() argument
1676 dequeue_mid(mid, malformed); in __cifs_readv_discard()
1677 mid->resp_buf = server->smallbuf; in __cifs_readv_discard()
1683 cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_discard() argument
1685 struct cifs_io_subrequest *rdata = mid->callback_data; in cifs_readv_discard()
1687 return __cifs_readv_discard(server, mid, rdata->result); in cifs_readv_discard()
1691 cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_receive() argument
1695 struct cifs_io_subrequest *rdata = mid->callback_data; in cifs_readv_receive()
1700 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%zu\n", in cifs_readv_receive()
1701 __func__, mid->mid, rdata->subreq.start, rdata->subreq.len); in cifs_readv_receive()
1706 * the Mid. in cifs_readv_receive()
1746 return __cifs_readv_discard(server, mid, false); in cifs_readv_receive()
1755 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1774 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1798 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1817 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1819 dequeue_mid(mid, false); in cifs_readv_receive()
1820 mid->resp_buf = server->smallbuf; in cifs_readv_receive()