Lines Matching refs:tcon

399 	struct cifs_tcon *tcon;  in super_cb()  local
405 tcon = cifs_sb_master_tcon(cifs_sb); in super_cb()
406 if (tcon->ses->server == d->server) in super_cb()
479 struct cifs_tcon *tcon; in cifs_reconnect() local
534 tcon = list_entry(tmp2, struct cifs_tcon, tcon_list); in cifs_reconnect()
535 tcon->need_reconnect = true; in cifs_reconnect()
2902 struct cifs_tcon *tcon; in cifs_setup_ipc() local
2922 tcon = tconInfoAlloc(); in cifs_setup_ipc()
2923 if (tcon == NULL) in cifs_setup_ipc()
2932 tcon->ses = ses; in cifs_setup_ipc()
2933 tcon->ipc = true; in cifs_setup_ipc()
2934 tcon->seal = seal; in cifs_setup_ipc()
2935 rc = server->ops->tree_connect(xid, ses, unc, tcon, nls_codepage); in cifs_setup_ipc()
2940 tconInfoFree(tcon); in cifs_setup_ipc()
2944 cifs_dbg(FYI, "IPC tcon rc = %d ipc tid = %d\n", rc, tcon->tid); in cifs_setup_ipc()
2946 ses->tcon_ipc = tcon; in cifs_setup_ipc()
2961 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
2963 if (tcon == NULL) in cifs_free_ipc()
2968 rc = ses->server->ops->tree_disconnect(xid, tcon); in cifs_free_ipc()
2975 tconInfoFree(tcon); in cifs_free_ipc()
3304 static int match_tcon(struct cifs_tcon *tcon, struct smb_vol *volume_info) in match_tcon() argument
3306 if (tcon->tidStatus == CifsExiting) in match_tcon()
3308 if (strncmp(tcon->treeName, volume_info->UNC, MAX_TREE_SIZE)) in match_tcon()
3310 if (tcon->seal != volume_info->seal) in match_tcon()
3312 if (tcon->snapshot_time != volume_info->snapshot_time) in match_tcon()
3314 if (tcon->handle_timeout != volume_info->handle_timeout) in match_tcon()
3316 if (tcon->no_lease != volume_info->no_lease) in match_tcon()
3325 struct cifs_tcon *tcon; in cifs_find_tcon() local
3329 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
3330 if (!match_tcon(tcon, volume_info)) in cifs_find_tcon()
3332 ++tcon->tc_count; in cifs_find_tcon()
3334 return tcon; in cifs_find_tcon()
3341 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
3350 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
3353 ses = tcon->ses; in cifs_put_tcon()
3354 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
3356 if (--tcon->tc_count > 0) { in cifs_put_tcon()
3361 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
3366 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
3369 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
3370 tconInfoFree(tcon); in cifs_put_tcon()
3398 struct cifs_tcon *tcon; in cifs_get_tcon() local
3400 tcon = cifs_find_tcon(ses, volume_info); in cifs_get_tcon()
3401 if (tcon) { in cifs_get_tcon()
3408 return tcon; in cifs_get_tcon()
3416 tcon = tconInfoAlloc(); in cifs_get_tcon()
3417 if (tcon == NULL) { in cifs_get_tcon()
3429 tcon->snapshot_time = volume_info->snapshot_time; in cifs_get_tcon()
3439 tcon->handle_timeout = volume_info->handle_timeout; in cifs_get_tcon()
3442 tcon->ses = ses; in cifs_get_tcon()
3444 tcon->password = kstrdup(volume_info->password, GFP_KERNEL); in cifs_get_tcon()
3445 if (!tcon->password) { in cifs_get_tcon()
3457 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
3459 tcon->seal = true; in cifs_get_tcon()
3469 tcon->posix_extensions = true; in cifs_get_tcon()
3484 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, in cifs_get_tcon()
3491 tcon->use_persistent = false; in cifs_get_tcon()
3501 tcon->use_persistent = true; in cifs_get_tcon()
3508 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
3512 tcon->use_persistent = true; in cifs_get_tcon()
3520 tcon->use_resilient = true; in cifs_get_tcon()
3524 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
3536 tcon->retry = volume_info->retry; in cifs_get_tcon()
3537 tcon->nocase = volume_info->nocase; in cifs_get_tcon()
3538 tcon->nohandlecache = volume_info->nohandlecache; in cifs_get_tcon()
3539 tcon->local_lease = volume_info->local_lease; in cifs_get_tcon()
3540 tcon->no_lease = volume_info->no_lease; in cifs_get_tcon()
3541 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
3544 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
3547 cifs_fscache_get_super_cookie(tcon); in cifs_get_tcon()
3549 return tcon; in cifs_get_tcon()
3552 tconInfoFree(tcon); in cifs_get_tcon()
3641 struct cifs_tcon *tcon; in cifs_match_super() local
3652 tcon = tlink_tcon(tlink); in cifs_match_super()
3653 ses = tcon->ses; in cifs_match_super()
3660 !match_tcon(tcon, volume_info) || in cifs_match_super()
3942 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3954 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3957 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3958 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3962 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3964 if (tcon->unix_ext == 0) { in reset_cifs_unix_caps()
3969 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
3970 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
4032 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
4187 struct cifs_ses *ses, struct cifs_tcon *tcon) in mount_put_conns() argument
4191 if (tcon) in mount_put_conns()
4192 cifs_put_tcon(tcon); in mount_put_conns()
4210 struct cifs_tcon *tcon; in mount_get_conns() local
4248 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4249 if (IS_ERR(tcon)) { in mount_get_conns()
4250 rc = PTR_ERR(tcon); in mount_get_conns()
4254 *ntcon = tcon; in mount_get_conns()
4257 if (tcon->posix_extensions) in mount_get_conns()
4261 if (cap_unix(tcon->ses)) { in mount_get_conns()
4266 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4267 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in mount_get_conns()
4268 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in mount_get_conns()
4272 tcon->unix_ext = 0; /* server does not support them */ in mount_get_conns()
4275 if (!tcon->pipe && server->ops->qfs_tcon) { in mount_get_conns()
4276 server->ops->qfs_tcon(*xid, tcon); in mount_get_conns()
4278 if (tcon->fsDevInfo.DeviceCharacteristics & in mount_get_conns()
4288 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4289 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4295 struct cifs_tcon *tcon) in mount_setup_tlink() argument
4305 tlink->tl_tcon = tcon; in mount_setup_tlink()
4455 struct cifs_tcon **tcon) in setup_dfs_tgt_conn() argument
4489 mount_put_conns(cifs_sb, *xid, *server, *ses, *tcon); in setup_dfs_tgt_conn()
4491 tcon); in setup_dfs_tgt_conn()
4511 struct cifs_tcon **tcon) in mount_do_dfs_failover() argument
4531 ses, tcon); in mount_do_dfs_failover()
4611 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
4624 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
4648 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
4662 struct cifs_tcon *tcon) in is_path_remote() argument
4673 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4674 tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4680 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
4688 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in is_path_remote()
4689 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4709 struct cifs_tcon *tcon = NULL; in cifs_mount() local
4715 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4716 if (!rc && tcon) { in cifs_mount()
4722 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4781 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4782 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4789 &xid, &server, &ses, &tcon); in cifs_mount()
4809 tcon->tc_count++; in cifs_mount()
4810 tcon->dfs_path = root_path; in cifs_mount()
4812 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4815 root_tcon = tcon; in cifs_mount()
4818 if (!rc && tcon) { in cifs_mount()
4819 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4849 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4851 &tcon); in cifs_mount()
4859 &server, &ses, &tcon); in cifs_mount()
4871 if (!tcon->dfs_path) { in cifs_mount()
4873 tcon->dfs_path = full_path; in cifs_mount()
4875 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4877 cifs_sb->origin_fullpath = kstrndup(tcon->dfs_path, in cifs_mount()
4878 strlen(tcon->dfs_path), in cifs_mount()
4900 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4906 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4915 struct cifs_tcon *tcon; in cifs_mount() local
4918 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4922 if (tcon) { in cifs_mount()
4923 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4932 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4935 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4945 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
4977 if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
4993 calc_lanman_hash(tcon->password, ses->server->cryptkey, in CIFSTCon()
4999 rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, in CIFSTCon()
5052 tcon->tidStatus = CifsGood; in CIFSTCon()
5053 tcon->need_reconnect = false; in CIFSTCon()
5054 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
5069 tcon->ipc = true; in CIFSTCon()
5070 tcon->pipe = true; in CIFSTCon()
5080 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
5083 kfree(tcon->nativeFileSystem); in CIFSTCon()
5084 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
5088 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
5093 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
5095 tcon->Flags = 0; in CIFSTCon()
5096 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
5216 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
5237 tcon = ERR_PTR(rc); in cifs_construct_tcon()
5248 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
5253 tcon = cifs_get_tcon(ses, vol_info); in cifs_construct_tcon()
5254 if (IS_ERR(tcon)) { in cifs_construct_tcon()
5260 if (tcon->posix_extensions) in cifs_construct_tcon()
5264 reset_cifs_unix_caps(0, tcon, NULL, vol_info); in cifs_construct_tcon()
5271 return tcon; in cifs_construct_tcon()