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()
493 struct cifs_tcon *tcon; in cifs_reconnect() local
555 tcon = list_entry(tmp2, struct cifs_tcon, tcon_list); in cifs_reconnect()
556 tcon->need_reconnect = true; in cifs_reconnect()
2935 struct cifs_tcon *tcon; in cifs_setup_ipc() local
2955 tcon = tconInfoAlloc(); in cifs_setup_ipc()
2956 if (tcon == NULL) in cifs_setup_ipc()
2965 tcon->ses = ses; in cifs_setup_ipc()
2966 tcon->ipc = true; in cifs_setup_ipc()
2967 tcon->seal = seal; in cifs_setup_ipc()
2968 rc = server->ops->tree_connect(xid, ses, unc, tcon, nls_codepage); in cifs_setup_ipc()
2973 tconInfoFree(tcon); in cifs_setup_ipc()
2977 cifs_dbg(FYI, "IPC tcon rc = %d ipc tid = %d\n", rc, tcon->tid); in cifs_setup_ipc()
2979 ses->tcon_ipc = tcon; in cifs_setup_ipc()
2994 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
2996 if (tcon == NULL) in cifs_free_ipc()
3001 rc = ses->server->ops->tree_disconnect(xid, tcon); in cifs_free_ipc()
3008 tconInfoFree(tcon); in cifs_free_ipc()
3337 static int match_tcon(struct cifs_tcon *tcon, struct smb_vol *volume_info) in match_tcon() argument
3339 if (tcon->tidStatus == CifsExiting) in match_tcon()
3341 if (strncmp(tcon->treeName, volume_info->UNC, MAX_TREE_SIZE)) in match_tcon()
3343 if (tcon->seal != volume_info->seal) in match_tcon()
3345 if (tcon->snapshot_time != volume_info->snapshot_time) in match_tcon()
3347 if (tcon->handle_timeout != volume_info->handle_timeout) in match_tcon()
3349 if (tcon->no_lease != volume_info->no_lease) in match_tcon()
3358 struct cifs_tcon *tcon; in cifs_find_tcon() local
3362 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
3363 if (!match_tcon(tcon, volume_info)) in cifs_find_tcon()
3365 ++tcon->tc_count; in cifs_find_tcon()
3367 return tcon; in cifs_find_tcon()
3374 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
3383 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
3386 ses = tcon->ses; in cifs_put_tcon()
3387 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
3389 if (--tcon->tc_count > 0) { in cifs_put_tcon()
3394 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
3399 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
3402 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
3403 tconInfoFree(tcon); in cifs_put_tcon()
3431 struct cifs_tcon *tcon; in cifs_get_tcon() local
3433 tcon = cifs_find_tcon(ses, volume_info); in cifs_get_tcon()
3434 if (tcon) { in cifs_get_tcon()
3441 return tcon; in cifs_get_tcon()
3449 tcon = tconInfoAlloc(); in cifs_get_tcon()
3450 if (tcon == NULL) { in cifs_get_tcon()
3462 tcon->snapshot_time = volume_info->snapshot_time; in cifs_get_tcon()
3472 tcon->handle_timeout = volume_info->handle_timeout; in cifs_get_tcon()
3475 tcon->ses = ses; in cifs_get_tcon()
3477 tcon->password = kstrdup(volume_info->password, GFP_KERNEL); in cifs_get_tcon()
3478 if (!tcon->password) { in cifs_get_tcon()
3490 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
3492 tcon->seal = true; in cifs_get_tcon()
3502 tcon->posix_extensions = true; in cifs_get_tcon()
3517 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, in cifs_get_tcon()
3524 tcon->use_persistent = false; in cifs_get_tcon()
3534 tcon->use_persistent = true; in cifs_get_tcon()
3541 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
3545 tcon->use_persistent = true; in cifs_get_tcon()
3553 tcon->use_resilient = true; in cifs_get_tcon()
3557 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
3569 tcon->retry = volume_info->retry; in cifs_get_tcon()
3570 tcon->nocase = volume_info->nocase; in cifs_get_tcon()
3571 tcon->nohandlecache = volume_info->nohandlecache; in cifs_get_tcon()
3572 tcon->local_lease = volume_info->local_lease; in cifs_get_tcon()
3573 tcon->no_lease = volume_info->no_lease; in cifs_get_tcon()
3574 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
3577 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
3580 cifs_fscache_get_super_cookie(tcon); in cifs_get_tcon()
3582 return tcon; in cifs_get_tcon()
3585 tconInfoFree(tcon); in cifs_get_tcon()
3674 struct cifs_tcon *tcon; in cifs_match_super() local
3685 tcon = tlink_tcon(tlink); in cifs_match_super()
3686 ses = tcon->ses; in cifs_match_super()
3693 !match_tcon(tcon, volume_info) || in cifs_match_super()
3975 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3987 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3990 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3991 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3995 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3997 if (tcon->unix_ext == 0) { in reset_cifs_unix_caps()
4002 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
4003 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
4065 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
4220 struct cifs_ses *ses, struct cifs_tcon *tcon) in mount_put_conns() argument
4224 if (tcon) in mount_put_conns()
4225 cifs_put_tcon(tcon); in mount_put_conns()
4243 struct cifs_tcon *tcon; in mount_get_conns() local
4281 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4282 if (IS_ERR(tcon)) { in mount_get_conns()
4283 rc = PTR_ERR(tcon); in mount_get_conns()
4287 *ntcon = tcon; in mount_get_conns()
4290 if (tcon->posix_extensions) in mount_get_conns()
4294 if (cap_unix(tcon->ses)) { in mount_get_conns()
4299 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4300 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in mount_get_conns()
4301 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in mount_get_conns()
4305 tcon->unix_ext = 0; /* server does not support them */ in mount_get_conns()
4308 if (!tcon->pipe && server->ops->qfs_tcon) { in mount_get_conns()
4309 server->ops->qfs_tcon(*xid, tcon); in mount_get_conns()
4311 if (tcon->fsDevInfo.DeviceCharacteristics & in mount_get_conns()
4321 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4322 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4328 struct cifs_tcon *tcon) in mount_setup_tlink() argument
4338 tlink->tl_tcon = tcon; in mount_setup_tlink()
4488 struct cifs_tcon **tcon) in setup_dfs_tgt_conn() argument
4522 mount_put_conns(cifs_sb, *xid, *server, *ses, *tcon); in setup_dfs_tgt_conn()
4524 tcon); in setup_dfs_tgt_conn()
4544 struct cifs_tcon **tcon) in mount_do_dfs_failover() argument
4564 ses, tcon); in mount_do_dfs_failover()
4644 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
4657 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
4681 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
4695 struct cifs_tcon *tcon) in is_path_remote() argument
4706 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4707 tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4713 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
4721 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in is_path_remote()
4722 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4737 struct cifs_tcon *tcon, in set_root_tcon() argument
4741 tcon->tc_count++; in set_root_tcon()
4742 tcon->remap = cifs_remap(cifs_sb); in set_root_tcon()
4744 *root = tcon; in set_root_tcon()
4753 struct cifs_tcon *tcon = NULL; in cifs_mount() local
4759 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4760 if (!rc && tcon) { in cifs_mount()
4766 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4825 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4826 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4833 &xid, &server, &ses, &tcon); in cifs_mount()
4851 set_root_tcon(cifs_sb, tcon, &root_tcon); in cifs_mount()
4854 if (!rc && tcon) { in cifs_mount()
4855 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4885 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4887 &tcon); in cifs_mount()
4891 if (!rc && tcon && in cifs_mount()
4892 (tcon->share_flags & (SHI1005_FLAGS_DFS | in cifs_mount()
4895 set_root_tcon(cifs_sb, tcon, &root_tcon); in cifs_mount()
4904 &server, &ses, &tcon); in cifs_mount()
4916 if (!tcon->dfs_path) { in cifs_mount()
4918 tcon->dfs_path = full_path; in cifs_mount()
4920 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4922 cifs_sb->origin_fullpath = kstrndup(tcon->dfs_path, in cifs_mount()
4923 strlen(tcon->dfs_path), in cifs_mount()
4945 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4951 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4960 struct cifs_tcon *tcon; in cifs_mount() local
4963 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4967 if (tcon) { in cifs_mount()
4968 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4977 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4980 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4990 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
5022 if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
5038 calc_lanman_hash(tcon->password, ses->server->cryptkey, in CIFSTCon()
5044 rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, in CIFSTCon()
5097 tcon->tidStatus = CifsGood; in CIFSTCon()
5098 tcon->need_reconnect = false; in CIFSTCon()
5099 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
5114 tcon->ipc = true; in CIFSTCon()
5115 tcon->pipe = true; in CIFSTCon()
5125 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
5128 kfree(tcon->nativeFileSystem); in CIFSTCon()
5129 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
5133 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
5138 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
5140 tcon->Flags = 0; in CIFSTCon()
5141 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
5261 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
5282 tcon = ERR_PTR(rc); in cifs_construct_tcon()
5293 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
5298 tcon = cifs_get_tcon(ses, vol_info); in cifs_construct_tcon()
5299 if (IS_ERR(tcon)) { in cifs_construct_tcon()
5305 if (tcon->posix_extensions) in cifs_construct_tcon()
5309 reset_cifs_unix_caps(0, tcon, NULL, vol_info); in cifs_construct_tcon()
5316 return tcon; in cifs_construct_tcon()