Lines Matching full:server

36 change_conf(struct TCP_Server_Info *server)  in change_conf()  argument
38 server->credits += server->echo_credits + server->oplock_credits; in change_conf()
39 if (server->credits > server->max_credits) in change_conf()
40 server->credits = server->max_credits; in change_conf()
41 server->oplock_credits = server->echo_credits = 0; in change_conf()
42 switch (server->credits) { in change_conf()
46 server->echoes = false; in change_conf()
47 server->oplocks = false; in change_conf()
50 server->echoes = true; in change_conf()
51 server->oplocks = false; in change_conf()
52 server->echo_credits = 1; in change_conf()
55 server->echoes = true; in change_conf()
57 server->oplocks = true; in change_conf()
58 server->oplock_credits = 1; in change_conf()
60 server->oplocks = false; in change_conf()
62 server->echo_credits = 1; in change_conf()
64 server->credits -= server->echo_credits + server->oplock_credits; in change_conf()
65 return server->credits + server->echo_credits + server->oplock_credits; in change_conf()
69 smb2_add_credits(struct TCP_Server_Info *server, in smb2_add_credits() argument
79 spin_lock(&server->req_lock); in smb2_add_credits()
80 val = server->ops->get_credits_field(server, optype); in smb2_add_credits()
86 if ((instance == 0) || (instance == server->reconnect_instance)) in smb2_add_credits()
93 pr_warn_once("server overflowed SMB3 credits\n"); in smb2_add_credits()
94 trace_smb3_overflow_credits(server->CurrentMid, in smb2_add_credits()
95 server->conn_id, server->hostname, *val, in smb2_add_credits()
96 add, server->in_flight); in smb2_add_credits()
104 if (WARN_ON_ONCE(server->in_flight == 0)) { in smb2_add_credits()
110 server->credits, server->in_flight, 0, in smb2_add_credits()
113 server->in_flight--; in smb2_add_credits()
114 if (server->in_flight == 0 && in smb2_add_credits()
117 rc = change_conf(server); in smb2_add_credits()
119 * Sometimes server returns 0 credits on oplock break ack - we need to in smb2_add_credits()
122 else if (server->in_flight > 0 && server->oplock_credits == 0 && in smb2_add_credits()
123 server->oplocks) { in smb2_add_credits()
124 if (server->credits > 1) { in smb2_add_credits()
125 server->credits--; in smb2_add_credits()
126 server->oplock_credits++; in smb2_add_credits()
128 } else if ((server->in_flight > 0) && (server->oplock_credits > 3) && in smb2_add_credits()
131 change_conf(server); in smb2_add_credits()
134 in_flight = server->in_flight; in smb2_add_credits()
135 spin_unlock(&server->req_lock); in smb2_add_credits()
136 wake_up(&server->request_q); in smb2_add_credits()
139 trace_smb3_reconnect_detected(server->CurrentMid, in smb2_add_credits()
140 server->conn_id, server->hostname, scredits, add, in_flight); in smb2_add_credits()
142 cifs_dbg(FYI, "trying to put %d credits from the old server instance %d\n", in smb2_add_credits()
147 trace_smb3_reconnect_with_invalid_credits(server->CurrentMid, in smb2_add_credits()
148 server->conn_id, server->hostname, scredits, add, in_flight); in smb2_add_credits()
149 …cifs_dbg(FYI, "Negotiate operation when server credits is non-zero. Optype: %d, server credits: %d… in smb2_add_credits()
153 spin_lock(&server->srv_lock); in smb2_add_credits()
154 if (server->tcpStatus == CifsNeedReconnect in smb2_add_credits()
155 || server->tcpStatus == CifsExiting) { in smb2_add_credits()
156 spin_unlock(&server->srv_lock); in smb2_add_credits()
159 spin_unlock(&server->srv_lock); in smb2_add_credits()
166 cifs_server_dbg(VFS, "Possible client or server bug - zero credits\n"); in smb2_add_credits()
179 trace_smb3_add_credits(server->CurrentMid, in smb2_add_credits()
180 server->conn_id, server->hostname, scredits, add, in_flight); in smb2_add_credits()
185 smb2_set_credits(struct TCP_Server_Info *server, const int val) in smb2_set_credits() argument
189 spin_lock(&server->req_lock); in smb2_set_credits()
190 server->credits = val; in smb2_set_credits()
192 server->reconnect_instance++; in smb2_set_credits()
197 if (SERVER_IS_CHAN(server)) in smb2_set_credits()
198 server->primary_server->channel_sequence_num++; in smb2_set_credits()
200 server->channel_sequence_num++; in smb2_set_credits()
202 scredits = server->credits; in smb2_set_credits()
203 in_flight = server->in_flight; in smb2_set_credits()
204 spin_unlock(&server->req_lock); in smb2_set_credits()
206 trace_smb3_set_credits(server->CurrentMid, in smb2_set_credits()
207 server->conn_id, server->hostname, scredits, val, in_flight); in smb2_set_credits()
216 smb2_get_credits_field(struct TCP_Server_Info *server, const int optype) in smb2_get_credits_field() argument
220 return &server->echo_credits; in smb2_get_credits_field()
222 return &server->oplock_credits; in smb2_get_credits_field()
224 return &server->credits; in smb2_get_credits_field()
235 smb2_wait_mtu_credits(struct TCP_Server_Info *server, size_t size, in smb2_wait_mtu_credits() argument
241 spin_lock(&server->req_lock); in smb2_wait_mtu_credits()
243 spin_unlock(&server->req_lock); in smb2_wait_mtu_credits()
245 spin_lock(&server->srv_lock); in smb2_wait_mtu_credits()
246 if (server->tcpStatus == CifsExiting) { in smb2_wait_mtu_credits()
247 spin_unlock(&server->srv_lock); in smb2_wait_mtu_credits()
250 spin_unlock(&server->srv_lock); in smb2_wait_mtu_credits()
252 spin_lock(&server->req_lock); in smb2_wait_mtu_credits()
253 if (server->credits <= 0) { in smb2_wait_mtu_credits()
254 spin_unlock(&server->req_lock); in smb2_wait_mtu_credits()
255 cifs_num_waiters_inc(server); in smb2_wait_mtu_credits()
256 rc = wait_event_killable(server->request_q, in smb2_wait_mtu_credits()
257 has_credits(server, &server->credits, 1)); in smb2_wait_mtu_credits()
258 cifs_num_waiters_dec(server); in smb2_wait_mtu_credits()
261 spin_lock(&server->req_lock); in smb2_wait_mtu_credits()
263 scredits = server->credits; in smb2_wait_mtu_credits()
279 credits->instance = server->reconnect_instance; in smb2_wait_mtu_credits()
280 server->credits -= credits->value; in smb2_wait_mtu_credits()
281 server->in_flight++; in smb2_wait_mtu_credits()
282 if (server->in_flight > server->max_in_flight) in smb2_wait_mtu_credits()
283 server->max_in_flight = server->in_flight; in smb2_wait_mtu_credits()
287 scredits = server->credits; in smb2_wait_mtu_credits()
288 in_flight = server->in_flight; in smb2_wait_mtu_credits()
289 spin_unlock(&server->req_lock); in smb2_wait_mtu_credits()
291 trace_smb3_wait_credits(server->CurrentMid, in smb2_wait_mtu_credits()
292 server->conn_id, server->hostname, scredits, -(credits->value), in_flight); in smb2_wait_mtu_credits()
300 smb2_adjust_credits(struct TCP_Server_Info *server, in smb2_adjust_credits() argument
316 server->credits, server->in_flight, in smb2_adjust_credits()
319 trace_smb3_too_many_credits(server->CurrentMid, in smb2_adjust_credits()
320 server->conn_id, server->hostname, 0, credits->value - new_val, 0); in smb2_adjust_credits()
328 spin_lock(&server->req_lock); in smb2_adjust_credits()
330 if (server->reconnect_instance != credits->instance) { in smb2_adjust_credits()
331 scredits = server->credits; in smb2_adjust_credits()
332 in_flight = server->in_flight; in smb2_adjust_credits()
333 spin_unlock(&server->req_lock); in smb2_adjust_credits()
338 server->credits, server->in_flight, in smb2_adjust_credits()
341 trace_smb3_reconnect_detected(server->CurrentMid, in smb2_adjust_credits()
342 server->conn_id, server->hostname, scredits, in smb2_adjust_credits()
353 server->credits, server->in_flight, in smb2_adjust_credits()
355 server->credits += credits->value - new_val; in smb2_adjust_credits()
356 scredits = server->credits; in smb2_adjust_credits()
357 in_flight = server->in_flight; in smb2_adjust_credits()
358 spin_unlock(&server->req_lock); in smb2_adjust_credits()
359 wake_up(&server->request_q); in smb2_adjust_credits()
361 trace_smb3_adj_credits(server->CurrentMid, in smb2_adjust_credits()
362 server->conn_id, server->hostname, scredits, in smb2_adjust_credits()
373 smb2_get_next_mid(struct TCP_Server_Info *server) in smb2_get_next_mid() argument
377 spin_lock(&server->mid_lock); in smb2_get_next_mid()
378 mid = server->CurrentMid++; in smb2_get_next_mid()
379 spin_unlock(&server->mid_lock); in smb2_get_next_mid()
384 smb2_revert_current_mid(struct TCP_Server_Info *server, const unsigned int val) in smb2_revert_current_mid() argument
386 spin_lock(&server->mid_lock); in smb2_revert_current_mid()
387 if (server->CurrentMid >= val) in smb2_revert_current_mid()
388 server->CurrentMid -= val; in smb2_revert_current_mid()
389 spin_unlock(&server->mid_lock); in smb2_revert_current_mid()
393 __smb2_find_mid(struct TCP_Server_Info *server, char *buf, bool dequeue) in __smb2_find_mid() argument
404 spin_lock(&server->mid_lock); in __smb2_find_mid()
405 list_for_each_entry(mid, &server->pending_mid_q, qhead) { in __smb2_find_mid()
414 spin_unlock(&server->mid_lock); in __smb2_find_mid()
418 spin_unlock(&server->mid_lock); in __smb2_find_mid()
423 smb2_find_mid(struct TCP_Server_Info *server, char *buf) in smb2_find_mid() argument
425 return __smb2_find_mid(server, buf, false); in smb2_find_mid()
429 smb2_find_dequeue_mid(struct TCP_Server_Info *server, char *buf) in smb2_find_dequeue_mid() argument
431 return __smb2_find_mid(server, buf, true); in smb2_find_dequeue_mid()
435 smb2_dump_detail(void *buf, struct TCP_Server_Info *server) in smb2_dump_detail() argument
443 if (!server->ops->check_message(buf, server->total_read, server)) { in smb2_dump_detail()
445 server->ops->calc_smb_size(buf)); in smb2_dump_detail()
451 smb2_need_neg(struct TCP_Server_Info *server) in smb2_need_neg() argument
453 return server->max_read == 0; in smb2_need_neg()
459 struct TCP_Server_Info *server) in smb2_negotiate() argument
463 spin_lock(&server->mid_lock); in smb2_negotiate()
464 server->CurrentMid = 0; in smb2_negotiate()
465 spin_unlock(&server->mid_lock); in smb2_negotiate()
466 rc = SMB2_negotiate(xid, ses, server); in smb2_negotiate()
476 struct TCP_Server_Info *server = tcon->ses->server; in smb2_negotiate_wsize() local
481 wsize = min_t(unsigned int, wsize, server->max_write); in smb2_negotiate_wsize()
482 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) in smb2_negotiate_wsize()
491 struct TCP_Server_Info *server = tcon->ses->server; in smb3_negotiate_wsize() local
496 wsize = min_t(unsigned int, wsize, server->max_write); in smb3_negotiate_wsize()
498 if (server->rdma) { in smb3_negotiate_wsize()
499 if (server->sign) in smb3_negotiate_wsize()
506 server->smbd_conn->max_fragmented_send_size - in smb3_negotiate_wsize()
511 wsize, server->smbd_conn->max_readwrite_size); in smb3_negotiate_wsize()
514 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) in smb3_negotiate_wsize()
523 struct TCP_Server_Info *server = tcon->ses->server; in smb2_negotiate_rsize() local
528 rsize = min_t(unsigned int, rsize, server->max_read); in smb2_negotiate_rsize()
530 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) in smb2_negotiate_rsize()
539 struct TCP_Server_Info *server = tcon->ses->server; in smb3_negotiate_rsize() local
544 rsize = min_t(unsigned int, rsize, server->max_read); in smb3_negotiate_rsize()
546 if (server->rdma) { in smb3_negotiate_rsize()
547 if (server->sign) in smb3_negotiate_rsize()
554 server->smbd_conn->max_fragmented_recv_size - in smb3_negotiate_rsize()
559 rsize, server->smbd_conn->max_readwrite_size); in smb3_negotiate_rsize()
563 if (!(server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) in smb3_negotiate_rsize()
644 * Samba server e.g. can return an empty interface list in some cases, in parse_server_interfaces()
652 "Empty network interface list returned by server %s\n", in parse_server_interfaces()
653 ses->server->hostname); in parse_server_interfaces()
815 "server does not support query network interfaces\n"); in SMB3_request_interfaces()
828 pserver = ses->chans[0].server; in SMB3_request_interfaces()
1148 struct TCP_Server_Info *server; in smb2_set_ea() local
1170 server = cifs_pick_channel(ses); in smb2_set_ea()
1192 if (ses->server->ops->query_all_EAs) { in smb2_set_ea()
1194 rc = ses->server->ops->query_all_EAs(xid, tcon, path, in smb2_set_ea()
1248 rc = SMB2_open_init(tcon, server, in smb2_set_ea()
1274 rc = SMB2_set_info_init(tcon, server, in smb2_set_ea()
1287 rc = SMB2_close_init(tcon, server, in smb2_set_ea()
1294 smb2_set_replay(server, &rqst[0]); in smb2_set_ea()
1295 smb2_set_replay(server, &rqst[1]); in smb2_set_ea()
1296 smb2_set_replay(server, &rqst[2]); in smb2_set_ea()
1299 rc = compound_send_recv(xid, ses, server, in smb2_set_ea()
1325 smb2_can_echo(struct TCP_Server_Info *server) in smb2_can_echo() argument
1327 return server->echoes; in smb2_can_echo()
1387 seq_printf(m, "\nOpen files: %d total (local), %d open on server", in smb2_print_stats()
1438 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server; in smb2_set_fid() local
1446 server->ops->set_oplock_level(cinode, oplock, fid->epoch, in smb2_set_fid()
1516 pr_warn_once("Server share %s does not support copy range\n", tcon->tree_name); in SMB2_request_res_key()
1545 struct TCP_Server_Info *server; in smb2_ioctl_query_info() local
1568 server = cifs_pick_channel(ses); in smb2_ioctl_query_info()
1587 if (!ses || !server) { in smb2_ioctl_query_info()
1636 rc = SMB2_open_init(tcon, server, in smb2_ioctl_query_info()
1644 /* Can eventually relax perm check since server enforces too */ in smb2_ioctl_query_info()
1652 rc = SMB2_ioctl_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID, in smb2_ioctl_query_info()
1658 /* Can eventually relax perm check since server enforces too */ in smb2_ioctl_query_info()
1674 rc = SMB2_set_info_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID, in smb2_ioctl_query_info()
1682 rc = SMB2_query_info_init(tcon, server, in smb2_ioctl_query_info()
1704 rc = SMB2_close_init(tcon, server, in smb2_ioctl_query_info()
1711 smb2_set_replay(server, &rqst[0]); in smb2_ioctl_query_info()
1712 smb2_set_replay(server, &rqst[1]); in smb2_ioctl_query_info()
1713 smb2_set_replay(server, &rqst[2]); in smb2_ioctl_query_info()
1716 rc = compound_send_recv(xid, ses, server, in smb2_ioctl_query_info()
1804 /* Request a key from the server to identify the source of the copy */ in smb2_copychunk_range()
1830 /* Request server copy to target from src identified by key */ in smb2_copychunk_range()
1850 * Check if server claimed to write more than we asked in smb2_copychunk_range()
1890 * and check if the server gave us different sizes after in smb2_copychunk_range()
1892 * if not then why is the server returning an error now in smb2_copychunk_range()
1897 /* Check that server is not asking us to grow size */ in smb2_copychunk_range()
1903 goto cchunk_out; /* server gave us bogus size */ in smb2_copychunk_range()
1987 * since Samba server doesn't set the flag on the share, yet in smb2_set_sparse()
1990 * mark that server does not support sparse files for this share in smb2_set_sparse()
1991 * to avoid repeatedly sending the unsupported fsctl to server in smb2_set_sparse()
2049 /* server fileays advertise duplicate extent support with this flag */ in smb2_duplicate_extents()
2326 struct TCP_Server_Info *server; in smb2_query_dir_first() local
2333 server = cifs_pick_channel(tcon->ses); in smb2_query_dir_first()
2361 rc = SMB2_open_init(tcon, server, in smb2_query_dir_first()
2375 rc = SMB2_query_directory_init(xid, tcon, server, in smb2_query_dir_first()
2385 smb2_set_replay(server, &rqst[0]); in smb2_query_dir_first()
2386 smb2_set_replay(server, &rqst[1]); in smb2_query_dir_first()
2389 rc = compound_send_recv(xid, tcon->ses, server, in smb2_query_dir_first()
2469 smb2_is_status_pending(char *buf, struct TCP_Server_Info *server) in smb2_is_status_pending() argument
2478 spin_lock(&server->req_lock); in smb2_is_status_pending()
2479 server->credits += le16_to_cpu(shdr->CreditRequest); in smb2_is_status_pending()
2480 scredits = server->credits; in smb2_is_status_pending()
2481 in_flight = server->in_flight; in smb2_is_status_pending()
2482 spin_unlock(&server->req_lock); in smb2_is_status_pending()
2483 wake_up(&server->request_q); in smb2_is_status_pending()
2485 trace_smb3_pend_credits(server->CurrentMid, in smb2_is_status_pending()
2486 server->conn_id, server->hostname, scredits, in smb2_is_status_pending()
2525 smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) in smb2_is_network_name_deleted() argument
2535 /* If server is a channel, select the primary channel */ in smb2_is_network_name_deleted()
2536 pserver = SERVER_IS_CHAN(server) ? server->primary_server : server; in smb2_is_network_name_deleted()
2548 pr_warn_once("Server share %s deleted.\n", in smb2_is_network_name_deleted()
2563 if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING) in smb2_oplock_response()
2572 smb2_set_replay(struct TCP_Server_Info *server, struct smb_rqst *rqst) in smb2_set_replay() argument
2576 if (server->dialect < SMB30_PROT_ID) in smb2_set_replay()
2607 struct TCP_Server_Info *server = ses->server; in smb2_set_next_command() local
2608 unsigned long len = smb_rqst_len(server, rqst); in smb2_set_next_command()
2669 if (tcon->retry || (*pretries)++ < tcon->ses->server->retrans) { in smb2_should_replay()
2693 struct TCP_Server_Info *server; in smb2_query_info_compound() local
2710 server = cifs_pick_channel(ses); in smb2_query_info_compound()
2750 rc = SMB2_open_init(tcon, server, in smb2_query_info_compound()
2760 rc = SMB2_query_info_init(tcon, server, in smb2_query_info_compound()
2768 rc = SMB2_query_info_init(tcon, server, in smb2_query_info_compound()
2786 rc = SMB2_close_init(tcon, server, in smb2_query_info_compound()
2794 smb2_set_replay(server, &rqst[0]); in smb2_query_info_compound()
2795 smb2_set_replay(server, &rqst[2]); in smb2_query_info_compound()
2797 smb2_set_replay(server, &rqst[1]); in smb2_query_info_compound()
2801 rc = compound_send_recv(xid, ses, server, in smb2_query_info_compound()
2805 rc = compound_send_recv(xid, ses, server, in smb2_query_info_compound()
2813 pr_warn_once("server share %s deleted\n", in smb2_query_info_compound()
3212 /* Retrieve an ACL from the server */
3282 * first, otherwise the data may be inconsistent with the server. in smb3_zero_range()
3348 * caches first, otherwise the data may be inconsistent with the server. in smb3_punch_hole()
3771 * might fill holes on the server. in smb3_llseek()
3931 smb2_downgrade_oplock(struct TCP_Server_Info *server, in smb2_downgrade_oplock() argument
3935 server->ops->set_oplock_level(cinode, oplock, 0, NULL); in smb2_downgrade_oplock()
3943 smb3_downgrade_oplock(struct TCP_Server_Info *server, in smb3_downgrade_oplock() argument
4002 /* Check if the server granted an oplock rather than a lease */ in smb21_set_oplock_level()
4282 smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key) in smb2_get_enc_key() argument
4288 /* If server is a channel, select the primary channel */ in smb2_get_enc_key()
4289 pserver = SERVER_IS_CHAN(server) ? server->primary_server : server; in smb2_get_enc_key()
4317 crypt_message(struct TCP_Server_Info *server, int num_rqst, in crypt_message() argument
4333 rc = smb2_get_enc_key(server, le64_to_cpu(tr_hdr->SessionId), enc, key); in crypt_message()
4340 if ((server->cipher_type == SMB2_ENCRYPTION_AES256_CCM) || in crypt_message()
4341 (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM)) in crypt_message()
4367 if ((server->cipher_type == SMB2_ENCRYPTION_AES128_GCM) || in crypt_message()
4368 (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM)) in crypt_message()
4485 smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst, in smb3_init_transform_rq() argument
4498 orig_len += smb_rqst_len(server, old); in smb3_init_transform_rq()
4519 fill_transform_hdr(tr_hdr, orig_len, old_rq, server->cipher_type); in smb3_init_transform_rq()
4521 rc = crypt_message(server, num_rqst, new_rq, 1, server->secmech.enc); in smb3_init_transform_rq()
4542 decrypt_raw_data(struct TCP_Server_Info *server, char *buf, in decrypt_raw_data() argument
4565 if ((server->cipher_type == SMB2_ENCRYPTION_AES128_GCM) || in decrypt_raw_data()
4566 (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM)) in decrypt_raw_data()
4577 if (unlikely(!server->secmech.dec)) in decrypt_raw_data()
4580 tfm = server->secmech.dec; in decrypt_raw_data()
4583 rc = crypt_message(server, 1, &rqst, 0, tfm); in decrypt_raw_data()
4595 server->total_read = buf_data_size + iter_size; in decrypt_raw_data()
4624 handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid, in handle_read_data() argument
4643 if (server->ops->is_session_expired && in handle_read_data()
4644 server->ops->is_session_expired(buf)) { in handle_read_data()
4646 cifs_reconnect(server, true); in handle_read_data()
4650 if (server->ops->is_status_pending && in handle_read_data()
4651 server->ops->is_status_pending(buf, server)) in handle_read_data()
4659 min_t(unsigned int, buf_len, server->vals->read_rsp_size); in handle_read_data()
4665 rdata->result = server->ops->map_error(buf, true); in handle_read_data()
4667 cifs_dbg(FYI, "%s: server returned error %d\n", in handle_read_data()
4677 data_offset = server->ops->read_data_offset(buf); in handle_read_data()
4681 data_len = server->ops->read_data_length(buf, use_rdma_mr); in handle_read_data()
4683 if (data_offset < server->vals->read_rsp_size) { in handle_read_data()
4691 data_offset = server->vals->read_rsp_size; in handle_read_data()
4704 pad_len = data_offset - server->vals->read_rsp_size; in handle_read_data()
4772 struct TCP_Server_Info *server; member
4788 rc = decrypt_raw_data(dw->server, dw->buf, dw->server->vals->read_rsp_size, in smb2_decrypt_offload()
4795 dw->server->lstrp = jiffies; in smb2_decrypt_offload()
4796 mid = smb2_find_dequeue_mid(dw->server, dw->buf); in smb2_decrypt_offload()
4801 rc = handle_read_data(dw->server, mid, dw->buf, in smb2_decrypt_offload()
4802 dw->server->vals->read_rsp_size, in smb2_decrypt_offload()
4809 if (dw->server->ops->is_network_name_deleted) in smb2_decrypt_offload()
4810 dw->server->ops->is_network_name_deleted(dw->buf, in smb2_decrypt_offload()
4811 dw->server); in smb2_decrypt_offload()
4815 spin_lock(&dw->server->srv_lock); in smb2_decrypt_offload()
4816 if (dw->server->tcpStatus == CifsNeedReconnect) { in smb2_decrypt_offload()
4817 spin_lock(&dw->server->mid_lock); in smb2_decrypt_offload()
4819 spin_unlock(&dw->server->mid_lock); in smb2_decrypt_offload()
4820 spin_unlock(&dw->server->srv_lock); in smb2_decrypt_offload()
4823 spin_lock(&dw->server->mid_lock); in smb2_decrypt_offload()
4827 &dw->server->pending_mid_q); in smb2_decrypt_offload()
4828 spin_unlock(&dw->server->mid_lock); in smb2_decrypt_offload()
4829 spin_unlock(&dw->server->srv_lock); in smb2_decrypt_offload()
4843 receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid, in receive_encrypted_read() argument
4846 char *buf = server->smallbuf; in receive_encrypted_read()
4850 unsigned int buflen = server->pdu_size; in receive_encrypted_read()
4858 dw->server = server; in receive_encrypted_read()
4861 len = min_t(unsigned int, buflen, server->vals->read_rsp_size + in receive_encrypted_read()
4862 sizeof(struct smb2_transform_hdr)) - HEADER_SIZE(server) + 1; in receive_encrypted_read()
4864 rc = cifs_read_from_socket(server, buf + HEADER_SIZE(server) - 1, len); in receive_encrypted_read()
4867 server->total_read += rc; in receive_encrypted_read()
4870 server->vals->read_rsp_size; in receive_encrypted_read()
4882 rc = cifs_read_iter_from_socket(server, &iter, dw->len); in receive_encrypted_read()
4886 server->total_read += rc; in receive_encrypted_read()
4895 rc = cifs_discard_remaining_data(server); in receive_encrypted_read()
4904 if ((server->min_offload) && (server->in_flight > 1) && in receive_encrypted_read()
4905 (server->pdu_size >= server->min_offload)) { in receive_encrypted_read()
4906 dw->buf = server->smallbuf; in receive_encrypted_read()
4907 server->smallbuf = (char *)cifs_small_buf_get(); in receive_encrypted_read()
4914 rc = decrypt_raw_data(server, buf, server->vals->read_rsp_size, in receive_encrypted_read()
4919 *mid = smb2_find_mid(server, buf); in receive_encrypted_read()
4925 rc = handle_read_data(server, *mid, buf, in receive_encrypted_read()
4926 server->vals->read_rsp_size, in receive_encrypted_read()
4929 if (server->ops->is_network_name_deleted) { in receive_encrypted_read()
4930 server->ops->is_network_name_deleted(buf, in receive_encrypted_read()
4931 server); in receive_encrypted_read()
4942 cifs_discard_remaining_data(server); in receive_encrypted_read()
4947 receive_encrypted_standard(struct TCP_Server_Info *server, in receive_encrypted_standard() argument
4952 char *buf = server->smallbuf; in receive_encrypted_standard()
4954 unsigned int pdu_length = server->pdu_size; in receive_encrypted_standard()
4965 server->large_buf = true; in receive_encrypted_standard()
4966 memcpy(server->bigbuf, buf, server->total_read); in receive_encrypted_standard()
4967 buf = server->bigbuf; in receive_encrypted_standard()
4971 length = cifs_read_from_socket(server, buf + HEADER_SIZE(server) - 1, in receive_encrypted_standard()
4972 pdu_length - HEADER_SIZE(server) + 1); in receive_encrypted_standard()
4975 server->total_read += length; in receive_encrypted_standard()
4978 length = decrypt_raw_data(server, buf, buf_size, NULL, false); in receive_encrypted_standard()
4982 next_is_large = server->large_buf; in receive_encrypted_standard()
4996 mid_entry = smb2_find_mid(server, buf); in receive_encrypted_standard()
5002 mid_entry->resp_buf_size = server->pdu_size; in receive_encrypted_standard()
5013 ret = mid_entry->handle(server, mid_entry); in receive_encrypted_standard()
5015 ret = cifs_handle_standard(server, mid_entry); in receive_encrypted_standard()
5019 server->large_buf = next_is_large; in receive_encrypted_standard()
5021 server->bigbuf = buf = next_buffer; in receive_encrypted_standard()
5023 server->smallbuf = buf = next_buffer; in receive_encrypted_standard()
5028 * server->smallbuf and server->bigbuf are still valid. We need in receive_encrypted_standard()
5042 smb3_receive_transform(struct TCP_Server_Info *server, in smb3_receive_transform() argument
5045 char *buf = server->smallbuf; in smb3_receive_transform()
5046 unsigned int pdu_length = server->pdu_size; in smb3_receive_transform()
5054 cifs_reconnect(server, true); in smb3_receive_transform()
5060 cifs_reconnect(server, true); in smb3_receive_transform()
5065 if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server)) { in smb3_receive_transform()
5066 return receive_encrypted_read(server, &mids[0], num_mids); in smb3_receive_transform()
5069 return receive_encrypted_standard(server, mids, bufs, num_mids); in smb3_receive_transform()
5073 smb3_handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid) in smb3_handle_read_data() argument
5075 char *buf = server->large_buf ? server->bigbuf : server->smallbuf; in smb3_handle_read_data()
5077 return handle_read_data(server, mid, buf, server->pdu_size, in smb3_handle_read_data()
5081 static int smb2_next_header(struct TCP_Server_Info *server, char *buf, in smb2_next_header() argument
5094 if (unlikely(*noff && *noff < MID_HEADER_SIZE(server))) in smb2_next_header()
5104 struct TCP_Server_Info *server = tcon->ses->server; in __cifs_sfu_make_node() local
5120 __u32 oplock = server->oplocks ? REQ_OPLOCK : 0; in __cifs_sfu_make_node()
5175 rc = server->ops->open(xid, &oparms, &oplock, NULL); in __cifs_sfu_make_node()
5188 rc = server->ops->sync_write(xid, &fid, &io_parms, in __cifs_sfu_make_node()
5193 server->ops->close(xid, tcon, &fid); in __cifs_sfu_make_node()