Lines Matching full:mid

36 cifs_wake_up_task(struct mid_q_entry *mid)  in cifs_wake_up_task()  argument
38 if (mid->mid_state == MID_RESPONSE_RECEIVED) in cifs_wake_up_task()
39 mid->mid_state = MID_RESPONSE_READY; in cifs_wake_up_task()
40 wake_up_process(mid->callback_data); in cifs_wake_up_task()
56 temp->mid = get_mid(smb_buffer); in alloc_mid()
61 /* when mid allocated can be before when sent */ in alloc_mid()
66 * The default is for the mid to be synchronous, so the in alloc_mid()
106 cifs_server_dbg(VFS, "Invalid mid allocation time\n"); in __release_mid()
142 trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid, in __release_mid()
145 pr_debug("slow rsp: cmd %d mid %llu", in __release_mid()
146 midEntry->command, midEntry->mid); in __release_mid()
160 delete_mid(struct mid_q_entry *mid) in delete_mid() argument
162 spin_lock(&mid->server->mid_lock); in delete_mid()
163 if (!(mid->mid_flags & MID_DELETED)) { in delete_mid()
164 list_del_init(&mid->qhead); in delete_mid()
165 mid->mid_flags |= MID_DELETED; in delete_mid()
167 spin_unlock(&mid->server->mid_lock); in delete_mid()
169 release_mid(mid); in delete_mid()
374 * mid entry to be kept in the pending requests queue thus allowing in __smb_send_rqst()
665 * processes a missing mid) and we exhausted most available in wait_for_compound_request()
755 struct mid_q_entry *mid; in cifs_setup_async_request() local
765 mid = alloc_mid(hdr, server); in cifs_setup_async_request()
766 if (mid == NULL) in cifs_setup_async_request()
769 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
771 release_mid(mid); in cifs_setup_async_request()
775 return mid; in cifs_setup_async_request()
779 * Send a SMB request and set the callback function in the mid to handle
789 struct mid_q_entry *mid; in cifs_call_async() local
818 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
819 if (IS_ERR(mid)) { in cifs_call_async()
822 return PTR_ERR(mid); in cifs_call_async()
825 mid->receive = receive; in cifs_call_async()
826 mid->callback = callback; in cifs_call_async()
827 mid->callback_data = cbdata; in cifs_call_async()
828 mid->handle = handle; in cifs_call_async()
829 mid->mid_state = MID_REQUEST_SUBMITTED; in cifs_call_async()
833 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
837 * Need to store the time in mid before calling I/O. For call_async, in cifs_call_async()
838 * I/O response may come back and free the mid entry on another thread. in cifs_call_async()
840 cifs_save_when_sent(mid); in cifs_call_async()
844 revert_current_mid(server, mid->credits); in cifs_call_async()
846 delete_mid(mid); in cifs_call_async()
886 cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) in cifs_sync_mid_result() argument
890 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n", in cifs_sync_mid_result()
891 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state); in cifs_sync_mid_result()
894 switch (mid->mid_state) { in cifs_sync_mid_result()
908 if (!(mid->mid_flags & MID_DELETED)) { in cifs_sync_mid_result()
909 list_del_init(&mid->qhead); in cifs_sync_mid_result()
910 mid->mid_flags |= MID_DELETED; in cifs_sync_mid_result()
912 cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n", in cifs_sync_mid_result()
913 __func__, mid->mid, mid->mid_state); in cifs_sync_mid_result()
918 release_mid(mid); in cifs_sync_mid_result()
924 struct mid_q_entry *mid) in send_cancel() argument
927 server->ops->send_cancel(server, rqst, mid) : 0; in send_cancel()
931 cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, in cifs_check_receive() argument
934 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4; in cifs_check_receive()
936 dump_smb(mid->resp_buf, min_t(u32, 92, len)); in cifs_check_receive()
945 iov[0].iov_base = mid->resp_buf; in cifs_check_receive()
947 iov[1].iov_base = (char *)mid->resp_buf + 4; in cifs_check_receive()
951 mid->sequence_number); in cifs_check_receive()
958 return map_and_check_smb_error(mid, log_error); in cifs_check_receive()
967 struct mid_q_entry *mid; in cifs_setup_request() local
973 rc = allocate_mid(ses, hdr, &mid); in cifs_setup_request()
976 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
978 delete_mid(mid); in cifs_setup_request()
981 return mid; in cifs_setup_request()
985 cifs_compound_callback(struct mid_q_entry *mid) in cifs_compound_callback() argument
987 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback()
990 credits.value = server->ops->get_credits(mid); in cifs_compound_callback()
993 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
995 if (mid->mid_state == MID_RESPONSE_RECEIVED) in cifs_compound_callback()
996 mid->mid_state = MID_RESPONSE_READY; in cifs_compound_callback()
1000 cifs_compound_last_callback(struct mid_q_entry *mid) in cifs_compound_last_callback() argument
1002 cifs_compound_callback(mid); in cifs_compound_last_callback()
1003 cifs_wake_up_task(mid); in cifs_compound_last_callback()
1007 cifs_cancelled_callback(struct mid_q_entry *mid) in cifs_cancelled_callback() argument
1009 cifs_compound_callback(mid); in cifs_cancelled_callback()
1010 release_mid(mid); in cifs_cancelled_callback()
1189 * we will collect credits granted by the server in the mid callbacks in compound_send_recv()
1215 cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n", in compound_send_recv()
1216 midQ[i]->mid, le16_to_cpu(midQ[i]->command)); in compound_send_recv()
1236 /* mark this mid as cancelled to not free it below */ in compound_send_recv()
1244 cifs_dbg(FYI, "Bad MID state?\n"); in compound_send_recv()
1449 cifs_server_dbg(VFS, "Bad MID state?\n"); in SendReceive()
1482 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1634 cifs_tcon_dbg(VFS, "Bad MID state?\n"); in SendReceiveBlockingLock()
1675 __cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid, in __cifs_readv_discard() argument
1681 dequeue_mid(mid, malformed); in __cifs_readv_discard()
1682 mid->resp_buf = server->smallbuf; in __cifs_readv_discard()
1688 cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_discard() argument
1690 struct cifs_readdata *rdata = mid->callback_data; in cifs_readv_discard()
1692 return __cifs_readv_discard(server, mid, rdata->result); in cifs_readv_discard()
1696 cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_receive() argument
1700 struct cifs_readdata *rdata = mid->callback_data; in cifs_readv_receive()
1705 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%u\n", in cifs_readv_receive()
1706 __func__, mid->mid, rdata->offset, rdata->bytes); in cifs_readv_receive()
1711 * the Mid. in cifs_readv_receive()
1751 return __cifs_readv_discard(server, mid, false); in cifs_readv_receive()
1760 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1779 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1803 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1822 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1824 dequeue_mid(mid, false); in cifs_readv_receive()
1825 mid->resp_buf = server->smallbuf; in cifs_readv_receive()