• Home
  • Raw
  • Download

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()
2710 * cifs_setup_ipc - helper to setup the IPC tcon for the session
2713 * tcon_ipc. The IPC tcon has the same lifetime as the session.
2719 struct cifs_tcon *tcon; in cifs_setup_ipc() local
2739 tcon = tconInfoAlloc(); in cifs_setup_ipc()
2740 if (tcon == NULL) in cifs_setup_ipc()
2749 tcon->ses = ses; in cifs_setup_ipc()
2750 tcon->ipc = true; in cifs_setup_ipc()
2751 tcon->seal = seal; in cifs_setup_ipc()
2752 rc = server->ops->tree_connect(xid, ses, unc, tcon, nls_codepage); in cifs_setup_ipc()
2757 tconInfoFree(tcon); in cifs_setup_ipc()
2761 cifs_dbg(FYI, "IPC tcon rc = %d ipc tid = %d\n", rc, tcon->tid); in cifs_setup_ipc()
2763 ses->tcon_ipc = tcon; in cifs_setup_ipc()
2770 * cifs_free_ipc - helper to release the session IPC tcon
2778 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
2780 if (tcon == NULL) in cifs_free_ipc()
2785 rc = ses->server->ops->tree_disconnect(xid, tcon); in cifs_free_ipc()
2790 cifs_dbg(FYI, "failed to disconnect IPC tcon (rc=%d)\n", rc); in cifs_free_ipc()
2792 tconInfoFree(tcon); in cifs_free_ipc()
3143 static int match_tcon(struct cifs_tcon *tcon, struct smb_vol *volume_info) in match_tcon() argument
3145 if (tcon->tidStatus == CifsExiting) in match_tcon()
3147 if (strncmp(tcon->treeName, volume_info->UNC, MAX_TREE_SIZE)) in match_tcon()
3149 if (tcon->seal != volume_info->seal) in match_tcon()
3151 if (tcon->snapshot_time != volume_info->snapshot_time) in match_tcon()
3153 if (tcon->handle_timeout != volume_info->handle_timeout) in match_tcon()
3155 if (tcon->no_lease != volume_info->no_lease) in match_tcon()
3157 if (tcon->nodelete != volume_info->nodelete) in match_tcon()
3166 struct cifs_tcon *tcon; in cifs_find_tcon() local
3170 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
3172 if (tcon->dfs_path) in cifs_find_tcon()
3175 if (!match_tcon(tcon, volume_info)) in cifs_find_tcon()
3177 ++tcon->tc_count; in cifs_find_tcon()
3179 return tcon; in cifs_find_tcon()
3186 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
3192 * IPC tcon share the lifetime of their session and are in cifs_put_tcon()
3195 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
3198 ses = tcon->ses; in cifs_put_tcon()
3199 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
3201 if (--tcon->tc_count > 0) { in cifs_put_tcon()
3206 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
3211 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
3214 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
3215 tconInfoFree(tcon); in cifs_put_tcon()
3220 * cifs_get_tcon - get a tcon matching @volume_info data from @ses
3222 * - tcon refcount is the number of mount points using the tcon.
3223 * - ses refcount is the number of tcon using the session.
3231 * a) a new tcon already allocated with refcount=1 (1 mount point) and
3232 * its session refcount incremented (1 new tcon). This +1 was
3235 * b) an existing tcon with refcount+1 (add a mount point to it) and
3236 * identical ses refcount (no new tcon). Because of (1) we need to
3243 struct cifs_tcon *tcon; in cifs_get_tcon() local
3245 tcon = cifs_find_tcon(ses, volume_info); in cifs_get_tcon()
3246 if (tcon) { in cifs_get_tcon()
3248 * tcon has refcount already incremented but we need to in cifs_get_tcon()
3253 return tcon; in cifs_get_tcon()
3261 tcon = tconInfoAlloc(); in cifs_get_tcon()
3262 if (tcon == NULL) { in cifs_get_tcon()
3274 tcon->snapshot_time = volume_info->snapshot_time; in cifs_get_tcon()
3284 tcon->handle_timeout = volume_info->handle_timeout; in cifs_get_tcon()
3287 tcon->ses = ses; in cifs_get_tcon()
3289 tcon->password = kstrdup(volume_info->password, GFP_KERNEL); in cifs_get_tcon()
3290 if (!tcon->password) { in cifs_get_tcon()
3302 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
3304 tcon->seal = true; in cifs_get_tcon()
3314 tcon->posix_extensions = true; in cifs_get_tcon()
3324 * BB Do we need to wrap session_mutex around this TCon call and Unix in cifs_get_tcon()
3328 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, in cifs_get_tcon()
3331 cifs_dbg(FYI, "Tcon rc = %d\n", rc); in cifs_get_tcon()
3335 tcon->use_persistent = false; in cifs_get_tcon()
3345 tcon->use_persistent = true; in cifs_get_tcon()
3352 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
3356 tcon->use_persistent = true; in cifs_get_tcon()
3364 tcon->use_resilient = true; in cifs_get_tcon()
3368 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
3382 tcon->no_lease = volume_info->no_lease; in cifs_get_tcon()
3390 tcon->retry = volume_info->retry; in cifs_get_tcon()
3391 tcon->nocase = volume_info->nocase; in cifs_get_tcon()
3393 tcon->nohandlecache = volume_info->nohandlecache; in cifs_get_tcon()
3395 tcon->nohandlecache = 1; in cifs_get_tcon()
3396 tcon->nodelete = volume_info->nodelete; in cifs_get_tcon()
3397 tcon->local_lease = volume_info->local_lease; in cifs_get_tcon()
3398 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
3401 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
3404 cifs_fscache_get_super_cookie(tcon); in cifs_get_tcon()
3406 return tcon; in cifs_get_tcon()
3409 tconInfoFree(tcon); in cifs_get_tcon()
3500 struct cifs_tcon *tcon; in cifs_match_super() local
3512 tcon = tlink_tcon(tlink); in cifs_match_super()
3513 ses = tcon->ses; in cifs_match_super()
3520 !match_tcon(tcon, volume_info) || in cifs_match_super()
3804 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3811 * Perhaps we could add a backpointer to array of sb from tcon in reset_cifs_unix_caps()
3816 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3819 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3820 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3824 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3826 if (tcon->unix_ext == 0) { in reset_cifs_unix_caps()
3831 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
3832 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3894 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
4050 struct cifs_ses *ses, struct cifs_tcon *tcon) in mount_put_conns() argument
4054 if (tcon) in mount_put_conns()
4055 cifs_put_tcon(tcon); in mount_put_conns()
4064 /* Get connections for tcp, ses and tcon */
4073 struct cifs_tcon *tcon; in mount_get_conns() local
4105 /* search for existing tcon to this server share */ in mount_get_conns()
4106 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4107 if (IS_ERR(tcon)) { in mount_get_conns()
4108 rc = PTR_ERR(tcon); in mount_get_conns()
4112 *ntcon = tcon; in mount_get_conns()
4115 if (tcon->posix_extensions) in mount_get_conns()
4119 if (cap_unix(tcon->ses)) { in mount_get_conns()
4124 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4125 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in mount_get_conns()
4126 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in mount_get_conns()
4130 tcon->unix_ext = 0; /* server does not support them */ in mount_get_conns()
4133 if (!tcon->pipe && server->ops->qfs_tcon) { in mount_get_conns()
4134 server->ops->qfs_tcon(*xid, tcon, cifs_sb); in mount_get_conns()
4136 if (tcon->fsDevInfo.DeviceCharacteristics & in mount_get_conns()
4146 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4147 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4153 struct cifs_tcon *tcon) in mount_setup_tlink() argument
4157 /* hang the tcon off of the superblock */ in mount_setup_tlink()
4163 tlink->tl_tcon = tcon; in mount_setup_tlink()
4181 * exiting connection (tcon)
4307 struct cifs_tcon **tcon) in setup_dfs_tgt_conn() argument
4340 mount_put_conns(cifs_sb, *xid, *server, *ses, *tcon); in setup_dfs_tgt_conn()
4342 tcon); in setup_dfs_tgt_conn()
4358 struct cifs_tcon **tcon) in do_dfs_failover() argument
4378 tcon); in do_dfs_failover()
4458 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
4471 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
4495 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
4509 struct cifs_tcon *tcon) in is_path_remote() argument
4518 * cifs_build_path_to_root works only when we have a valid tcon in is_path_remote()
4520 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4521 tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4527 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
4535 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in is_path_remote()
4536 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4571 struct cifs_tcon *tcon, char **dfs_path) in check_dfs_prepath() argument
4577 int added_treename = tcon->Flags & SMB_SHARE_IS_IN_DFS; in check_dfs_prepath()
4580 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename); in check_dfs_prepath()
4609 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, path); in check_dfs_prepath()
4645 struct cifs_tcon *tcon = NULL; in cifs_mount() local
4651 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4665 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4702 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4703 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4708 &server, &ses, &tcon); in cifs_mount()
4712 if (!tcon) in cifs_mount()
4715 if (is_tcon_dfs(tcon)) { in cifs_mount()
4720 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path); in cifs_mount()
4736 * only the root path is set in cifs_sb->origin_fullpath and tcon->dfs_path. And for DFS in cifs_mount()
4746 tcon->dfs_path = full_path; in cifs_mount()
4748 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4773 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4781 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4790 struct cifs_tcon *tcon; in cifs_mount() local
4793 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4797 if (tcon) { in cifs_mount()
4798 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4807 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4810 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4820 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
4852 if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
4868 calc_lanman_hash(tcon->password, ses->server->cryptkey, in CIFSTCon()
4874 rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, in CIFSTCon()
4926 tcon->tidStatus = CifsGood; in CIFSTCon()
4927 tcon->need_reconnect = false; in CIFSTCon()
4928 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
4943 tcon->ipc = true; in CIFSTCon()
4944 tcon->pipe = true; in CIFSTCon()
4954 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
4957 kfree(tcon->nativeFileSystem); in CIFSTCon()
4958 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
4962 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
4967 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
4969 tcon->Flags = 0; in CIFSTCon()
4970 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
5092 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
5119 tcon = ERR_PTR(rc); in cifs_construct_tcon()
5130 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
5135 tcon = cifs_get_tcon(ses, vol_info); in cifs_construct_tcon()
5136 if (IS_ERR(tcon)) { in cifs_construct_tcon()
5142 reset_cifs_unix_caps(0, tcon, NULL, vol_info); in cifs_construct_tcon()
5149 return tcon; in cifs_construct_tcon()
5200 * Find or construct an appropriate tcon given a cifs_sb and the fsuid of the
5204 * the master tcon for the mount.
5206 * First, search the rbtree for an existing tcon for this fsuid. If one
5336 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
5339 struct TCP_Server_Info *server = tcon->ses->server; in cifs_tree_connect()
5357 if (!tcon->dfs_path || dfs_cache_noreq_find(tcon->dfs_path + 1, &ref, &tl)) { in cifs_tree_connect()
5358 if (tcon->ipc) { in cifs_tree_connect()
5360 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5362 rc = ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); in cifs_tree_connect()
5380 rc = dfs_cache_get_tgt_share(tcon->dfs_path + 1, it, &share, &prefix); in cifs_tree_connect()
5406 if (tcon->ipc) { in cifs_tree_connect()
5408 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5411 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
5414 rc = update_super_prepath(tcon, prefix); in cifs_tree_connect()
5427 rc = dfs_cache_noreq_update_tgthint(tcon->dfs_path + 1, it); in cifs_tree_connect()
5437 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
5439 const struct smb_version_operations *ops = tcon->ses->server->ops; in cifs_tree_connect()
5441 return ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); in cifs_tree_connect()