Lines Matching refs:tcon

70 	struct cifs_tcon *tcon;  member
173 struct cifs_tcon *tcon; in cifs_mark_tcp_ses_conns_for_reconnect() local
195 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) in cifs_mark_tcp_ses_conns_for_reconnect()
196 tcon->need_reconnect = true; in cifs_mark_tcp_ses_conns_for_reconnect()
1656 struct cifs_tcon *tcon; in cifs_setup_ipc() local
1675 tcon = tconInfoAlloc(); in cifs_setup_ipc()
1676 if (tcon == NULL) in cifs_setup_ipc()
1682 tcon->ses = ses; in cifs_setup_ipc()
1683 tcon->ipc = true; in cifs_setup_ipc()
1684 tcon->seal = seal; in cifs_setup_ipc()
1685 rc = server->ops->tree_connect(xid, ses, unc, tcon, ctx->local_nls); in cifs_setup_ipc()
1690 tconInfoFree(tcon); in cifs_setup_ipc()
1694 cifs_dbg(FYI, "IPC tcon rc = %d ipc tid = %d\n", rc, tcon->tid); in cifs_setup_ipc()
1696 ses->tcon_ipc = tcon; in cifs_setup_ipc()
1716 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
1718 if (tcon == NULL) in cifs_free_ipc()
1721 tconInfoFree(tcon); in cifs_free_ipc()
2101 static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) in match_tcon() argument
2103 if (tcon->tidStatus == CifsExiting) in match_tcon()
2105 if (strncmp(tcon->treeName, ctx->UNC, MAX_TREE_SIZE)) in match_tcon()
2107 if (tcon->seal != ctx->seal) in match_tcon()
2109 if (tcon->snapshot_time != ctx->snapshot_time) in match_tcon()
2111 if (tcon->handle_timeout != ctx->handle_timeout) in match_tcon()
2113 if (tcon->no_lease != ctx->no_lease) in match_tcon()
2115 if (tcon->nodelete != ctx->nodelete) in match_tcon()
2124 struct cifs_tcon *tcon; in cifs_find_tcon() local
2128 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
2130 if (!match_tcon(tcon, ctx)) in cifs_find_tcon()
2132 ++tcon->tc_count; in cifs_find_tcon()
2134 return tcon; in cifs_find_tcon()
2141 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
2150 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
2153 ses = tcon->ses; in cifs_put_tcon()
2154 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
2156 if (--tcon->tc_count > 0) { in cifs_put_tcon()
2162 WARN_ON(tcon->tc_count < 0); in cifs_put_tcon()
2164 if (tcon->use_witness) { in cifs_put_tcon()
2167 rc = cifs_swn_unregister(tcon); in cifs_put_tcon()
2174 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
2179 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
2182 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
2183 tconInfoFree(tcon); in cifs_put_tcon()
2213 struct cifs_tcon *tcon; in cifs_get_tcon() local
2215 tcon = cifs_find_tcon(ses, ctx); in cifs_get_tcon()
2216 if (tcon) { in cifs_get_tcon()
2223 return tcon; in cifs_get_tcon()
2231 tcon = tconInfoAlloc(); in cifs_get_tcon()
2232 if (tcon == NULL) { in cifs_get_tcon()
2244 tcon->snapshot_time = ctx->snapshot_time; in cifs_get_tcon()
2254 tcon->handle_timeout = ctx->handle_timeout; in cifs_get_tcon()
2257 tcon->ses = ses; in cifs_get_tcon()
2259 tcon->password = kstrdup(ctx->password, GFP_KERNEL); in cifs_get_tcon()
2260 if (!tcon->password) { in cifs_get_tcon()
2272 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
2274 tcon->seal = true; in cifs_get_tcon()
2284 tcon->posix_extensions = true; in cifs_get_tcon()
2298 rc = ses->server->ops->tree_connect(xid, ses, ctx->UNC, tcon, in cifs_get_tcon()
2305 tcon->use_persistent = false; in cifs_get_tcon()
2315 tcon->use_persistent = true; in cifs_get_tcon()
2322 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
2326 tcon->use_persistent = true; in cifs_get_tcon()
2334 tcon->use_resilient = true; in cifs_get_tcon()
2337 tcon->use_witness = false; in cifs_get_tcon()
2340 if (tcon->capabilities & SMB2_SHARE_CAP_CLUSTER) { in cifs_get_tcon()
2345 tcon->use_witness = true; in cifs_get_tcon()
2347 rc = cifs_swn_register(tcon); in cifs_get_tcon()
2366 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
2380 tcon->no_lease = ctx->no_lease; in cifs_get_tcon()
2388 tcon->retry = ctx->retry; in cifs_get_tcon()
2389 tcon->nocase = ctx->nocase; in cifs_get_tcon()
2391 tcon->nohandlecache = ctx->nohandlecache; in cifs_get_tcon()
2393 tcon->nohandlecache = true; in cifs_get_tcon()
2394 tcon->nodelete = ctx->nodelete; in cifs_get_tcon()
2395 tcon->local_lease = ctx->local_lease; in cifs_get_tcon()
2396 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
2399 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
2402 return tcon; in cifs_get_tcon()
2405 tconInfoFree(tcon); in cifs_get_tcon()
2499 struct cifs_tcon *tcon; in cifs_match_super() local
2511 tcon = tlink_tcon(tlink); in cifs_match_super()
2512 ses = tcon->ses; in cifs_match_super()
2519 !match_tcon(tcon, ctx) || in cifs_match_super()
2804 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
2818 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
2821 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
2822 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
2826 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
2828 if (!tcon->unix_ext) { in reset_cifs_unix_caps()
2833 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
2834 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
2900 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
2967 if (mnt_ctx->tcon) in mount_put_conns()
2968 cifs_put_tcon(mnt_ctx->tcon); in mount_put_conns()
2983 struct cifs_tcon *tcon = NULL; in mount_get_conns() local
3014 tcon = cifs_get_tcon(ses, ctx); in mount_get_conns()
3015 if (IS_ERR(tcon)) { in mount_get_conns()
3016 rc = PTR_ERR(tcon); in mount_get_conns()
3017 tcon = NULL; in mount_get_conns()
3022 if (tcon->posix_extensions) in mount_get_conns()
3026 if (cap_unix(tcon->ses)) { in mount_get_conns()
3031 reset_cifs_unix_caps(xid, tcon, cifs_sb, ctx); in mount_get_conns()
3032 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in mount_get_conns()
3033 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in mount_get_conns()
3039 tcon->unix_ext = 0; /* server does not support them */ in mount_get_conns()
3042 if (!tcon->pipe && server->ops->qfs_tcon) { in mount_get_conns()
3043 server->ops->qfs_tcon(xid, tcon, cifs_sb); in mount_get_conns()
3045 if (tcon->fsDevInfo.DeviceCharacteristics & in mount_get_conns()
3061 (cifs_sb->ctx->wsize > server->ops->negotiate_wsize(tcon, ctx))) in mount_get_conns()
3062 cifs_sb->ctx->wsize = server->ops->negotiate_wsize(tcon, ctx); in mount_get_conns()
3064 (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx))) in mount_get_conns()
3065 cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx); in mount_get_conns()
3072 cifs_fscache_get_super_cookie(tcon); in mount_get_conns()
3077 mnt_ctx->tcon = tcon; in mount_get_conns()
3084 struct cifs_tcon *tcon) in mount_setup_tlink() argument
3094 tlink->tl_tcon = tcon; in mount_setup_tlink()
3252 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
3265 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
3289 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
3306 struct cifs_tcon *tcon = mnt_ctx->tcon; in is_path_remote() local
3316 full_path = cifs_build_path_to_root(ctx, cifs_sb, tcon, in is_path_remote()
3317 tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
3323 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
3331 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in is_path_remote()
3332 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
3409 if (cifs_is_referral_server(mnt_ctx->tcon, &ref)) in connect_dfs_target()
3597 return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); in cifs_mount()
3616 if (mnt_ctx.tcon) { in cifs_mount()
3625 return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); in cifs_mount()
3638 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
3670 if (tcon->pipe || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
3712 tcon->tidStatus = CifsGood; in CIFSTCon()
3713 tcon->need_reconnect = false; in CIFSTCon()
3714 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
3729 tcon->ipc = true; in CIFSTCon()
3730 tcon->pipe = true; in CIFSTCon()
3740 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
3743 kfree(tcon->nativeFileSystem); in CIFSTCon()
3744 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
3748 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
3753 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
3755 tcon->Flags = 0; in CIFSTCon()
3756 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
3878 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
3906 tcon = ERR_PTR(rc); in cifs_construct_tcon()
3917 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
3922 tcon = cifs_get_tcon(ses, ctx); in cifs_construct_tcon()
3923 if (IS_ERR(tcon)) { in cifs_construct_tcon()
3929 reset_cifs_unix_caps(0, tcon, NULL, ctx); in cifs_construct_tcon()
3936 return tcon; in cifs_construct_tcon()
4186 static int __tree_connect_dfs_target(const unsigned int xid, struct cifs_tcon *tcon, in __tree_connect_dfs_target() argument
4191 struct TCP_Server_Info *server = tcon->ses->server; in __tree_connect_dfs_target()
4193 struct cifs_tcon *ipc = tcon->ses->tcon_ipc; in __tree_connect_dfs_target()
4242 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, cifs_sb->local_nls); in __tree_connect_dfs_target()
4251 if (dfs_cache_find(xid, tcon->ses, cifs_sb->local_nls, cifs_remap(cifs_sb), target, in __tree_connect_dfs_target()
4253 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, cifs_sb->local_nls); in __tree_connect_dfs_target()
4280 static int tree_connect_dfs_target(const unsigned int xid, struct cifs_tcon *tcon, in tree_connect_dfs_target() argument
4286 struct TCP_Server_Info *server = tcon->ses->server; in tree_connect_dfs_target()
4289 rc = __tree_connect_dfs_target(xid, tcon, cifs_sb, tree, islink, tl); in tree_connect_dfs_target()
4299 cifs_ses_mark_for_reconnect(tcon->ses); in tree_connect_dfs_target()
4306 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
4309 struct TCP_Server_Info *server = tcon->ses->server; in cifs_tree_connect()
4321 if (tcon->ipc) { in cifs_tree_connect()
4323 rc = ops->tree_connect(xid, tcon->ses, tree, tcon, nlsc); in cifs_tree_connect()
4339 rc = ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, cifs_sb->local_nls); in cifs_tree_connect()
4343 rc = tree_connect_dfs_target(xid, tcon, cifs_sb, tree, ref.server_type == DFS_TYPE_LINK, in cifs_tree_connect()
4354 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
4356 const struct smb_version_operations *ops = tcon->ses->server->ops; in cifs_tree_connect()
4358 return ops->tree_connect(xid, tcon->ses, tcon->treeName, tcon, nlsc); in cifs_tree_connect()