Lines Matching full:tcon
76 int smb3_encryption_required(const struct cifs_tcon *tcon) in smb3_encryption_required() argument
78 if (!tcon || !tcon->ses) in smb3_encryption_required()
80 if ((tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || in smb3_encryption_required()
81 (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)) in smb3_encryption_required()
83 if (tcon->seal && in smb3_encryption_required()
84 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION)) in smb3_encryption_required()
87 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION)) in smb3_encryption_required()
94 const struct cifs_tcon *tcon, in smb2_hdr_assemble() argument
132 if (!tcon) in smb2_hdr_assemble()
141 shdr->Id.SyncId.TreeId = cpu_to_le32(tcon->tid); in smb2_hdr_assemble()
143 if (tcon->ses) in smb2_hdr_assemble()
144 shdr->SessionId = cpu_to_le64(tcon->ses->Suid); in smb2_hdr_assemble()
156 /* if (tcon->share_flags & SHI1005_FLAGS_DFS) in smb2_hdr_assemble()
159 if (server && server->sign && !smb3_encryption_required(tcon)) in smb2_hdr_assemble()
216 smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon, in smb2_reconnect() argument
225 * SMB2s NegProt, SessSetup, Logoff do not have tcon yet so in smb2_reconnect()
229 if (tcon == NULL) in smb2_reconnect()
239 spin_lock(&tcon->tc_lock); in smb2_reconnect()
240 if (tcon->status == TID_EXITING) { in smb2_reconnect()
245 spin_unlock(&tcon->tc_lock); in smb2_reconnect()
251 spin_unlock(&tcon->tc_lock); in smb2_reconnect()
253 ses = tcon->ses; in smb2_reconnect()
292 rc = cifs_wait_for_server_reconnect(server, tcon->retry); in smb2_reconnect()
297 if (!cifs_chan_needs_reconnect(ses, server) && !tcon->need_reconnect) { in smb2_reconnect()
302 cifs_dbg(FYI, "sess reconnect mask: 0x%lx, tcon reconnect: %d", in smb2_reconnect()
303 tcon->ses->chans_need_reconnect, in smb2_reconnect()
304 tcon->need_reconnect); in smb2_reconnect()
329 if (tcon->retry) in smb2_reconnect()
350 if (tcon->need_reconnect) in smb2_reconnect()
387 if ((rc == -EACCES) && !tcon->retry) { in smb2_reconnect()
401 if (!tcon->need_reconnect) { in smb2_reconnect()
405 cifs_mark_open_files_invalid(tcon); in smb2_reconnect()
406 if (tcon->use_persistent) in smb2_reconnect()
407 tcon->need_reopen_files = true; in smb2_reconnect()
409 rc = cifs_tree_connect(0, tcon, nls_codepage); in smb2_reconnect()
411 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); in smb2_reconnect()
413 /* If sess reconnected but tcon didn't, something strange ... */ in smb2_reconnect()
415 cifs_dbg(VFS, "reconnect tcon failed rc = %d\n", rc); in smb2_reconnect()
437 rc = server->ops->query_server_interfaces(xid, tcon, false); in smb2_reconnect()
460 queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, in smb2_reconnect()
504 fill_small_buf(__le16 smb2_command, struct cifs_tcon *tcon, in fill_small_buf() argument
519 smb2_hdr_assemble(&spdu->hdr, smb2_command, tcon, server); in fill_small_buf()
530 static int __smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon, in __smb2_plain_req_init() argument
549 fill_small_buf(smb2_command, tcon, server, in __smb2_plain_req_init()
553 if (tcon != NULL) { in __smb2_plain_req_init()
555 cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_sent[com_code]); in __smb2_plain_req_init()
556 cifs_stats_inc(&tcon->num_smbs_sent); in __smb2_plain_req_init()
562 static int smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon, in smb2_plain_req_init() argument
568 rc = smb2_reconnect(smb2_command, tcon, server, false); in smb2_plain_req_init()
572 return __smb2_plain_req_init(smb2_command, tcon, server, request_buf, in smb2_plain_req_init()
576 static int smb2_ioctl_req_init(u32 opcode, struct cifs_tcon *tcon, in smb2_ioctl_req_init() argument
582 return __smb2_plain_req_init(SMB2_IOCTL, tcon, server, in smb2_ioctl_req_init()
585 return smb2_plain_req_init(SMB2_IOCTL, tcon, server, in smb2_ioctl_req_init()
1139 * No tcon so can't do in SMB2_negotiate()
1140 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]); in SMB2_negotiate()
1284 int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) in smb3_validate_negotiate() argument
1291 struct TCP_Server_Info *server = tcon->ses->server; in smb3_validate_negotiate()
1306 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) in smb3_validate_negotiate()
1309 if (tcon->ses->user_name == NULL) { in smb3_validate_negotiate()
1314 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) in smb3_validate_negotiate()
1323 if (tcon->ses->chan_max > 1) in smb3_validate_negotiate()
1329 if (tcon->ses->sign) in smb3_validate_negotiate()
1367 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, in smb3_validate_negotiate()
1995 /* since no tcon, smb2_init can not do this, so do here */ in SMB2_logoff()
2016 * No tcon so can't do in SMB2_logoff()
2017 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]); in SMB2_logoff()
2024 static inline void cifs_stats_fail_inc(struct cifs_tcon *tcon, uint16_t code) in cifs_stats_fail_inc() argument
2026 cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_failed[code]); in cifs_stats_fail_inc()
2032 static inline void init_copy_chunk_defaults(struct cifs_tcon *tcon) in init_copy_chunk_defaults() argument
2034 tcon->max_chunks = 256; in init_copy_chunk_defaults()
2035 tcon->max_bytes_chunk = 1048576; in init_copy_chunk_defaults()
2036 tcon->max_bytes_copy = 16777216; in init_copy_chunk_defaults()
2041 struct cifs_tcon *tcon, const struct nls_table *cp) in SMB2_tcon() argument
2056 cifs_dbg(FYI, "TCON\n"); in SMB2_tcon()
2073 tcon->tid = 0; in SMB2_tcon()
2074 atomic_set(&tcon->num_remote_opens, 0); in SMB2_tcon()
2075 rc = smb2_plain_req_init(SMB2_TREE_CONNECT, tcon, server, in SMB2_tcon()
2082 if (smb3_encryption_required(tcon)) in SMB2_tcon()
2096 * 3.11 tcon req must be signed if not encrypted. See MS-SMB2 3.2.4.1.1 in SMB2_tcon()
2101 !smb3_encryption_required(tcon) && in SMB2_tcon()
2123 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc); in SMB2_tcon()
2125 cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE); in SMB2_tcon()
2126 tcon->need_reconnect = true; in SMB2_tcon()
2135 tcon->pipe = true; in SMB2_tcon()
2139 tcon->print = true; in SMB2_tcon()
2148 tcon->share_flags = le32_to_cpu(rsp->ShareFlags); in SMB2_tcon()
2149 tcon->capabilities = rsp->Capabilities; /* we keep caps little endian */ in SMB2_tcon()
2150 tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess); in SMB2_tcon()
2151 tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId); in SMB2_tcon()
2152 strscpy(tcon->tree_name, tree, sizeof(tcon->tree_name)); in SMB2_tcon()
2155 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) in SMB2_tcon()
2158 if (tcon->seal && in SMB2_tcon()
2162 init_copy_chunk_defaults(tcon); in SMB2_tcon()
2164 rc = server->ops->validate_negotiate(xid, tcon); in SMB2_tcon()
2166 if (tcon->share_flags & SMB2_SHAREFLAG_ISOLATED_TRANSPORT) in SMB2_tcon()
2181 SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) in SMB2_tdis() argument
2186 struct cifs_ses *ses = tcon->ses; in SMB2_tdis()
2199 trace_smb3_tdis_enter(xid, tcon->tid, ses->Suid, tcon->tree_name); in SMB2_tdis()
2201 if ((tcon->need_reconnect) || in SMB2_tdis()
2202 (CIFS_ALL_CHANS_NEED_RECONNECT(tcon->ses))) { in SMB2_tdis()
2208 invalidate_all_cached_dirs(tcon); in SMB2_tdis()
2210 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, server, in SMB2_tdis()
2216 if (smb3_encryption_required(tcon)) in SMB2_tdis()
2232 cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE); in SMB2_tdis()
2233 trace_smb3_tdis_err(xid, tcon->tid, ses->Suid, rc); in SMB2_tdis()
2235 trace_smb3_tdis_done(xid, tcon->tid, ses->Suid); in SMB2_tdis()
2454 buf->dcontext.Timeout = cpu_to_le32(oparms->tcon->handle_timeout); in create_durable_v2_buf()
2825 umode_t mode, struct cifs_tcon *tcon, in smb311_posix_mkdir() argument
2832 struct cifs_ses *ses = tcon->ses; in smb311_posix_mkdir()
2868 rc = smb2_plain_req_init(SMB2_CREATE, tcon, server, in smb311_posix_mkdir()
2874 if (smb3_encryption_required(tcon)) in smb311_posix_mkdir()
2899 if (tcon->share_flags & SHI1005_FLAGS_DFS) { in smb311_posix_mkdir()
2905 tcon->tree_name, utf16_path); in smb311_posix_mkdir()
2938 if (tcon->posix_extensions) { in smb311_posix_mkdir()
2955 trace_smb3_posix_mkdir_enter(xid, tcon->tid, ses->Suid, full_path, CREATE_NOT_FILE, in smb311_posix_mkdir()
2965 cifs_stats_fail_inc(tcon, SMB2_CREATE_HE); in smb311_posix_mkdir()
2966 trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid, in smb311_posix_mkdir()
2984 trace_smb3_posix_mkdir_done(xid, rsp->PersistentFileId, tcon->tid, ses->Suid, in smb311_posix_mkdir()
2987 SMB2_close(xid, tcon, rsp->PersistentFileId, rsp->VolatileFileId); in smb311_posix_mkdir()
3000 smb2_should_replay(tcon, &retries, &cur_sleep)) in smb311_posix_mkdir()
3007 SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_open_init() argument
3021 rc = smb2_plain_req_init(SMB2_CREATE, tcon, server, in SMB2_open_init()
3053 if (tcon->share_flags & SHI1005_FLAGS_DFS) { in SMB2_open_init()
3059 tcon->tree_name, path); in SMB2_open_init()
3082 if ((!server->oplocks) || (tcon->no_lease)) in SMB2_open_init()
3100 tcon->use_persistent); in SMB2_open_init()
3105 if (tcon->posix_extensions) { in SMB2_open_init()
3111 if (tcon->snapshot_time) { in SMB2_open_init()
3113 rc = add_twarp_context(iov, &n_iov, tcon->snapshot_time); in SMB2_open_init()
3197 struct cifs_tcon *tcon = oparms->tcon; in SMB2_open() local
3198 struct cifs_ses *ses = tcon->ses; in SMB2_open()
3217 if (smb3_encryption_required(tcon)) in SMB2_open()
3225 rc = SMB2_open_init(tcon, server, in SMB2_open()
3230 trace_smb3_open_enter(xid, tcon->tid, tcon->ses->Suid, oparms->path, in SMB2_open()
3242 cifs_stats_fail_inc(tcon, SMB2_CREATE_HE); in SMB2_open()
3249 trace_smb3_open_err(xid, tcon->tid, ses->Suid, in SMB2_open()
3253 tcon->tree_name); in SMB2_open()
3254 tcon->need_reconnect = true; in SMB2_open()
3260 trace_smb3_open_done(xid, rsp->PersistentFileId, tcon->tid, ses->Suid, in SMB2_open()
3263 atomic_inc(&tcon->num_remote_opens); in SMB2_open()
3291 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_open()
3298 SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_ioctl_init() argument
3310 rc = smb2_ioctl_req_init(opcode, tcon, server, in SMB2_ioctl_init()
3318 if (WARN_ON_ONCE(smb3_encryption_required(tcon) && in SMB2_ioctl_init()
3413 SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, in SMB2_ioctl() argument
3429 if (!tcon) in SMB2_ioctl()
3432 ses = tcon->ses; in SMB2_ioctl()
3453 if (smb3_encryption_required(tcon)) in SMB2_ioctl()
3461 rc = SMB2_ioctl_init(tcon, server, in SMB2_ioctl()
3476 trace_smb3_fsctl_err(xid, persistent_fid, tcon->tid, in SMB2_ioctl()
3480 cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); in SMB2_ioctl()
3485 cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); in SMB2_ioctl()
3490 cifs_stats_fail_inc(tcon, SMB2_IOCTL_HE); in SMB2_ioctl()
3541 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_ioctl()
3552 SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_set_compression() argument
3562 rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid, in SMB2_set_compression()
3574 SMB2_close_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_close_init() argument
3583 rc = smb2_plain_req_init(SMB2_CLOSE, tcon, server, in SMB2_close_init()
3608 __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, in __SMB2_close() argument
3614 struct cifs_ses *ses = tcon->ses; in __SMB2_close()
3635 if (smb3_encryption_required(tcon)) in __SMB2_close()
3647 trace_smb3_close_enter(xid, persistent_fid, tcon->tid, ses->Suid); in __SMB2_close()
3648 rc = SMB2_close_init(tcon, server, in __SMB2_close()
3662 cifs_stats_fail_inc(tcon, SMB2_CLOSE_HE); in __SMB2_close()
3663 trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid, in __SMB2_close()
3667 trace_smb3_close_done(xid, persistent_fid, tcon->tid, in __SMB2_close()
3673 atomic_dec(&tcon->num_remote_opens); in __SMB2_close()
3684 tmp_rc = smb2_handle_cancelled_close(tcon, persistent_fid, in __SMB2_close()
3692 smb2_should_replay(tcon, &retries, &cur_sleep)) in __SMB2_close()
3699 SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_close() argument
3702 return __SMB2_close(xid, tcon, persistent_fid, volatile_fid, NULL); in SMB2_close()
3761 SMB2_query_info_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_query_info_init() argument
3777 rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, server, in SMB2_query_info_init()
3810 query_info(const unsigned int xid, struct cifs_tcon *tcon, in query_info() argument
3821 struct cifs_ses *ses = tcon->ses; in query_info()
3841 if (smb3_encryption_required(tcon)) in query_info()
3849 rc = SMB2_query_info_init(tcon, server, in query_info()
3856 trace_smb3_query_info_enter(xid, persistent_fid, tcon->tid, in query_info()
3867 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); in query_info()
3868 trace_smb3_query_info_err(xid, persistent_fid, tcon->tid, in query_info()
3873 trace_smb3_query_info_done(xid, persistent_fid, tcon->tid, in query_info()
3906 smb2_should_replay(tcon, &retries, &cur_sleep)) in query_info()
3912 int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_query_info() argument
3915 return query_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_query_info()
3925 SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
3932 return query_info(xid, tcon, persistent_fid, volatile_fid,
3940 SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_query_acl() argument
3948 return query_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_query_acl()
3954 SMB2_get_srv_num(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_get_srv_num() argument
3957 return query_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_get_srv_num()
3971 struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_notify_init() argument
3980 rc = smb2_plain_req_init(SMB2_CHANGE_NOTIFY, tcon, server, in SMB2_notify_init()
4003 SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_change_notify() argument
4008 struct cifs_ses *ses = tcon->ses; in SMB2_change_notify()
4028 if (smb3_encryption_required(tcon)) in SMB2_change_notify()
4039 rc = SMB2_notify_init(xid, &rqst, tcon, server, in SMB2_change_notify()
4045 trace_smb3_notify_enter(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
4055 cifs_stats_fail_inc(tcon, SMB2_CHANGE_NOTIFY_HE); in SMB2_change_notify()
4056 trace_smb3_notify_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
4059 trace_smb3_notify_done(xid, persistent_fid, tcon->tid, in SMB2_change_notify()
4087 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_change_notify()
4125 struct cifs_tcon *tcon, *tcon2; in smb2_reconnect_server() local
4144 /* Prevent simultaneous reconnects that can corrupt tcon->rlist list */ in smb2_reconnect_server()
4169 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in smb2_reconnect_server()
4170 if (tcon->need_reconnect || tcon->need_reopen_files) { in smb2_reconnect_server()
4171 tcon->tc_count++; in smb2_reconnect_server()
4172 trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, in smb2_reconnect_server()
4174 list_add_tail(&tcon->rlist, &tmp_list); in smb2_reconnect_server()
4189 * binding session, but tcon is healthy (some other channel in smb2_reconnect_server()
4202 list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) { in smb2_reconnect_server()
4203 rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true); in smb2_reconnect_server()
4205 cifs_reopen_persistent_handles(tcon); in smb2_reconnect_server()
4208 list_del_init(&tcon->rlist); in smb2_reconnect_server()
4209 if (tcon->ipc) in smb2_reconnect_server()
4210 cifs_put_smb_ses(tcon->ses); in smb2_reconnect_server()
4212 cifs_put_tcon(tcon, netfs_trace_tcon_ref_put_reconnect_server); in smb2_reconnect_server()
4218 /* allocate a dummy tcon struct used for reconnect */ in smb2_reconnect_server()
4219 tcon = tcon_info_alloc(false, netfs_trace_tcon_ref_new_reconnect_server); in smb2_reconnect_server()
4220 if (!tcon) { in smb2_reconnect_server()
4229 tcon->status = TID_GOOD; in smb2_reconnect_server()
4230 tcon->retry = false; in smb2_reconnect_server()
4231 tcon->need_reconnect = false; in smb2_reconnect_server()
4235 tcon->ses = ses; in smb2_reconnect_server()
4236 rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true); in smb2_reconnect_server()
4242 tconInfoFree(tcon, netfs_trace_tcon_ref_free_reconnect_server); in smb2_reconnect_server()
4304 struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_flush_init() argument
4312 rc = smb2_plain_req_init(SMB2_FLUSH, tcon, server, in SMB2_flush_init()
4327 SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, in SMB2_flush() argument
4330 struct cifs_ses *ses = tcon->ses; in SMB2_flush()
4349 if (smb3_encryption_required(tcon)) in SMB2_flush()
4357 rc = SMB2_flush_init(xid, &rqst, tcon, server, in SMB2_flush()
4362 trace_smb3_flush_enter(xid, persistent_fid, tcon->tid, ses->Suid); in SMB2_flush()
4371 cifs_stats_fail_inc(tcon, SMB2_FLUSH_HE); in SMB2_flush()
4372 trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_flush()
4375 trace_smb3_flush_done(xid, persistent_fid, tcon->tid, in SMB2_flush()
4383 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_flush()
4393 struct cifs_tcon *tcon = io_parms->tcon; in smb3_use_rdma_offload() local
4396 if (!server || !tcon) in smb3_use_rdma_offload()
4408 if (smb3_encryption_required(tcon)) in smb3_use_rdma_offload()
4433 rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, server, in smb2_new_read_req()
4457 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in smb2_new_read_req()
4529 struct cifs_tcon *tcon = tlink_tcon(rdata->req->cfile->tlink); in smb2_readv_callback() local
4571 cifs_stats_bytes_read(tcon, rdata->got_bytes); in smb2_readv_callback()
4582 cifs_stats_bytes_read(tcon, rdata->got_bytes); in smb2_readv_callback()
4603 cifs_stats_fail_inc(tcon, SMB2_READ_HE); in smb2_readv_callback()
4608 tcon->tid, tcon->ses->Suid, in smb2_readv_callback()
4617 tcon->tid, tcon->ses->Suid, in smb2_readv_callback()
4659 struct cifs_tcon *tcon = tlink_tcon(rdata->req->cfile->tlink); in smb2_async_readv() local
4667 rdata->server = cifs_pick_channel(tcon->ses); in smb2_async_readv()
4669 io_parms.tcon = tlink_tcon(rdata->req->cfile->tlink); in smb2_async_readv()
4682 if (smb3_encryption_required(io_parms.tcon)) in smb2_async_readv()
4715 cifs_stats_fail_inc(io_parms.tcon, SMB2_READ_HE); in smb2_async_readv()
4719 io_parms.tcon->tid, in smb2_async_readv()
4720 io_parms.tcon->ses->Suid, in smb2_async_readv()
4742 struct cifs_ses *ses = io_parms->tcon->ses; in SMB2_read()
4745 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_read()
4752 if (smb3_encryption_required(io_parms->tcon)) in SMB2_read()
4768 cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE); in SMB2_read()
4772 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4777 req->PersistentFileId, io_parms->tcon->tid, in SMB2_read()
4785 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4820 struct cifs_tcon *tcon = tlink_tcon(wdata->req->cfile->tlink); in smb2_writev_callback() local
4887 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE); in smb2_writev_callback()
4892 tcon->tid, tcon->ses->Suid, wdata->subreq.start, in smb2_writev_callback()
4896 tcon->tree_name); in smb2_writev_callback()
4902 tcon->tid, tcon->ses->Suid, in smb2_writev_callback()
4925 struct cifs_tcon *tcon = tlink_tcon(wdata->req->cfile->tlink); in smb2_async_writev() local
4939 .tcon = tcon, in smb2_async_writev()
4949 rc = smb2_plain_req_init(SMB2_WRITE, tcon, server, in smb2_async_writev()
4961 if (smb3_encryption_required(tcon)) in smb2_async_writev()
4982 io_parms->tcon->tid, in smb2_async_writev()
4983 io_parms->tcon->ses->Suid, in smb2_async_writev()
5053 if (((flags & CIFS_TRANSFORM_REQ) != CIFS_TRANSFORM_REQ) && should_compress(tcon, &rqst)) in smb2_async_writev()
5064 io_parms->tcon->tid, in smb2_async_writev()
5065 io_parms->tcon->ses->Suid, in smb2_async_writev()
5069 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE); in smb2_async_writev()
5113 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_write()
5121 rc = smb2_plain_req_init(SMB2_WRITE, io_parms->tcon, server, in SMB2_write()
5126 if (smb3_encryption_required(io_parms->tcon)) in SMB2_write()
5143 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in SMB2_write()
5157 rc = cifs_send_recv(xid, io_parms->tcon->ses, server, in SMB2_write()
5165 io_parms->tcon->tid, in SMB2_write()
5166 io_parms->tcon->ses->Suid, in SMB2_write()
5168 cifs_stats_fail_inc(io_parms->tcon, SMB2_WRITE_HE); in SMB2_write()
5174 io_parms->tcon->tid, in SMB2_write()
5175 io_parms->tcon->ses->Suid, in SMB2_write()
5183 smb2_should_replay(io_parms->tcon, &retries, &cur_sleep)) in SMB2_write()
5337 struct cifs_tcon *tcon, in SMB2_query_directory_init() argument
5353 rc = smb2_plain_req_init(SMB2_QUERY_DIRECTORY, tcon, server, in SMB2_query_directory_init()
5403 trace_smb3_query_dir_enter(xid, persistent_fid, tcon->tid, in SMB2_query_directory_init()
5404 tcon->ses->Suid, index, output_size); in SMB2_query_directory_init()
5417 smb2_parse_query_directory(struct cifs_tcon *tcon, in smb2_parse_query_directory() argument
5492 SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_query_directory() argument
5502 struct cifs_ses *ses = tcon->ses; in SMB2_query_directory()
5515 if (smb3_encryption_required(tcon)) in SMB2_query_directory()
5523 rc = SMB2_query_directory_init(xid, tcon, server, in SMB2_query_directory()
5541 tcon->tid, tcon->ses->Suid, index, 0); in SMB2_query_directory()
5545 trace_smb3_query_dir_err(xid, persistent_fid, tcon->tid, in SMB2_query_directory()
5546 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
5547 cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE); in SMB2_query_directory()
5552 rc = smb2_parse_query_directory(tcon, &rsp_iov, resp_buftype, in SMB2_query_directory()
5555 trace_smb3_query_dir_err(xid, persistent_fid, tcon->tid, in SMB2_query_directory()
5556 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
5561 trace_smb3_query_dir_done(xid, persistent_fid, tcon->tid, in SMB2_query_directory()
5562 tcon->ses->Suid, index, srch_inf->entries_in_buffer); in SMB2_query_directory()
5569 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_query_directory()
5576 SMB2_set_info_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, in SMB2_set_info_init() argument
5587 rc = smb2_plain_req_init(SMB2_SET_INFO, tcon, server, in SMB2_set_info_init()
5626 send_set_info(const unsigned int xid, struct cifs_tcon *tcon, in send_set_info() argument
5637 struct cifs_ses *ses = tcon->ses; in send_set_info()
5653 if (smb3_encryption_required(tcon)) in send_set_info()
5664 rc = SMB2_set_info_init(tcon, server, in send_set_info()
5683 cifs_stats_fail_inc(tcon, SMB2_SET_INFO_HE); in send_set_info()
5684 trace_smb3_set_info_err(xid, persistent_fid, tcon->tid, in send_set_info()
5692 smb2_should_replay(tcon, &retries, &cur_sleep)) in send_set_info()
5699 SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, in SMB2_set_eof() argument
5711 trace_smb3_set_eof(xid, persistent_fid, tcon->tid, tcon->ses->Suid, new_eof); in SMB2_set_eof()
5713 return send_set_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_set_eof()
5719 SMB2_set_acl(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_set_acl() argument
5723 return send_set_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_set_acl()
5729 SMB2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_set_ea() argument
5733 return send_set_info(xid, tcon, persistent_fid, volatile_fid, in SMB2_set_ea()
5739 SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_oplock_break() argument
5746 struct cifs_ses *ses = tcon->ses; in SMB2_oplock_break()
5761 rc = smb2_plain_req_init(SMB2_OPLOCK_BREAK, tcon, server, in SMB2_oplock_break()
5766 if (smb3_encryption_required(tcon)) in SMB2_oplock_break()
5790 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); in SMB2_oplock_break()
5795 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_oplock_break()
5833 build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, in build_qfs_info_req() argument
5844 if ((tcon->ses == NULL) || server == NULL) in build_qfs_info_req()
5847 rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, server, in build_qfs_info_req()
5873 SMB311_posix_qfs_info(const unsigned int xid, struct cifs_tcon *tcon, in SMB311_posix_qfs_info() argument
5882 struct cifs_ses *ses = tcon->ses; in SMB311_posix_qfs_info()
5893 rc = build_qfs_info_req(&iov, tcon, server, in SMB311_posix_qfs_info()
5900 if (smb3_encryption_required(tcon)) in SMB311_posix_qfs_info()
5914 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); in SMB311_posix_qfs_info()
5931 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB311_posix_qfs_info()
5938 SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_QFS_info() argument
5947 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_info()
5958 rc = build_qfs_info_req(&iov, tcon, server, in SMB2_QFS_info()
5965 if (smb3_encryption_required(tcon)) in SMB2_QFS_info()
5979 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); in SMB2_QFS_info()
5996 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_QFS_info()
6003 SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_QFS_attr() argument
6012 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_attr()
6040 rc = build_qfs_info_req(&iov, tcon, server, in SMB2_QFS_attr()
6046 if (smb3_encryption_required(tcon)) in SMB2_QFS_attr()
6060 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE); in SMB2_QFS_attr()
6072 memcpy(&tcon->fsAttrInfo, offset in SMB2_QFS_attr()
6076 memcpy(&tcon->fsDevInfo, offset in SMB2_QFS_attr()
6081 tcon->ss_flags = le32_to_cpu(ss_info->Flags); in SMB2_QFS_attr()
6082 tcon->perf_sector_size = in SMB2_QFS_attr()
6087 tcon->vol_serial_number = vol_info->VolumeSerialNumber; in SMB2_QFS_attr()
6088 tcon->vol_create_time = vol_info->VolumeCreationTime; in SMB2_QFS_attr()
6095 smb2_should_replay(tcon, &retries, &cur_sleep)) in SMB2_QFS_attr()
6102 smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, in smb2_lockv() argument
6121 server = cifs_pick_channel(tcon->ses); in smb2_lockv()
6125 rc = smb2_plain_req_init(SMB2_LOCK, tcon, server, in smb2_lockv()
6130 if (smb3_encryption_required(tcon)) in smb2_lockv()
6146 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); in smb2_lockv()
6155 rc = cifs_send_recv(xid, tcon->ses, server, in smb2_lockv()
6161 cifs_stats_fail_inc(tcon, SMB2_LOCK_HE); in smb2_lockv()
6162 trace_smb3_lock_err(xid, persist_fid, tcon->tid, in smb2_lockv()
6163 tcon->ses->Suid, rc); in smb2_lockv()
6167 smb2_should_replay(tcon, &retries, &cur_sleep)) in smb2_lockv()
6174 SMB2_lock(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_lock() argument
6187 return smb2_lockv(xid, tcon, persist_fid, volatile_fid, pid, 1, &lock); in SMB2_lock()
6191 SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, in SMB2_lease_break() argument
6197 struct cifs_ses *ses = tcon->ses; in SMB2_lease_break()
6205 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in SMB2_lease_break()
6208 rc = smb2_plain_req_init(SMB2_OPLOCK_BREAK, tcon, server, in SMB2_lease_break()
6213 if (smb3_encryption_required(tcon)) in SMB2_lease_break()
6239 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE); in SMB2_lease_break()
6240 trace_smb3_lease_err(le32_to_cpu(lease_state), tcon->tid, in SMB2_lease_break()
6244 trace_smb3_lease_done(le32_to_cpu(lease_state), tcon->tid, in SMB2_lease_break()