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()
669 * processes a missing mid) and we exhausted most available in wait_for_compound_request()
759 struct mid_q_entry *mid; in cifs_setup_async_request() local
769 mid = alloc_mid(hdr, server); in cifs_setup_async_request()
770 if (mid == NULL) in cifs_setup_async_request()
773 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
775 release_mid(mid); in cifs_setup_async_request()
779 return mid; in cifs_setup_async_request()
783 * Send a SMB request and set the callback function in the mid to handle
793 struct mid_q_entry *mid; in cifs_call_async() local
822 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
823 if (IS_ERR(mid)) { in cifs_call_async()
826 return PTR_ERR(mid); in cifs_call_async()
829 mid->receive = receive; in cifs_call_async()
830 mid->callback = callback; in cifs_call_async()
831 mid->callback_data = cbdata; in cifs_call_async()
832 mid->handle = handle; in cifs_call_async()
833 mid->mid_state = MID_REQUEST_SUBMITTED; in cifs_call_async()
837 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
841 * Need to store the time in mid before calling I/O. For call_async, in cifs_call_async()
842 * I/O response may come back and free the mid entry on another thread. in cifs_call_async()
844 cifs_save_when_sent(mid); in cifs_call_async()
848 revert_current_mid(server, mid->credits); in cifs_call_async()
850 delete_mid(mid); in cifs_call_async()
890 cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) in cifs_sync_mid_result() argument
894 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n", in cifs_sync_mid_result()
895 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state); in cifs_sync_mid_result()
898 switch (mid->mid_state) { in cifs_sync_mid_result()
912 if (!(mid->mid_flags & MID_DELETED)) { in cifs_sync_mid_result()
913 list_del_init(&mid->qhead); in cifs_sync_mid_result()
914 mid->mid_flags |= MID_DELETED; in cifs_sync_mid_result()
917 cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n", in cifs_sync_mid_result()
918 __func__, mid->mid, mid->mid_state); in cifs_sync_mid_result()
925 release_mid(mid); in cifs_sync_mid_result()
931 struct mid_q_entry *mid) in send_cancel() argument
934 server->ops->send_cancel(server, rqst, mid) : 0; in send_cancel()
938 cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, in cifs_check_receive() argument
941 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4; in cifs_check_receive()
943 dump_smb(mid->resp_buf, min_t(u32, 92, len)); in cifs_check_receive()
952 iov[0].iov_base = mid->resp_buf; in cifs_check_receive()
954 iov[1].iov_base = (char *)mid->resp_buf + 4; in cifs_check_receive()
958 mid->sequence_number); in cifs_check_receive()
965 return map_and_check_smb_error(mid, log_error); in cifs_check_receive()
974 struct mid_q_entry *mid; in cifs_setup_request() local
980 rc = allocate_mid(ses, hdr, &mid); in cifs_setup_request()
983 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
985 delete_mid(mid); in cifs_setup_request()
988 return mid; in cifs_setup_request()
992 cifs_compound_callback(struct mid_q_entry *mid) in cifs_compound_callback() argument
994 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback()
996 .value = server->ops->get_credits(mid), in cifs_compound_callback()
1000 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
1002 if (mid->mid_state == MID_RESPONSE_RECEIVED) in cifs_compound_callback()
1003 mid->mid_state = MID_RESPONSE_READY; in cifs_compound_callback()
1007 cifs_compound_last_callback(struct mid_q_entry *mid) in cifs_compound_last_callback() argument
1009 cifs_compound_callback(mid); in cifs_compound_last_callback()
1010 cifs_wake_up_task(mid); in cifs_compound_last_callback()
1014 cifs_cancelled_callback(struct mid_q_entry *mid) in cifs_cancelled_callback() argument
1016 cifs_compound_callback(mid); in cifs_cancelled_callback()
1017 release_mid(mid); in cifs_cancelled_callback()
1198 * we will collect credits granted by the server in the mid callbacks in compound_send_recv()
1224 cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n", in compound_send_recv()
1225 midQ[i]->mid, le16_to_cpu(midQ[i]->command)); in compound_send_recv()
1245 /* mark this mid as cancelled to not free it below */ in compound_send_recv()
1253 cifs_dbg(FYI, "Bad MID state?\n"); in compound_send_recv()
1458 cifs_server_dbg(VFS, "Bad MID state?\n"); in SendReceive()
1491 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1643 cifs_tcon_dbg(VFS, "Bad MID state?\n"); in SendReceiveBlockingLock()
1684 __cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid, in __cifs_readv_discard() argument
1690 dequeue_mid(mid, malformed); in __cifs_readv_discard()
1691 mid->resp_buf = server->smallbuf; in __cifs_readv_discard()
1697 cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_discard() argument
1699 struct cifs_io_subrequest *rdata = mid->callback_data; in cifs_readv_discard()
1701 return __cifs_readv_discard(server, mid, rdata->result); in cifs_readv_discard()
1705 cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_receive() argument
1709 struct cifs_io_subrequest *rdata = mid->callback_data; in cifs_readv_receive()
1714 cifs_dbg(FYI, "%s: mid=%llu offset=%llu bytes=%zu\n", in cifs_readv_receive()
1715 __func__, mid->mid, rdata->subreq.start, rdata->subreq.len); in cifs_readv_receive()
1720 * the Mid. in cifs_readv_receive()
1760 return __cifs_readv_discard(server, mid, false); in cifs_readv_receive()
1769 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1788 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1812 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1831 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1833 dequeue_mid(mid, false); in cifs_readv_receive()
1834 mid->resp_buf = server->smallbuf; in cifs_readv_receive()