Lines Matching full:server

45 alloc_mid(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)  in alloc_mid()  argument
49 if (server == NULL) { in alloc_mid()
64 temp->server = server; in alloc_mid()
85 __le16 command = midEntry->server->vals->lock_cmd; in __release_mid()
90 struct TCP_Server_Info *server = midEntry->server; in __release_mid() local
95 server->ops->handle_cancelled_mid) in __release_mid()
96 server->ops->handle_cancelled_mid(midEntry, server); in __release_mid()
111 if (atomic_read(&server->num_cmds[smb_cmd]) == 0) { in __release_mid()
112 server->slowest_cmd[smb_cmd] = roundtrip_time; in __release_mid()
113 server->fastest_cmd[smb_cmd] = roundtrip_time; in __release_mid()
115 if (server->slowest_cmd[smb_cmd] < roundtrip_time) in __release_mid()
116 server->slowest_cmd[smb_cmd] = roundtrip_time; in __release_mid()
117 else if (server->fastest_cmd[smb_cmd] > roundtrip_time) in __release_mid()
118 server->fastest_cmd[smb_cmd] = roundtrip_time; in __release_mid()
120 cifs_stats_inc(&server->num_cmds[smb_cmd]); in __release_mid()
121 server->time_per_cmd[smb_cmd] += roundtrip_time; in __release_mid()
126 * busy server. Note that this calc is unlikely or impossible to wrap in __release_mid()
141 cifs_stats_inc(&server->smb2slowcmd[smb_cmd]); in __release_mid()
163 spin_lock(&mid->server->mid_lock); in delete_mid()
168 spin_unlock(&mid->server->mid_lock); in delete_mid()
174 * smb_send_kvec - send an array of kvecs to the server
175 * @server: Server to send the data to
179 * Our basic "send data to server" function. Should be called with srv_mutex
183 smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, in smb_send_kvec() argument
188 struct socket *ssocket = server->ssocket; in smb_send_kvec()
192 if (server->noblocksnd) in smb_send_kvec()
205 * the server in SendReceive[2] for the server to send in smb_send_kvec()
220 (!server->noblocksnd && (retries > 2))) { in smb_send_kvec()
248 smb_rqst_len(struct TCP_Server_Info *server, struct smb_rqst *rqst) in smb_rqst_len() argument
255 if (!is_smb1(server) && rqst->rq_nvec >= 2 && in smb_rqst_len()
273 __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, in __smb_send_rqst() argument
283 struct socket *ssocket = server->ssocket; in __smb_send_rqst()
287 cifs_in_send_inc(server); in __smb_send_rqst()
288 if (cifs_rdma_enabled(server)) { in __smb_send_rqst()
291 if (server->smbd_conn) in __smb_send_rqst()
292 rc = smbd_send(server, num_rqst, rqst); in __smb_send_rqst()
311 send_length += smb_rqst_len(server, &rqst[j]); in __smb_send_rqst()
317 * latency of system calls and overload a server with unnecessary in __smb_send_rqst()
325 if (!is_smb1(server)) { in __smb_send_rqst()
331 rc = smb_send_kvec(server, &smb_msg, &sent); in __smb_send_rqst()
353 rc = smb_send_kvec(server, &smb_msg, &sent); in __smb_send_rqst()
361 rc = smb_send_kvec(server, &smb_msg, &sent); in __smb_send_rqst()
374 * the server we need to return success status to allow a corresponding in __smb_send_rqst()
376 * to handle responses from the server by the client. in __smb_send_rqst()
380 * won't be any response from the server to handle. in __smb_send_rqst()
397 * socket so the server throws away the partial SMB in __smb_send_rqst()
399 cifs_signal_cifsd_for_reconnect(server, false); in __smb_send_rqst()
400 trace_smb3_partial_send_reconnect(server->CurrentMid, in __smb_send_rqst()
401 server->conn_id, server->hostname); in __smb_send_rqst()
410 cifs_server_dbg(VFS, "Error %d sending data on socket to server\n", in __smb_send_rqst()
413 cifs_signal_cifsd_for_reconnect(server, false); in __smb_send_rqst()
417 cifs_in_send_dec(server); in __smb_send_rqst()
428 smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, in smb_send_rqst() argument
437 return smb_compress(server, &rqst[0], __smb_send_rqst); in smb_send_rqst()
440 return __smb_send_rqst(server, num_rqst, rqst); in smb_send_rqst()
445 if (!server->ops->init_transform_rq) { in smb_send_rqst()
461 rc = server->ops->init_transform_rq(server, num_rqst + 1, in smb_send_rqst()
466 rc = __smb_send_rqst(server, num_rqst + 1, &cur_rqst[0]); in smb_send_rqst()
474 smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer, in smb_send() argument
486 return __smb_send_rqst(server, 1, &rqst); in smb_send()
490 wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits, in wait_for_free_credits() argument
509 credits = server->ops->get_credits_field(server, optype); in wait_for_free_credits()
514 spin_lock(&server->req_lock); in wait_for_free_credits()
517 server->in_flight++; in wait_for_free_credits()
518 if (server->in_flight > server->max_in_flight) in wait_for_free_credits()
519 server->max_in_flight = server->in_flight; in wait_for_free_credits()
521 *instance = server->reconnect_instance; in wait_for_free_credits()
523 in_flight = server->in_flight; in wait_for_free_credits()
524 spin_unlock(&server->req_lock); in wait_for_free_credits()
526 trace_smb3_nblk_credits(server->CurrentMid, in wait_for_free_credits()
527 server->conn_id, server->hostname, scredits, -1, in_flight); in wait_for_free_credits()
535 spin_unlock(&server->req_lock); in wait_for_free_credits()
537 spin_lock(&server->srv_lock); in wait_for_free_credits()
538 if (server->tcpStatus == CifsExiting) { in wait_for_free_credits()
539 spin_unlock(&server->srv_lock); in wait_for_free_credits()
542 spin_unlock(&server->srv_lock); in wait_for_free_credits()
544 spin_lock(&server->req_lock); in wait_for_free_credits()
547 spin_unlock(&server->req_lock); in wait_for_free_credits()
549 cifs_num_waiters_inc(server); in wait_for_free_credits()
550 rc = wait_event_killable_timeout(server->request_q, in wait_for_free_credits()
551 has_credits(server, credits, num_credits), t); in wait_for_free_credits()
552 cifs_num_waiters_dec(server); in wait_for_free_credits()
554 spin_lock(&server->req_lock); in wait_for_free_credits()
556 in_flight = server->in_flight; in wait_for_free_credits()
557 spin_unlock(&server->req_lock); in wait_for_free_credits()
559 trace_smb3_credit_timeout(server->CurrentMid, in wait_for_free_credits()
560 server->conn_id, server->hostname, scredits, in wait_for_free_credits()
568 spin_lock(&server->req_lock); in wait_for_free_credits()
584 server->in_flight > 2 * MAX_COMPOUND && in wait_for_free_credits()
586 spin_unlock(&server->req_lock); in wait_for_free_credits()
588 cifs_num_waiters_inc(server); in wait_for_free_credits()
590 server->request_q, in wait_for_free_credits()
591 has_credits(server, credits, in wait_for_free_credits()
594 cifs_num_waiters_dec(server); in wait_for_free_credits()
596 spin_lock(&server->req_lock); in wait_for_free_credits()
598 in_flight = server->in_flight; in wait_for_free_credits()
599 spin_unlock(&server->req_lock); in wait_for_free_credits()
602 server->CurrentMid, in wait_for_free_credits()
603 server->conn_id, server->hostname, in wait_for_free_credits()
611 spin_lock(&server->req_lock); in wait_for_free_credits()
617 * as they are allowed to block on server. in wait_for_free_credits()
620 /* update # of requests on the wire to server */ 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()
629 in_flight = server->in_flight; in wait_for_free_credits()
630 spin_unlock(&server->req_lock); in wait_for_free_credits()
632 trace_smb3_waitff_credits(server->CurrentMid, in wait_for_free_credits()
633 server->conn_id, server->hostname, scredits, in wait_for_free_credits()
644 wait_for_free_request(struct TCP_Server_Info *server, const int flags, in wait_for_free_request() argument
647 return wait_for_free_credits(server, 1, -1, flags, in wait_for_free_request()
652 wait_for_compound_request(struct TCP_Server_Info *server, int num, in wait_for_compound_request() argument
658 credits = server->ops->get_credits_field(server, flags & CIFS_OP_MASK); in wait_for_compound_request()
660 spin_lock(&server->req_lock); in wait_for_compound_request()
662 in_flight = server->in_flight; in wait_for_compound_request()
666 * If the server is tight on resources or just gives us less in wait_for_compound_request()
668 * order and the server delays granting more credits until it in wait_for_compound_request()
675 * server will return enough credits to satisfy this compound in wait_for_compound_request()
681 if (server->in_flight == 0) { in wait_for_compound_request()
682 spin_unlock(&server->req_lock); in wait_for_compound_request()
683 trace_smb3_insufficient_credits(server->CurrentMid, in wait_for_compound_request()
684 server->conn_id, server->hostname, scredits, in wait_for_compound_request()
691 spin_unlock(&server->req_lock); in wait_for_compound_request()
693 return wait_for_free_credits(server, num, 60000, flags, in wait_for_compound_request()
698 cifs_wait_mtu_credits(struct TCP_Server_Info *server, size_t size, in cifs_wait_mtu_credits() argument
703 credits->instance = server->reconnect_instance; in cifs_wait_mtu_credits()
730 *ppmidQ = alloc_mid(in_buf, ses->server); in allocate_mid()
733 spin_lock(&ses->server->mid_lock); in allocate_mid()
734 list_add_tail(&(*ppmidQ)->qhead, &ses->server->pending_mid_q); in allocate_mid()
735 spin_unlock(&ses->server->mid_lock); in allocate_mid()
740 wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) in wait_for_response() argument
744 error = wait_event_state(server->response_q, in wait_for_response()
755 cifs_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst) in cifs_setup_async_request() argument
765 /* enable signing if server requires it */ in cifs_setup_async_request()
766 if (server->sign) in cifs_setup_async_request()
769 mid = alloc_mid(hdr, server); in cifs_setup_async_request()
773 rc = cifs_sign_rqst(rqst, server, &mid->sequence_number); in cifs_setup_async_request()
787 cifs_call_async(struct TCP_Server_Info *server, struct smb_rqst *rqst, in cifs_call_async() argument
801 rc = wait_for_free_request(server, flags, &instance); in cifs_call_async()
809 cifs_server_lock(server); in cifs_call_async()
816 if (instance != server->reconnect_instance) { in cifs_call_async()
817 cifs_server_unlock(server); in cifs_call_async()
818 add_credits_and_wake_if(server, &credits, optype); in cifs_call_async()
822 mid = server->ops->setup_async_request(server, rqst); in cifs_call_async()
824 cifs_server_unlock(server); in cifs_call_async()
825 add_credits_and_wake_if(server, &credits, optype); in cifs_call_async()
836 spin_lock(&server->mid_lock); in cifs_call_async()
837 list_add_tail(&mid->qhead, &server->pending_mid_q); in cifs_call_async()
838 spin_unlock(&server->mid_lock); in cifs_call_async()
845 rc = smb_send_rqst(server, 1, rqst, flags); in cifs_call_async()
848 revert_current_mid(server, mid->credits); in cifs_call_async()
849 server->sequence_number -= 2; in cifs_call_async()
853 cifs_server_unlock(server); in cifs_call_async()
858 add_credits_and_wake_if(server, &credits, optype); 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
897 spin_lock(&server->mid_lock); in cifs_sync_mid_result()
900 spin_unlock(&server->mid_lock); in cifs_sync_mid_result()
916 spin_unlock(&server->mid_lock); in cifs_sync_mid_result()
922 spin_unlock(&server->mid_lock); in cifs_sync_mid_result()
930 send_cancel(struct TCP_Server_Info *server, struct smb_rqst *rqst, in send_cancel() argument
933 return server->ops->send_cancel ? in send_cancel()
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
946 if (server->sign) { in cifs_check_receive()
957 rc = cifs_verify_signature(&rqst, server, in cifs_check_receive()
983 rc = cifs_sign_rqst(rqst, ses->server, &mid->sequence_number); in cifs_setup_request()
994 struct TCP_Server_Info *server = mid->server; in cifs_compound_callback() local
996 .value = server->ops->get_credits(mid), in cifs_compound_callback()
997 .instance = server->reconnect_instance, in cifs_compound_callback()
1000 add_credits(server, &credits, mid->optype); in cifs_compound_callback()
1031 struct TCP_Server_Info *server = NULL; in cifs_pick_channel() local
1039 server = ses->chans[i].server; in cifs_pick_channel()
1040 if (!server || server->terminate) in cifs_pick_channel()
1048 * server->in_flight. But it shouldn't matter much here if we in cifs_pick_channel()
1054 if (server->in_flight < min_in_flight) { in cifs_pick_channel()
1055 min_in_flight = server->in_flight; in cifs_pick_channel()
1058 if (server->in_flight > max_in_flight) in cifs_pick_channel()
1059 max_in_flight = server->in_flight; in cifs_pick_channel()
1068 server = ses->chans[index].server; in cifs_pick_channel()
1071 return server; in cifs_pick_channel()
1076 struct TCP_Server_Info *server, in compound_send_recv() argument
1094 if (!ses || !ses->server || !server) { in compound_send_recv()
1099 spin_lock(&server->srv_lock); in compound_send_recv()
1100 if (server->tcpStatus == CifsExiting) { in compound_send_recv()
1101 spin_unlock(&server->srv_lock); in compound_send_recv()
1104 spin_unlock(&server->srv_lock); in compound_send_recv()
1109 * credits if the server doesn't grant credits to the outstanding in compound_send_recv()
1114 rc = wait_for_compound_request(server, num_rqst, flags, in compound_send_recv()
1130 cifs_server_lock(server); in compound_send_recv()
1139 if (instance != server->reconnect_instance) { in compound_send_recv()
1140 cifs_server_unlock(server); in compound_send_recv()
1142 add_credits(server, &credits[j], optype); in compound_send_recv()
1147 midQ[i] = server->ops->setup_request(ses, server, &rqst[i]); in compound_send_recv()
1149 revert_current_mid(server, i); in compound_send_recv()
1152 cifs_server_unlock(server); in compound_send_recv()
1154 /* Update # of requests on wire to server */ in compound_send_recv()
1156 add_credits(server, &credits[j], optype); in compound_send_recv()
1172 rc = smb_send_rqst(server, num_rqst, rqst, flags); in compound_send_recv()
1178 revert_current_mid(server, num_rqst); in compound_send_recv()
1179 server->sequence_number -= 2; in compound_send_recv()
1182 cifs_server_unlock(server); in compound_send_recv()
1190 add_credits(server, &credits[i], optype); in compound_send_recv()
1196 * that any credits taken from the server structure on the client have in compound_send_recv()
1198 * we will collect credits granted by the server in the mid callbacks in compound_send_recv()
1199 * and add those credits to the server structure. in compound_send_recv()
1209 cifs_server_lock(server); in compound_send_recv()
1210 smb311_update_preauth_hash(ses, server, rqst[0].rq_iov, rqst[0].rq_nvec); in compound_send_recv()
1211 cifs_server_unlock(server); in compound_send_recv()
1218 rc = wait_for_response(server, midQ[i]); in compound_send_recv()
1226 send_cancel(server, &rqst[i], midQ[i]); in compound_send_recv()
1227 spin_lock(&server->mid_lock); in compound_send_recv()
1235 spin_unlock(&server->mid_lock); in compound_send_recv()
1243 rc = cifs_sync_mid_result(midQ[i], server); in compound_send_recv()
1260 HEADER_PREAMBLE_SIZE(server); in compound_send_recv()
1267 rc = server->ops->check_receive(midQ[i], server, in compound_send_recv()
1286 cifs_server_lock(server); in compound_send_recv()
1287 smb311_update_preauth_hash(ses, server, &iov, 1); in compound_send_recv()
1288 cifs_server_unlock(server); in compound_send_recv()
1310 struct TCP_Server_Info *server, in cifs_send_recv() argument
1314 return compound_send_recv(xid, ses, server, flags, 1, in cifs_send_recv()
1350 rc = cifs_send_recv(xid, ses, ses->server, in SendReceive2()
1368 struct TCP_Server_Info *server; in SendReceive() local
1374 server = ses->server; in SendReceive()
1375 if (server == NULL) { in SendReceive()
1380 spin_lock(&server->srv_lock); in SendReceive()
1381 if (server->tcpStatus == CifsExiting) { in SendReceive()
1382 spin_unlock(&server->srv_lock); in SendReceive()
1385 spin_unlock(&server->srv_lock); in SendReceive()
1388 to the same server. We may make this configurable later or in SendReceive()
1397 rc = wait_for_free_request(server, flags, &credits.instance); in SendReceive()
1405 cifs_server_lock(server); in SendReceive()
1409 cifs_server_unlock(server); in SendReceive()
1410 /* Update # of requests on wire to server */ in SendReceive()
1411 add_credits(server, &credits, 0); in SendReceive()
1415 rc = cifs_sign_smb(in_buf, server, &midQ->sequence_number); in SendReceive()
1417 cifs_server_unlock(server); in SendReceive()
1423 rc = smb_send(server, in_buf, len); in SendReceive()
1427 server->sequence_number -= 2; in SendReceive()
1429 cifs_server_unlock(server); in SendReceive()
1434 rc = wait_for_response(server, midQ); in SendReceive()
1436 send_cancel(server, &rqst, midQ); in SendReceive()
1437 spin_lock(&server->mid_lock); in SendReceive()
1442 spin_unlock(&server->mid_lock); in SendReceive()
1443 add_credits(server, &credits, 0); in SendReceive()
1446 spin_unlock(&server->mid_lock); in SendReceive()
1449 rc = cifs_sync_mid_result(midQ, server); in SendReceive()
1451 add_credits(server, &credits, 0); in SendReceive()
1464 rc = cifs_check_receive(midQ, server, 0); in SendReceive()
1467 add_credits(server, &credits, 0); in SendReceive()
1491 pSMB->hdr.Mid = get_next_mid(ses->server); in send_lock_cancel()
1510 struct TCP_Server_Info *server; in SendReceiveBlockingLock() local
1517 server = ses->server; in SendReceiveBlockingLock()
1519 if (server == NULL) { in SendReceiveBlockingLock()
1524 spin_lock(&server->srv_lock); in SendReceiveBlockingLock()
1525 if (server->tcpStatus == CifsExiting) { in SendReceiveBlockingLock()
1526 spin_unlock(&server->srv_lock); in SendReceiveBlockingLock()
1529 spin_unlock(&server->srv_lock); in SendReceiveBlockingLock()
1532 to the same server. We may make this configurable later or in SendReceiveBlockingLock()
1541 rc = wait_for_free_request(server, CIFS_BLOCKING_OP, &instance); in SendReceiveBlockingLock()
1549 cifs_server_lock(server); in SendReceiveBlockingLock()
1553 cifs_server_unlock(server); in SendReceiveBlockingLock()
1557 rc = cifs_sign_smb(in_buf, server, &midQ->sequence_number); in SendReceiveBlockingLock()
1560 cifs_server_unlock(server); in SendReceiveBlockingLock()
1565 rc = smb_send(server, in_buf, len); in SendReceiveBlockingLock()
1569 server->sequence_number -= 2; in SendReceiveBlockingLock()
1571 cifs_server_unlock(server); in SendReceiveBlockingLock()
1579 rc = wait_event_interruptible(server->response_q, in SendReceiveBlockingLock()
1582 ((server->tcpStatus != CifsGood) && in SendReceiveBlockingLock()
1583 (server->tcpStatus != CifsNew))); in SendReceiveBlockingLock()
1586 spin_lock(&server->srv_lock); in SendReceiveBlockingLock()
1590 ((server->tcpStatus == CifsGood) || in SendReceiveBlockingLock()
1591 (server->tcpStatus == CifsNew))) { in SendReceiveBlockingLock()
1592 spin_unlock(&server->srv_lock); in SendReceiveBlockingLock()
1597 rc = send_cancel(server, &rqst, midQ); in SendReceiveBlockingLock()
1616 rc = wait_for_response(server, midQ); in SendReceiveBlockingLock()
1618 send_cancel(server, &rqst, midQ); in SendReceiveBlockingLock()
1619 spin_lock(&server->mid_lock); in SendReceiveBlockingLock()
1624 spin_unlock(&server->mid_lock); in SendReceiveBlockingLock()
1627 spin_unlock(&server->mid_lock); in SendReceiveBlockingLock()
1632 spin_lock(&server->srv_lock); in SendReceiveBlockingLock()
1634 spin_unlock(&server->srv_lock); in SendReceiveBlockingLock()
1636 rc = cifs_sync_mid_result(midQ, server); in SendReceiveBlockingLock()
1649 rc = cifs_check_receive(midQ, server, 0); in SendReceiveBlockingLock()
1662 cifs_discard_remaining_data(struct TCP_Server_Info *server) in cifs_discard_remaining_data() argument
1664 unsigned int rfclen = server->pdu_size; in cifs_discard_remaining_data()
1665 size_t remaining = rfclen + HEADER_PREAMBLE_SIZE(server) - in cifs_discard_remaining_data()
1666 server->total_read; in cifs_discard_remaining_data()
1671 length = cifs_discard_from_socket(server, in cifs_discard_remaining_data()
1673 CIFSMaxBufSize + MAX_HEADER_SIZE(server))); in cifs_discard_remaining_data()
1676 server->total_read += length; in cifs_discard_remaining_data()
1684 __cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid, in __cifs_readv_discard() argument
1689 length = cifs_discard_remaining_data(server); in __cifs_readv_discard()
1691 mid->resp_buf = server->smallbuf; in __cifs_readv_discard()
1692 server->smallbuf = NULL; in __cifs_readv_discard()
1697 cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid) in cifs_readv_discard() argument
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
1710 char *buf = server->smallbuf; in cifs_readv_receive()
1711 unsigned int buflen = server->pdu_size + HEADER_PREAMBLE_SIZE(server); in cifs_readv_receive()
1722 len = min_t(unsigned int, buflen, server->vals->read_rsp_size) - in cifs_readv_receive()
1723 HEADER_SIZE(server) + 1; in cifs_readv_receive()
1725 length = cifs_read_from_socket(server, in cifs_readv_receive()
1726 buf + HEADER_SIZE(server) - 1, len); in cifs_readv_receive()
1729 server->total_read += length; in cifs_readv_receive()
1731 if (server->ops->is_session_expired && in cifs_readv_receive()
1732 server->ops->is_session_expired(buf)) { in cifs_readv_receive()
1733 cifs_reconnect(server, true); in cifs_readv_receive()
1737 if (server->ops->is_status_pending && in cifs_readv_receive()
1738 server->ops->is_status_pending(buf, server)) { in cifs_readv_receive()
1739 cifs_discard_remaining_data(server); in cifs_readv_receive()
1745 rdata->iov[0].iov_len = HEADER_PREAMBLE_SIZE(server); in cifs_readv_receive()
1746 rdata->iov[1].iov_base = buf + HEADER_PREAMBLE_SIZE(server); in cifs_readv_receive()
1748 server->total_read - HEADER_PREAMBLE_SIZE(server); in cifs_readv_receive()
1755 rdata->result = server->ops->map_error(buf, false); in cifs_readv_receive()
1757 cifs_dbg(FYI, "%s: server returned error %d\n", in cifs_readv_receive()
1760 return __cifs_readv_discard(server, mid, false); in cifs_readv_receive()
1764 if (server->total_read < server->vals->read_rsp_size) { in cifs_readv_receive()
1765 cifs_dbg(FYI, "%s: server returned short header. got=%u expected=%zu\n", in cifs_readv_receive()
1766 __func__, server->total_read, in cifs_readv_receive()
1767 server->vals->read_rsp_size); in cifs_readv_receive()
1769 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1772 data_offset = server->ops->read_data_offset(buf) + in cifs_readv_receive()
1773 HEADER_PREAMBLE_SIZE(server); in cifs_readv_receive()
1774 if (data_offset < server->total_read) { in cifs_readv_receive()
1782 data_offset = server->total_read; in cifs_readv_receive()
1788 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1792 __func__, server->total_read, data_offset); in cifs_readv_receive()
1794 len = data_offset - server->total_read; in cifs_readv_receive()
1797 length = cifs_read_from_socket(server, in cifs_readv_receive()
1798 buf + server->total_read, len); in cifs_readv_receive()
1801 server->total_read += length; in cifs_readv_receive()
1808 data_len = server->ops->read_data_length(buf, use_rdma_mr); in cifs_readv_receive()
1812 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1820 length = cifs_read_iter_from_socket(server, &rdata->subreq.io_iter, in cifs_readv_receive()
1824 server->total_read += length; in cifs_readv_receive()
1827 server->total_read, buflen, data_len); in cifs_readv_receive()
1830 if (server->total_read < buflen) in cifs_readv_receive()
1831 return cifs_readv_discard(server, mid); in cifs_readv_receive()
1834 mid->resp_buf = server->smallbuf; in cifs_readv_receive()
1835 server->smallbuf = NULL; in cifs_readv_receive()