Lines Matching full:tcon

395 	struct cifs_tcon *tcon;  in cifs_reconnect()  local
460 tcon = list_entry(tmp2, struct cifs_tcon, tcon_list); in cifs_reconnect()
461 tcon->need_reconnect = true; in cifs_reconnect()
2722 * cifs_setup_ipc - helper to setup the IPC tcon for the session
2725 * tcon_ipc. The IPC tcon has the same lifetime as the session.
2731 struct cifs_tcon *tcon; in cifs_setup_ipc() local
2751 tcon = tconInfoAlloc(); in cifs_setup_ipc()
2752 if (tcon == NULL) in cifs_setup_ipc()
2761 tcon->ses = ses; in cifs_setup_ipc()
2762 tcon->ipc = true; in cifs_setup_ipc()
2763 tcon->seal = seal; in cifs_setup_ipc()
2764 rc = server->ops->tree_connect(xid, ses, unc, tcon, nls_codepage); in cifs_setup_ipc()
2769 tconInfoFree(tcon); in cifs_setup_ipc()
2773 cifs_dbg(FYI, "IPC tcon rc = %d ipc tid = %d\n", rc, tcon->tid); in cifs_setup_ipc()
2775 ses->tcon_ipc = tcon; in cifs_setup_ipc()
2782 * cifs_free_ipc - helper to release the session IPC tcon
2790 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
2792 if (tcon == NULL) in cifs_free_ipc()
2797 rc = ses->server->ops->tree_disconnect(xid, tcon); in cifs_free_ipc()
2802 cifs_dbg(FYI, "failed to disconnect IPC tcon (rc=%d)\n", rc); in cifs_free_ipc()
2804 tconInfoFree(tcon); in cifs_free_ipc()
3155 static int match_tcon(struct cifs_tcon *tcon, struct smb_vol *volume_info) in match_tcon() argument
3157 if (tcon->tidStatus == CifsExiting) in match_tcon()
3159 if (strncmp(tcon->treeName, volume_info->UNC, MAX_TREE_SIZE)) in match_tcon()
3161 if (tcon->seal != volume_info->seal) in match_tcon()
3163 if (tcon->snapshot_time != volume_info->snapshot_time) in match_tcon()
3165 if (tcon->handle_timeout != volume_info->handle_timeout) in match_tcon()
3167 if (tcon->no_lease != volume_info->no_lease) in match_tcon()
3169 if (tcon->nodelete != volume_info->nodelete) in match_tcon()
3178 struct cifs_tcon *tcon; in cifs_find_tcon() local
3182 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
3184 if (tcon->dfs_path) in cifs_find_tcon()
3187 if (!match_tcon(tcon, volume_info)) in cifs_find_tcon()
3189 ++tcon->tc_count; in cifs_find_tcon()
3191 return tcon; in cifs_find_tcon()
3198 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
3204 * IPC tcon share the lifetime of their session and are in cifs_put_tcon()
3207 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
3210 ses = tcon->ses; in cifs_put_tcon()
3211 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
3213 if (--tcon->tc_count > 0) { in cifs_put_tcon()
3218 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
3223 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
3226 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
3227 tconInfoFree(tcon); in cifs_put_tcon()
3232 * cifs_get_tcon - get a tcon matching @volume_info data from @ses
3234 * - tcon refcount is the number of mount points using the tcon.
3235 * - ses refcount is the number of tcon using the session.
3243 * a) a new tcon already allocated with refcount=1 (1 mount point) and
3244 * its session refcount incremented (1 new tcon). This +1 was
3247 * b) an existing tcon with refcount+1 (add a mount point to it) and
3248 * identical ses refcount (no new tcon). Because of (1) we need to
3255 struct cifs_tcon *tcon; in cifs_get_tcon() local
3257 tcon = cifs_find_tcon(ses, volume_info); in cifs_get_tcon()
3258 if (tcon) { in cifs_get_tcon()
3260 * tcon has refcount already incremented but we need to in cifs_get_tcon()
3265 return tcon; in cifs_get_tcon()
3273 tcon = tconInfoAlloc(); in cifs_get_tcon()
3274 if (tcon == NULL) { in cifs_get_tcon()
3286 tcon->snapshot_time = volume_info->snapshot_time; in cifs_get_tcon()
3296 tcon->handle_timeout = volume_info->handle_timeout; in cifs_get_tcon()
3299 tcon->ses = ses; in cifs_get_tcon()
3301 tcon->password = kstrdup(volume_info->password, GFP_KERNEL); in cifs_get_tcon()
3302 if (!tcon->password) { in cifs_get_tcon()
3314 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
3316 tcon->seal = true; in cifs_get_tcon()
3326 tcon->posix_extensions = true; in cifs_get_tcon()
3336 * BB Do we need to wrap session_mutex around this TCon call and Unix in cifs_get_tcon()
3340 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, in cifs_get_tcon()
3343 cifs_dbg(FYI, "Tcon rc = %d\n", rc); in cifs_get_tcon()
3347 tcon->use_persistent = false; in cifs_get_tcon()
3357 tcon->use_persistent = true; in cifs_get_tcon()
3364 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
3368 tcon->use_persistent = true; in cifs_get_tcon()
3376 tcon->use_resilient = true; in cifs_get_tcon()
3380 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
3394 tcon->no_lease = volume_info->no_lease; in cifs_get_tcon()
3402 tcon->retry = volume_info->retry; in cifs_get_tcon()
3403 tcon->nocase = volume_info->nocase; in cifs_get_tcon()
3405 tcon->nohandlecache = volume_info->nohandlecache; in cifs_get_tcon()
3407 tcon->nohandlecache = 1; in cifs_get_tcon()
3408 tcon->nodelete = volume_info->nodelete; in cifs_get_tcon()
3409 tcon->local_lease = volume_info->local_lease; in cifs_get_tcon()
3410 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
3413 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
3416 cifs_fscache_get_super_cookie(tcon); in cifs_get_tcon()
3418 return tcon; in cifs_get_tcon()
3421 tconInfoFree(tcon); in cifs_get_tcon()
3512 struct cifs_tcon *tcon; in cifs_match_super() local
3524 tcon = tlink_tcon(tlink); in cifs_match_super()
3525 ses = tcon->ses; in cifs_match_super()
3532 !match_tcon(tcon, volume_info) || in cifs_match_super()
3816 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3823 * Perhaps we could add a backpointer to array of sb from tcon in reset_cifs_unix_caps()
3828 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3831 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3832 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3836 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3838 if (tcon->unix_ext == 0) { in reset_cifs_unix_caps()
3843 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
3844 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3906 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
4062 struct cifs_ses *ses, struct cifs_tcon *tcon) in mount_put_conns() argument
4066 if (tcon) in mount_put_conns()
4067 cifs_put_tcon(tcon); in mount_put_conns()
4076 /* Get connections for tcp, ses and tcon */
4085 struct cifs_tcon *tcon; in mount_get_conns() local
4117 /* search for existing tcon to this server share */ in mount_get_conns()
4118 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4119 if (IS_ERR(tcon)) { in mount_get_conns()
4120 rc = PTR_ERR(tcon); in mount_get_conns()
4124 *ntcon = tcon; in mount_get_conns()
4127 if (tcon->posix_extensions) in mount_get_conns()
4131 if (cap_unix(tcon->ses)) { in mount_get_conns()
4136 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4137 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in mount_get_conns()
4138 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in mount_get_conns()
4142 tcon->unix_ext = 0; /* server does not support them */ in mount_get_conns()
4145 if (!tcon->pipe && server->ops->qfs_tcon) { in mount_get_conns()
4146 server->ops->qfs_tcon(*xid, tcon, cifs_sb); in mount_get_conns()
4148 if (tcon->fsDevInfo.DeviceCharacteristics & in mount_get_conns()
4158 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4159 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4165 struct cifs_tcon *tcon) in mount_setup_tlink() argument
4169 /* hang the tcon off of the superblock */ in mount_setup_tlink()
4175 tlink->tl_tcon = tcon; in mount_setup_tlink()
4193 * exiting connection (tcon)
4319 struct cifs_tcon **tcon) in setup_dfs_tgt_conn() argument
4352 mount_put_conns(cifs_sb, *xid, *server, *ses, *tcon); in setup_dfs_tgt_conn()
4354 tcon); in setup_dfs_tgt_conn()
4370 struct cifs_tcon **tcon) in do_dfs_failover() argument
4390 tcon); in do_dfs_failover()
4470 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
4483 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
4507 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
4521 struct cifs_tcon *tcon) in is_path_remote() argument
4530 * cifs_build_path_to_root works only when we have a valid tcon in is_path_remote()
4532 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4533 tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4539 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
4547 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in is_path_remote()
4548 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4583 struct cifs_tcon *tcon, char **dfs_path) in check_dfs_prepath() argument
4589 int added_treename = tcon->Flags & SMB_SHARE_IS_IN_DFS; in check_dfs_prepath()
4592 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename); in check_dfs_prepath()
4621 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, path); in check_dfs_prepath()
4657 struct cifs_tcon *tcon = NULL; in cifs_mount() local
4663 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4677 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4714 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4715 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4720 &server, &ses, &tcon); in cifs_mount()
4724 if (!tcon) in cifs_mount()
4727 if (is_tcon_dfs(tcon)) { in cifs_mount()
4732 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path); in cifs_mount()
4748 * only the root path is set in cifs_sb->origin_fullpath and tcon->dfs_path. And for DFS in cifs_mount()
4758 tcon->dfs_path = full_path; in cifs_mount()
4760 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4785 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4793 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4802 struct cifs_tcon *tcon; in cifs_mount() local
4805 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4809 if (tcon) { in cifs_mount()
4810 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4819 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4822 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4832 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
4864 if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
4880 calc_lanman_hash(tcon->password, ses->server->cryptkey, in CIFSTCon()
4886 rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, in CIFSTCon()
4938 tcon->tidStatus = CifsGood; in CIFSTCon()
4939 tcon->need_reconnect = false; in CIFSTCon()
4940 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
4955 tcon->ipc = true; in CIFSTCon()
4956 tcon->pipe = true; in CIFSTCon()
4966 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
4969 kfree(tcon->nativeFileSystem); in CIFSTCon()
4970 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
4974 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
4979 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
4981 tcon->Flags = 0; in CIFSTCon()
4982 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
5104 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
5131 tcon = ERR_PTR(rc); in cifs_construct_tcon()
5142 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
5147 tcon = cifs_get_tcon(ses, vol_info); in cifs_construct_tcon()
5148 if (IS_ERR(tcon)) { in cifs_construct_tcon()
5154 reset_cifs_unix_caps(0, tcon, NULL, vol_info); in cifs_construct_tcon()
5161 return tcon; in cifs_construct_tcon()
5212 * Find or construct an appropriate tcon given a cifs_sb and the fsuid of the
5216 * the master tcon for the mount.
5218 * First, search the rbtree for an existing tcon for this fsuid. If one
5348 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
5351 struct TCP_Server_Info *server = tcon->ses->server; in cifs_tree_connect()
5369 if (!tcon->dfs_path || dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl)) { in cifs_tree_connect()
5370 if (tcon->ipc) { in cifs_tree_connect()
5372 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5374 rc = ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); in cifs_tree_connect()
5392 rc = dfs_cache_get_tgt_share(tcon->dfs_path + 1, it, &share, &prefix); in cifs_tree_connect()
5418 if (tcon->ipc) { in cifs_tree_connect()
5420 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5423 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5426 rc = update_super_prepath(tcon, prefix); in cifs_tree_connect()
5439 rc = dfs_cache_noreq_update_tgthint(tcon->dfs_path + 1, it); in cifs_tree_connect()
5449 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
5451 const struct smb_version_operations *ops = tcon->ses->server->ops; in cifs_tree_connect()
5453 return ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); in cifs_tree_connect()