Lines Matching +full:tcon +full:- +full:channel
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50 wake_up_process(mid->callback_data); in cifs_wake_up_task()
65 kref_init(&temp->refcount); in AllocMidQEntry()
66 temp->mid = get_mid(smb_buffer); in AllocMidQEntry()
67 temp->pid = current->pid; in AllocMidQEntry()
68 temp->command = cpu_to_le16(smb_buffer->Command); in AllocMidQEntry()
69 cifs_dbg(FYI, "For smb_command %d\n", smb_buffer->Command); in AllocMidQEntry()
70 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ in AllocMidQEntry()
72 temp->when_alloc = jiffies; in AllocMidQEntry()
73 temp->server = server; in AllocMidQEntry()
80 temp->creator = current; in AllocMidQEntry()
81 temp->callback = cifs_wake_up_task; in AllocMidQEntry()
82 temp->callback_data = current; in AllocMidQEntry()
85 temp->mid_state = MID_REQUEST_ALLOCATED; in AllocMidQEntry()
94 __le16 command = midEntry->server->vals->lock_cmd; in _cifs_mid_q_entry_release()
95 __u16 smb_cmd = le16_to_cpu(midEntry->command); in _cifs_mid_q_entry_release()
99 struct TCP_Server_Info *server = midEntry->server; in _cifs_mid_q_entry_release()
101 if (midEntry->resp_buf && (midEntry->mid_flags & MID_WAIT_CANCELLED) && in _cifs_mid_q_entry_release()
102 midEntry->mid_state == MID_RESPONSE_RECEIVED && in _cifs_mid_q_entry_release()
103 server->ops->handle_cancelled_mid) in _cifs_mid_q_entry_release()
104 server->ops->handle_cancelled_mid(midEntry, server); in _cifs_mid_q_entry_release()
106 midEntry->mid_state = MID_FREE; in _cifs_mid_q_entry_release()
108 if (midEntry->large_buf) in _cifs_mid_q_entry_release()
109 cifs_buf_release(midEntry->resp_buf); in _cifs_mid_q_entry_release()
111 cifs_small_buf_release(midEntry->resp_buf); in _cifs_mid_q_entry_release()
114 if (now < midEntry->when_alloc) in _cifs_mid_q_entry_release()
116 roundtrip_time = now - midEntry->when_alloc; in _cifs_mid_q_entry_release()
119 if (atomic_read(&server->num_cmds[smb_cmd]) == 0) { in _cifs_mid_q_entry_release()
120 server->slowest_cmd[smb_cmd] = roundtrip_time; in _cifs_mid_q_entry_release()
121 server->fastest_cmd[smb_cmd] = roundtrip_time; in _cifs_mid_q_entry_release()
123 if (server->slowest_cmd[smb_cmd] < roundtrip_time) in _cifs_mid_q_entry_release()
124 server->slowest_cmd[smb_cmd] = roundtrip_time; in _cifs_mid_q_entry_release()
125 else if (server->fastest_cmd[smb_cmd] > roundtrip_time) in _cifs_mid_q_entry_release()
126 server->fastest_cmd[smb_cmd] = roundtrip_time; in _cifs_mid_q_entry_release()
128 cifs_stats_inc(&server->num_cmds[smb_cmd]); in _cifs_mid_q_entry_release()
129 server->time_per_cmd[smb_cmd] += roundtrip_time; in _cifs_mid_q_entry_release()
137 * since only affects debug counters - so leaving the calc as simple in _cifs_mid_q_entry_release()
142 time_after(now, midEntry->when_alloc + (slow_rsp_threshold * HZ)) && in _cifs_mid_q_entry_release()
143 (midEntry->command != command)) { in _cifs_mid_q_entry_release()
149 cifs_stats_inc(&server->smb2slowcmd[smb_cmd]); in _cifs_mid_q_entry_release()
151 trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid, in _cifs_mid_q_entry_release()
152 midEntry->when_sent, midEntry->when_received); in _cifs_mid_q_entry_release()
155 midEntry->command, midEntry->mid); in _cifs_mid_q_entry_release()
157 now - midEntry->when_alloc, in _cifs_mid_q_entry_release()
158 now - midEntry->when_sent, in _cifs_mid_q_entry_release()
159 now - midEntry->when_received); in _cifs_mid_q_entry_release()
163 put_task_struct(midEntry->creator); in _cifs_mid_q_entry_release()
171 kref_put(&midEntry->refcount, _cifs_mid_q_entry_release); in cifs_mid_q_entry_release()
184 if (!(mid->mid_flags & MID_DELETED)) { in cifs_delete_mid()
185 list_del_init(&mid->qhead); in cifs_delete_mid()
186 mid->mid_flags |= MID_DELETED; in cifs_delete_mid()
194 * smb_send_kvec - send an array of kvecs to the server
208 struct socket *ssocket = server->ssocket; in smb_send_kvec()
212 if (server->noblocksnd) in smb_send_kvec()
213 smb_msg->msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; in smb_send_kvec()
215 smb_msg->msg_flags = MSG_NOSIGNAL; in smb_send_kvec()
237 if (rc == -EAGAIN) { in smb_send_kvec()
240 (!server->noblocksnd && (retries > 2))) { in smb_send_kvec()
243 return -EAGAIN; in smb_send_kvec()
275 if (server->vals->header_preamble_size == 0 && in smb_rqst_len()
276 rqst->rq_nvec >= 2 && rqst->rq_iov[0].iov_len == 4) { in smb_rqst_len()
277 iov = &rqst->rq_iov[1]; in smb_rqst_len()
278 nvec = rqst->rq_nvec - 1; in smb_rqst_len()
280 iov = rqst->rq_iov; in smb_rqst_len()
281 nvec = rqst->rq_nvec; in smb_rqst_len()
294 if (rqst->rq_npages) { in smb_rqst_len()
295 if (rqst->rq_npages == 1) in smb_rqst_len()
296 buflen += rqst->rq_tailsz; in smb_rqst_len()
302 buflen += rqst->rq_pagesz * (rqst->rq_npages - 1) - in smb_rqst_len()
303 rqst->rq_offset; in smb_rqst_len()
304 buflen += rqst->rq_tailsz; in smb_rqst_len()
322 struct socket *ssocket = server->ssocket; in __smb_send_rqst()
327 /* return -EAGAIN when connecting or reconnecting */ in __smb_send_rqst()
328 rc = -EAGAIN; in __smb_send_rqst()
329 if (server->smbd_conn) in __smb_send_rqst()
335 return -EAGAIN; in __smb_send_rqst()
339 return -ERESTARTSYS; in __smb_send_rqst()
343 tcp_sock_set_cork(ssocket->sk, true); in __smb_send_rqst()
360 if (server->vals->header_preamble_size == 0) { in __smb_send_rqst()
428 rc = -ERESTARTSYS; in __smb_send_rqst()
432 tcp_sock_set_cork(ssocket->sk, false); in __smb_send_rqst()
442 server->tcpStatus = CifsNeedReconnect; in __smb_send_rqst()
443 trace_smb3_partial_send_reconnect(server->CurrentMid, in __smb_send_rqst()
444 server->hostname); in __smb_send_rqst()
447 if (rc < 0 && rc != -EINTR) in __smb_send_rqst()
468 if (num_rqst > MAX_COMPOUND - 1) in smb_send_rqst()
469 return -ENOMEM; in smb_send_rqst()
471 if (!server->ops->init_transform_rq) { in smb_send_rqst()
473 return -EIO; in smb_send_rqst()
478 return -ENOMEM; in smb_send_rqst()
489 rc = server->ops->init_transform_rq(server, num_rqst + 1, in smb_send_rqst()
536 credits = server->ops->get_credits_field(server, optype); in wait_for_free_credits()
539 return -EAGAIN; in wait_for_free_credits()
541 spin_lock(&server->req_lock); in wait_for_free_credits()
544 server->in_flight++; in wait_for_free_credits()
545 if (server->in_flight > server->max_in_flight) in wait_for_free_credits()
546 server->max_in_flight = server->in_flight; in wait_for_free_credits()
547 *credits -= 1; in wait_for_free_credits()
548 *instance = server->reconnect_instance; in wait_for_free_credits()
549 spin_unlock(&server->req_lock); in wait_for_free_credits()
555 spin_unlock(&server->req_lock); in wait_for_free_credits()
557 rc = wait_event_killable_timeout(server->request_q, in wait_for_free_credits()
561 trace_smb3_credit_timeout(server->CurrentMid, in wait_for_free_credits()
562 server->hostname, num_credits, 0); in wait_for_free_credits()
565 return -ENOTSUPP; in wait_for_free_credits()
567 if (rc == -ERESTARTSYS) in wait_for_free_credits()
568 return -ERESTARTSYS; in wait_for_free_credits()
569 spin_lock(&server->req_lock); in wait_for_free_credits()
571 if (server->tcpStatus == CifsExiting) { in wait_for_free_credits()
572 spin_unlock(&server->req_lock); in wait_for_free_credits()
573 return -ENOENT; in wait_for_free_credits()
580 * starved for credits by single-credit requests. in wait_for_free_credits()
590 server->in_flight > 2 * MAX_COMPOUND && in wait_for_free_credits()
592 spin_unlock(&server->req_lock); in wait_for_free_credits()
595 server->request_q, in wait_for_free_credits()
602 server->CurrentMid, in wait_for_free_credits()
603 server->hostname, num_credits, in wait_for_free_credits()
607 return -ENOTSUPP; in wait_for_free_credits()
609 if (rc == -ERESTARTSYS) in wait_for_free_credits()
610 return -ERESTARTSYS; in wait_for_free_credits()
611 spin_lock(&server->req_lock); in wait_for_free_credits()
622 *credits -= num_credits; in wait_for_free_credits()
623 server->in_flight += num_credits; in wait_for_free_credits()
624 if (server->in_flight > server->max_in_flight) in wait_for_free_credits()
625 server->max_in_flight = server->in_flight; in wait_for_free_credits()
626 *instance = server->reconnect_instance; in wait_for_free_credits()
628 spin_unlock(&server->req_lock); in wait_for_free_credits()
639 return wait_for_free_credits(server, 1, -1, flags, in wait_for_free_request()
649 credits = server->ops->get_credits_field(server, flags & CIFS_OP_MASK); in wait_for_compound_request()
651 spin_lock(&server->req_lock); in wait_for_compound_request()
669 if (server->in_flight == 0) { in wait_for_compound_request()
670 spin_unlock(&server->req_lock); in wait_for_compound_request()
671 return -ENOTSUPP; in wait_for_compound_request()
674 spin_unlock(&server->req_lock); in wait_for_compound_request()
685 credits->value = 0; in cifs_wait_mtu_credits()
686 credits->instance = server->reconnect_instance; in cifs_wait_mtu_credits()
693 if (ses->server->tcpStatus == CifsExiting) { in allocate_mid()
694 return -ENOENT; in allocate_mid()
697 if (ses->server->tcpStatus == CifsNeedReconnect) { in allocate_mid()
698 cifs_dbg(FYI, "tcp session dead - return to caller to retry\n"); in allocate_mid()
699 return -EAGAIN; in allocate_mid()
702 if (ses->status == CifsNew) { in allocate_mid()
703 if ((in_buf->Command != SMB_COM_SESSION_SETUP_ANDX) && in allocate_mid()
704 (in_buf->Command != SMB_COM_NEGOTIATE)) in allocate_mid()
705 return -EAGAIN; in allocate_mid()
706 /* else ok - we are setting up session */ in allocate_mid()
709 if (ses->status == CifsExiting) { in allocate_mid()
711 if (in_buf->Command != SMB_COM_LOGOFF_ANDX) in allocate_mid()
712 return -EAGAIN; in allocate_mid()
713 /* else ok - we are shutting down session */ in allocate_mid()
716 *ppmidQ = AllocMidQEntry(in_buf, ses->server); in allocate_mid()
718 return -ENOMEM; in allocate_mid()
720 list_add_tail(&(*ppmidQ)->qhead, &ses->server->pending_mid_q); in allocate_mid()
730 error = wait_event_freezekillable_unsafe(server->response_q, in wait_for_response()
731 midQ->mid_state != MID_REQUEST_SUBMITTED); in wait_for_response()
733 return -ERESTARTSYS; in wait_for_response()
742 struct smb_hdr *hdr = (struct smb_hdr *)rqst->rq_iov[0].iov_base; in cifs_setup_async_request()
745 if (rqst->rq_iov[0].iov_len != 4 || in cifs_setup_async_request()
746 rqst->rq_iov[0].iov_base + 4 != rqst->rq_iov[1].iov_base) in cifs_setup_async_request()
747 return ERR_PTR(-EIO); in cifs_setup_async_request()
750 if (server->sign) in cifs_setup_async_request()
751 hdr->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; in cifs_setup_async_request()
755 return ERR_PTR(-ENOMEM); in cifs_setup_async_request()
757 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
791 instance = exist_credits->instance; in cifs_call_async()
793 mutex_lock(&server->srv_mutex); in cifs_call_async()
798 * return -EAGAIN in such cases to let callers handle it. in cifs_call_async()
800 if (instance != server->reconnect_instance) { in cifs_call_async()
801 mutex_unlock(&server->srv_mutex); in cifs_call_async()
803 return -EAGAIN; in cifs_call_async()
806 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
808 mutex_unlock(&server->srv_mutex); in cifs_call_async()
813 mid->receive = receive; in cifs_call_async()
814 mid->callback = callback; in cifs_call_async()
815 mid->callback_data = cbdata; in cifs_call_async()
816 mid->handle = handle; in cifs_call_async()
817 mid->mid_state = MID_REQUEST_SUBMITTED; in cifs_call_async()
821 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
834 revert_current_mid(server, mid->credits); in cifs_call_async()
835 server->sequence_number -= 2; in cifs_call_async()
839 mutex_unlock(&server->srv_mutex); in cifs_call_async()
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()
889 rc = -EAGAIN; in cifs_sync_mid_result()
892 rc = -EIO; in cifs_sync_mid_result()
895 rc = -EHOSTDOWN; 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 __func__, mid->mid, mid->mid_state); in cifs_sync_mid_result()
904 rc = -EIO; in cifs_sync_mid_result()
916 return server->ops->send_cancel ? in send_cancel()
917 server->ops->send_cancel(server, rqst, mid) : 0; in send_cancel()
924 unsigned int len = get_rfc1002_length(mid->resp_buf) + 4; in cifs_check_receive()
926 dump_smb(mid->resp_buf, min_t(u32, 92, len)); in cifs_check_receive()
929 if (server->sign) { in cifs_check_receive()
935 iov[0].iov_base = mid->resp_buf; in cifs_check_receive()
937 iov[1].iov_base = (char *)mid->resp_buf + 4; in cifs_check_receive()
938 iov[1].iov_len = len - 4; in cifs_check_receive()
941 mid->sequence_number); in cifs_check_receive()
956 struct smb_hdr *hdr = (struct smb_hdr *)rqst->rq_iov[0].iov_base; in cifs_setup_request()
959 if (rqst->rq_iov[0].iov_len != 4 || in cifs_setup_request()
960 rqst->rq_iov[0].iov_base + 4 != rqst->rq_iov[1].iov_base) in cifs_setup_request()
961 return ERR_PTR(-EIO); in cifs_setup_request()
966 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
977 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback()
980 credits.value = server->ops->get_credits(mid); in cifs_compound_callback()
981 credits.instance = server->reconnect_instance; in cifs_compound_callback()
983 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
1001 * Return a channel (master if none) of @ses that can be used to send
1004 * If we are currently binding a new channel (negprot/sess.setup),
1005 * return the new incomplete channel.
1014 if (!ses->binding) { in cifs_pick_channel()
1016 if (ses->chan_count > 1) { in cifs_pick_channel()
1017 index = (uint)atomic_inc_return(&ses->chan_seq); in cifs_pick_channel()
1018 index %= ses->chan_count; in cifs_pick_channel()
1020 return ses->chans[index].server; in cifs_pick_channel()
1046 if (!ses || !ses->server || !server) { in compound_send_recv()
1048 return -EIO; in compound_send_recv()
1051 if (server->tcpStatus == CifsExiting) in compound_send_recv()
1052 return -ENOENT; in compound_send_recv()
1078 mutex_lock(&server->srv_mutex); in compound_send_recv()
1084 * we obtained credits and return -EAGAIN in such cases to let callers in compound_send_recv()
1087 if (instance != server->reconnect_instance) { in compound_send_recv()
1088 mutex_unlock(&server->srv_mutex); in compound_send_recv()
1091 return -EAGAIN; in compound_send_recv()
1095 midQ[i] = server->ops->setup_request(ses, server, &rqst[i]); in compound_send_recv()
1100 mutex_unlock(&server->srv_mutex); in compound_send_recv()
1108 midQ[i]->mid_state = MID_REQUEST_SUBMITTED; in compound_send_recv()
1109 midQ[i]->optype = optype; in compound_send_recv()
1115 if (i < num_rqst - 1) in compound_send_recv()
1116 midQ[i]->callback = cifs_compound_callback; in compound_send_recv()
1118 midQ[i]->callback = cifs_compound_last_callback; in compound_send_recv()
1129 server->sequence_number -= 2; in compound_send_recv()
1132 mutex_unlock(&server->srv_mutex); in compound_send_recv()
1136 * will not receive a response to - return credits back in compound_send_recv()
1145 * At this point the request is passed to the network stack - we assume in compound_send_recv()
1155 if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) { in compound_send_recv()
1156 mutex_lock(&server->srv_mutex); in compound_send_recv()
1159 mutex_unlock(&server->srv_mutex); in compound_send_recv()
1170 midQ[i]->mid, le16_to_cpu(midQ[i]->command)); in compound_send_recv()
1173 midQ[i]->mid_flags |= MID_WAIT_CANCELLED; in compound_send_recv()
1174 if (midQ[i]->mid_state == MID_REQUEST_SUBMITTED) { in compound_send_recv()
1175 midQ[i]->callback = cifs_cancelled_callback; in compound_send_recv()
1194 if (!midQ[i]->resp_buf || in compound_send_recv()
1195 midQ[i]->mid_state != MID_RESPONSE_RECEIVED) { in compound_send_recv()
1196 rc = -EIO; in compound_send_recv()
1201 buf = (char *)midQ[i]->resp_buf; in compound_send_recv()
1203 resp_iov[i].iov_len = midQ[i]->resp_buf_size + in compound_send_recv()
1204 server->vals->header_preamble_size; in compound_send_recv()
1206 if (midQ[i]->large_buf) in compound_send_recv()
1211 rc = server->ops->check_receive(midQ[i], server, in compound_send_recv()
1216 midQ[i]->resp_buf = NULL; in compound_send_recv()
1223 if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) { in compound_send_recv()
1228 mutex_lock(&server->srv_mutex); in compound_send_recv()
1230 mutex_unlock(&server->srv_mutex); in compound_send_recv()
1273 return -ENOMEM; in SendReceive2()
1284 new_iov[1].iov_len -= 4; in SendReceive2()
1290 rc = cifs_send_recv(xid, ses, ses->server, in SendReceive2()
1304 unsigned int len = be32_to_cpu(in_buf->smb_buf_length); in SendReceive()
1312 return -EIO; in SendReceive()
1314 server = ses->server; in SendReceive()
1317 return -EIO; in SendReceive()
1320 if (server->tcpStatus == CifsExiting) in SendReceive()
1321 return -ENOENT; in SendReceive()
1325 use ses->maxReq */ in SendReceive()
1327 if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { in SendReceive()
1330 return -EIO; in SendReceive()
1341 mutex_lock(&server->srv_mutex); in SendReceive()
1345 mutex_unlock(&server->srv_mutex); in SendReceive()
1351 rc = cifs_sign_smb(in_buf, server, &midQ->sequence_number); in SendReceive()
1353 mutex_unlock(&server->srv_mutex); in SendReceive()
1357 midQ->mid_state = MID_REQUEST_SUBMITTED; in SendReceive()
1365 server->sequence_number -= 2; in SendReceive()
1367 mutex_unlock(&server->srv_mutex); in SendReceive()
1376 if (midQ->mid_state == MID_REQUEST_SUBMITTED) { in SendReceive()
1377 /* no longer considered to be "in-flight" */ in SendReceive()
1378 midQ->callback = DeleteMidQEntry; in SendReceive()
1392 if (!midQ->resp_buf || !out_buf || in SendReceive()
1393 midQ->mid_state != MID_RESPONSE_RECEIVED) { in SendReceive()
1394 rc = -EIO; in SendReceive()
1399 *pbytes_returned = get_rfc1002_length(midQ->resp_buf); in SendReceive()
1400 memcpy(out_buf, midQ->resp_buf, *pbytes_returned + 4); in SendReceive()
1413 send_lock_cancel(const unsigned int xid, struct cifs_tcon *tcon, in send_lock_cancel() argument
1418 struct cifs_ses *ses = tcon->ses; in send_lock_cancel()
1426 pSMB->LockType = LOCKING_ANDX_CANCEL_LOCK|LOCKING_ANDX_LARGE_FILES; in send_lock_cancel()
1427 pSMB->Timeout = 0; in send_lock_cancel()
1428 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1435 SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, in SendReceiveBlockingLock() argument
1443 unsigned int len = be32_to_cpu(in_buf->smb_buf_length); in SendReceiveBlockingLock()
1449 if (tcon == NULL || tcon->ses == NULL) { in SendReceiveBlockingLock()
1451 return -EIO; in SendReceiveBlockingLock()
1453 ses = tcon->ses; in SendReceiveBlockingLock()
1454 server = ses->server; in SendReceiveBlockingLock()
1458 return -EIO; in SendReceiveBlockingLock()
1461 if (server->tcpStatus == CifsExiting) in SendReceiveBlockingLock()
1462 return -ENOENT; in SendReceiveBlockingLock()
1466 use ses->maxReq */ in SendReceiveBlockingLock()
1468 if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { in SendReceiveBlockingLock()
1471 return -EIO; in SendReceiveBlockingLock()
1482 mutex_lock(&server->srv_mutex); in SendReceiveBlockingLock()
1486 mutex_unlock(&server->srv_mutex); in SendReceiveBlockingLock()
1490 rc = cifs_sign_smb(in_buf, server, &midQ->sequence_number); in SendReceiveBlockingLock()
1493 mutex_unlock(&server->srv_mutex); in SendReceiveBlockingLock()
1497 midQ->mid_state = MID_REQUEST_SUBMITTED; in SendReceiveBlockingLock()
1504 server->sequence_number -= 2; in SendReceiveBlockingLock()
1506 mutex_unlock(&server->srv_mutex); in SendReceiveBlockingLock()
1513 /* Wait for a reply - allow signals to interrupt. */ in SendReceiveBlockingLock()
1514 rc = wait_event_interruptible(server->response_q, in SendReceiveBlockingLock()
1515 (!(midQ->mid_state == MID_REQUEST_SUBMITTED)) || in SendReceiveBlockingLock()
1516 ((server->tcpStatus != CifsGood) && in SendReceiveBlockingLock()
1517 (server->tcpStatus != CifsNew))); in SendReceiveBlockingLock()
1520 if ((rc == -ERESTARTSYS) && in SendReceiveBlockingLock()
1521 (midQ->mid_state == MID_REQUEST_SUBMITTED) && in SendReceiveBlockingLock()
1522 ((server->tcpStatus == CifsGood) || in SendReceiveBlockingLock()
1523 (server->tcpStatus == CifsNew))) { in SendReceiveBlockingLock()
1525 if (in_buf->Command == SMB_COM_TRANSACTION2) { in SendReceiveBlockingLock()
1537 rc = send_lock_cancel(xid, tcon, in_buf, out_buf); in SendReceiveBlockingLock()
1539 /* If we get -ENOLCK back the lock may have in SendReceiveBlockingLock()
1541 if (rc && rc != -ENOLCK) { in SendReceiveBlockingLock()
1551 if (midQ->mid_state == MID_REQUEST_SUBMITTED) { in SendReceiveBlockingLock()
1552 /* no longer considered to be "in-flight" */ in SendReceiveBlockingLock()
1553 midQ->callback = DeleteMidQEntry; in SendReceiveBlockingLock()
1560 /* We got the response - restart system call. */ in SendReceiveBlockingLock()
1569 if (out_buf == NULL || midQ->mid_state != MID_RESPONSE_RECEIVED) { in SendReceiveBlockingLock()
1570 rc = -EIO; in SendReceiveBlockingLock()
1575 *pbytes_returned = get_rfc1002_length(midQ->resp_buf); in SendReceiveBlockingLock()
1576 memcpy(out_buf, midQ->resp_buf, *pbytes_returned + 4); in SendReceiveBlockingLock()
1580 if (rstart && rc == -EACCES) in SendReceiveBlockingLock()
1581 return -ERESTARTSYS; in SendReceiveBlockingLock()