Lines Matching defs:mid

48 cifs_wake_up_task(struct mid_q_entry *mid)
50 wake_up_process(mid->callback_data);
66 temp->mid = get_mid(smb_buffer);
71 /* when mid allocated can be before when sent */
76 * The default is for the mid to be synchronous, so the
115 cifs_server_dbg(VFS, "Invalid mid allocation time\n");
151 trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid,
154 pr_debug("slow rsp: cmd %d mid %llu",
155 midEntry->command, midEntry->mid);
181 cifs_delete_mid(struct mid_q_entry *mid)
184 if (!(mid->mid_flags & MID_DELETED)) {
185 list_del_init(&mid->qhead);
186 mid->mid_flags |= MID_DELETED;
190 DeleteMidQEntry(mid);
422 * mid entry to be kept in the pending requests queue thus allowing
662 * processes a missing mid) and we exhausted most available
748 struct mid_q_entry *mid;
758 mid = AllocMidQEntry(hdr, server);
759 if (mid == NULL)
762 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number);
764 DeleteMidQEntry(mid);
768 return mid;
772 * Send a SMB request and set the callback function in the mid to handle
782 struct mid_q_entry *mid;
811 mid = server->ops->setup_async_request(server, rqst);
812 if (IS_ERR(mid)) {
815 return PTR_ERR(mid);
818 mid->receive = receive;
819 mid->callback = callback;
820 mid->callback_data = cbdata;
821 mid->handle = handle;
822 mid->mid_state = MID_REQUEST_SUBMITTED;
826 list_add_tail(&mid->qhead, &server->pending_mid_q);
830 * Need to store the time in mid before calling I/O. For call_async,
831 * I/O response may come back and free the mid entry on another thread.
833 cifs_save_when_sent(mid);
837 revert_current_mid(server, mid->credits);
839 cifs_delete_mid(mid);
879 cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
883 cifs_dbg(FYI, "%s: cmd=%d mid=%llu state=%d\n",
884 __func__, le16_to_cpu(mid->command), mid->mid, mid->mid_state);
887 switch (mid->mid_state) {
901 if (!(mid->mid_flags & MID_DELETED)) {
902 list_del_init(&mid->qhead);
903 mid->mid_flags |= MID_DELETED;
905 cifs_server_dbg(VFS, "%s: invalid mid state mid=%llu state=%d\n",
906 __func__, mid->mid, mid->mid_state);
911 DeleteMidQEntry(mid);
917 struct mid_q_entry *mid)
920 server->ops->send_cancel(server, rqst, mid) : 0;
924 cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
927 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4;
929 dump_smb(mid->resp_buf, min_t(u32, 92, len));
938 iov[0].iov_base = mid->resp_buf;
940 iov[1].iov_base = (char *)mid->resp_buf + 4;
944 mid->sequence_number);
951 return map_and_check_smb_error(mid, log_error);
960 struct mid_q_entry *mid;
966 rc = allocate_mid(ses, hdr, &mid);
969 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number);
971 cifs_delete_mid(mid);
974 return mid;
978 cifs_compound_callback(struct mid_q_entry *mid)
980 struct TCP_Server_Info *server = mid->server;
983 credits.value = server->ops->get_credits(mid);
986 add_credits(server, &credits, mid->optype);
990 cifs_compound_last_callback(struct mid_q_entry *mid)
992 cifs_compound_callback(mid);
993 cifs_wake_up_task(mid);
997 cifs_cancelled_callback(struct mid_q_entry *mid)
999 cifs_compound_callback(mid);
1000 DeleteMidQEntry(mid);
1149 * we will collect credits granted by the server in the mid callbacks
1170 cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n",
1171 midQ[i]->mid, le16_to_cpu(midQ[i]->command));
1190 /* mark this mid as cancelled to not free it below */