Lines Matching refs:tcon

122 	struct cifs_tcon *tcon = container_of(work,  in smb2_query_server_interfaces()  local
129 rc = SMB3_request_interfaces(0, tcon, false); in smb2_query_server_interfaces()
135 queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, in smb2_query_server_interfaces()
196 struct cifs_tcon *tcon; in cifs_mark_tcp_ses_conns_for_reconnect() local
239 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_mark_tcp_ses_conns_for_reconnect()
240 tcon->need_reconnect = true; in cifs_mark_tcp_ses_conns_for_reconnect()
241 spin_lock(&tcon->tc_lock); in cifs_mark_tcp_ses_conns_for_reconnect()
242 tcon->status = TID_NEED_RECON; in cifs_mark_tcp_ses_conns_for_reconnect()
243 spin_unlock(&tcon->tc_lock); in cifs_mark_tcp_ses_conns_for_reconnect()
1866 struct cifs_tcon *tcon; in cifs_setup_ipc() local
1886 tcon = tcon_info_alloc(false); in cifs_setup_ipc()
1887 if (tcon == NULL) in cifs_setup_ipc()
1895 tcon->ses = ses; in cifs_setup_ipc()
1896 tcon->ipc = true; in cifs_setup_ipc()
1897 tcon->seal = seal; in cifs_setup_ipc()
1898 rc = server->ops->tree_connect(xid, ses, unc, tcon, ctx->local_nls); in cifs_setup_ipc()
1903 tconInfoFree(tcon); in cifs_setup_ipc()
1907 cifs_dbg(FYI, "IPC tcon rc=%d ipc tid=0x%x\n", rc, tcon->tid); in cifs_setup_ipc()
1909 spin_lock(&tcon->tc_lock); in cifs_setup_ipc()
1910 tcon->status = TID_GOOD; in cifs_setup_ipc()
1911 spin_unlock(&tcon->tc_lock); in cifs_setup_ipc()
1912 ses->tcon_ipc = tcon; in cifs_setup_ipc()
1932 struct cifs_tcon *tcon = ses->tcon_ipc; in cifs_free_ipc() local
1934 if (tcon == NULL) in cifs_free_ipc()
1937 tconInfoFree(tcon); in cifs_free_ipc()
2345 static int match_tcon(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) in match_tcon() argument
2347 struct TCP_Server_Info *server = tcon->ses->server; in match_tcon()
2349 if (tcon->status == TID_EXITING) in match_tcon()
2352 if (tcon->origin_fullpath) { in match_tcon()
2355 tcon->origin_fullpath)) in match_tcon()
2358 strncmp(tcon->tree_name, ctx->UNC, MAX_TREE_SIZE)) { in match_tcon()
2361 if (tcon->seal != ctx->seal) in match_tcon()
2363 if (tcon->snapshot_time != ctx->snapshot_time) in match_tcon()
2365 if (tcon->handle_timeout != ctx->handle_timeout) in match_tcon()
2367 if (tcon->no_lease != ctx->no_lease) in match_tcon()
2369 if (tcon->nodelete != ctx->nodelete) in match_tcon()
2377 struct cifs_tcon *tcon; in cifs_find_tcon() local
2380 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in cifs_find_tcon()
2381 spin_lock(&tcon->tc_lock); in cifs_find_tcon()
2382 if (!match_tcon(tcon, ctx)) { in cifs_find_tcon()
2383 spin_unlock(&tcon->tc_lock); in cifs_find_tcon()
2386 ++tcon->tc_count; in cifs_find_tcon()
2387 spin_unlock(&tcon->tc_lock); in cifs_find_tcon()
2389 return tcon; in cifs_find_tcon()
2396 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
2405 if (tcon == NULL || tcon->ipc) in cifs_put_tcon()
2408 ses = tcon->ses; in cifs_put_tcon()
2409 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
2411 spin_lock(&tcon->tc_lock); in cifs_put_tcon()
2412 if (--tcon->tc_count > 0) { in cifs_put_tcon()
2413 spin_unlock(&tcon->tc_lock); in cifs_put_tcon()
2419 WARN_ON(tcon->tc_count < 0); in cifs_put_tcon()
2421 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
2422 tcon->status = TID_EXITING; in cifs_put_tcon()
2423 spin_unlock(&tcon->tc_lock); in cifs_put_tcon()
2427 cancel_delayed_work_sync(&tcon->query_interfaces); in cifs_put_tcon()
2429 cancel_delayed_work_sync(&tcon->dfs_cache_work); in cifs_put_tcon()
2432 if (tcon->use_witness) { in cifs_put_tcon()
2435 rc = cifs_swn_unregister(tcon); in cifs_put_tcon()
2444 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
2447 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
2448 tconInfoFree(tcon); in cifs_put_tcon()
2477 struct cifs_tcon *tcon; in cifs_get_tcon() local
2481 tcon = cifs_find_tcon(ses, ctx); in cifs_get_tcon()
2482 if (tcon) { in cifs_get_tcon()
2489 return tcon; in cifs_get_tcon()
2502 tcon = tcon_info_alloc(!nohandlecache); in cifs_get_tcon()
2503 if (tcon == NULL) { in cifs_get_tcon()
2507 tcon->nohandlecache = nohandlecache; in cifs_get_tcon()
2516 tcon->snapshot_time = ctx->snapshot_time; in cifs_get_tcon()
2526 tcon->handle_timeout = ctx->handle_timeout; in cifs_get_tcon()
2529 tcon->ses = ses; in cifs_get_tcon()
2531 tcon->password = kstrdup(ctx->password, GFP_KERNEL); in cifs_get_tcon()
2532 if (!tcon->password) { in cifs_get_tcon()
2544 } else if (tcon->ses->server->capabilities & in cifs_get_tcon()
2546 tcon->seal = true; in cifs_get_tcon()
2556 tcon->posix_extensions = true; in cifs_get_tcon()
2575 rc = ses->server->ops->tree_connect(xid, ses, ctx->UNC, tcon, in cifs_get_tcon()
2582 tcon->use_persistent = false; in cifs_get_tcon()
2592 tcon->use_persistent = true; in cifs_get_tcon()
2599 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
2603 tcon->use_persistent = true; in cifs_get_tcon()
2611 tcon->use_resilient = true; in cifs_get_tcon()
2614 tcon->use_witness = false; in cifs_get_tcon()
2617 if (tcon->capabilities & SMB2_SHARE_CAP_CLUSTER) { in cifs_get_tcon()
2622 tcon->use_witness = true; in cifs_get_tcon()
2624 rc = cifs_swn_register(tcon); in cifs_get_tcon()
2643 if (tcon->share_flags & SMB2_SHAREFLAG_NO_CACHING) { in cifs_get_tcon()
2657 tcon->no_lease = ctx->no_lease; in cifs_get_tcon()
2665 tcon->retry = ctx->retry; in cifs_get_tcon()
2666 tcon->nocase = ctx->nocase; in cifs_get_tcon()
2667 tcon->broken_sparse_sup = ctx->no_sparse; in cifs_get_tcon()
2668 tcon->max_cached_dirs = ctx->max_cached_dirs; in cifs_get_tcon()
2669 tcon->nodelete = ctx->nodelete; in cifs_get_tcon()
2670 tcon->local_lease = ctx->local_lease; in cifs_get_tcon()
2671 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
2672 tcon->status = TID_GOOD; in cifs_get_tcon()
2674 INIT_DELAYED_WORK(&tcon->query_interfaces, in cifs_get_tcon()
2679 queue_delayed_work(cifsiod_wq, &tcon->query_interfaces, in cifs_get_tcon()
2683 INIT_DELAYED_WORK(&tcon->dfs_cache_work, dfs_cache_refresh); in cifs_get_tcon()
2686 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
2689 return tcon; in cifs_get_tcon()
2692 tconInfoFree(tcon); in cifs_get_tcon()
2763 struct cifs_tcon *tcon, in match_prepath() argument
2774 if (tcon->origin_fullpath && in match_prepath()
2775 dfs_src_pathname_equal(tcon->origin_fullpath, ctx->source)) in match_prepath()
2794 struct cifs_tcon *tcon; in cifs_match_super() local
2814 tcon = tlink_tcon(tlink); in cifs_match_super()
2815 ses = tcon->ses; in cifs_match_super()
2823 spin_lock(&tcon->tc_lock); in cifs_match_super()
2826 !match_tcon(tcon, ctx) || in cifs_match_super()
2827 !match_prepath(sb, tcon, mnt_data)) { in cifs_match_super()
2834 spin_unlock(&tcon->tc_lock); in cifs_match_super()
3102 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3116 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3119 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3120 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3124 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3126 if (!tcon->unix_ext) { in reset_cifs_unix_caps()
3131 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
3132 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3198 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
3266 if (mnt_ctx->tcon) in cifs_mount_put_conns()
3267 cifs_put_tcon(mnt_ctx->tcon); in cifs_mount_put_conns()
3318 mnt_ctx->tcon = NULL; in cifs_mount_get_session()
3328 struct cifs_tcon *tcon = NULL; in cifs_mount_get_tcon() local
3341 tcon = cifs_get_tcon(mnt_ctx->ses, ctx); in cifs_mount_get_tcon()
3342 if (IS_ERR(tcon)) { in cifs_mount_get_tcon()
3343 rc = PTR_ERR(tcon); in cifs_mount_get_tcon()
3344 tcon = NULL; in cifs_mount_get_tcon()
3349 if (tcon->posix_extensions) in cifs_mount_get_tcon()
3354 if (cap_unix(tcon->ses)) { in cifs_mount_get_tcon()
3359 reset_cifs_unix_caps(mnt_ctx->xid, tcon, cifs_sb, ctx); in cifs_mount_get_tcon()
3360 spin_lock(&tcon->ses->server->srv_lock); in cifs_mount_get_tcon()
3361 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in cifs_mount_get_tcon()
3362 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in cifs_mount_get_tcon()
3364 spin_unlock(&tcon->ses->server->srv_lock); in cifs_mount_get_tcon()
3368 spin_unlock(&tcon->ses->server->srv_lock); in cifs_mount_get_tcon()
3371 tcon->unix_ext = 0; /* server does not support them */ in cifs_mount_get_tcon()
3374 if (!tcon->pipe && server->ops->qfs_tcon) { in cifs_mount_get_tcon()
3375 server->ops->qfs_tcon(mnt_ctx->xid, tcon, cifs_sb); in cifs_mount_get_tcon()
3377 if (tcon->fsDevInfo.DeviceCharacteristics & in cifs_mount_get_tcon()
3393 (cifs_sb->ctx->wsize > server->ops->negotiate_wsize(tcon, ctx))) in cifs_mount_get_tcon()
3394 cifs_sb->ctx->wsize = server->ops->negotiate_wsize(tcon, ctx); in cifs_mount_get_tcon()
3396 (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx))) in cifs_mount_get_tcon()
3397 cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx); in cifs_mount_get_tcon()
3405 cifs_fscache_get_super_cookie(tcon); in cifs_mount_get_tcon()
3408 mnt_ctx->tcon = tcon; in cifs_mount_get_tcon()
3413 struct cifs_tcon *tcon) in mount_setup_tlink() argument
3423 tlink->tl_tcon = tcon; in mount_setup_tlink()
3441 struct cifs_tcon *tcon, in cifs_are_all_path_components_accessible() argument
3454 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
3478 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
3496 struct cifs_tcon *tcon = mnt_ctx->tcon; in cifs_is_path_remote() local
3506 full_path = cifs_build_path_to_root(ctx, cifs_sb, tcon, in cifs_is_path_remote()
3507 tcon->Flags & SMB_SHARE_IS_IN_DFS); in cifs_is_path_remote()
3513 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_is_path_remote()
3519 rc = cifs_are_all_path_components_accessible(server, xid, tcon, in cifs_is_path_remote()
3520 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in cifs_is_path_remote()
3564 rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); in cifs_mount()
3596 rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); in cifs_mount()
3614 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
3687 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
3702 tcon->ipc = true; in CIFSTCon()
3703 tcon->pipe = true; in CIFSTCon()
3713 strscpy(tcon->tree_name, tree, sizeof(tcon->tree_name)); in CIFSTCon()
3716 kfree(tcon->nativeFileSystem); in CIFSTCon()
3717 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
3721 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
3726 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
3728 tcon->Flags = 0; in CIFSTCon()
3729 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
3925 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
3953 tcon = ERR_PTR(rc); in cifs_construct_tcon()
3964 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
3969 tcon = cifs_get_tcon(ses, ctx); in cifs_construct_tcon()
3970 if (IS_ERR(tcon)) { in cifs_construct_tcon()
3977 reset_cifs_unix_caps(0, tcon, NULL, ctx); in cifs_construct_tcon()
3985 return tcon; in cifs_construct_tcon()
4172 int cifs_tree_connect(const unsigned int xid, struct cifs_tcon *tcon, const struct nls_table *nlsc) in cifs_tree_connect() argument
4175 const struct smb_version_operations *ops = tcon->ses->server->ops; in cifs_tree_connect()
4178 spin_lock(&tcon->tc_lock); in cifs_tree_connect()
4179 if (tcon->status == TID_GOOD) { in cifs_tree_connect()
4180 spin_unlock(&tcon->tc_lock); in cifs_tree_connect()
4184 if (tcon->status != TID_NEW && in cifs_tree_connect()
4185 tcon->status != TID_NEED_TCON) { in cifs_tree_connect()
4186 spin_unlock(&tcon->tc_lock); in cifs_tree_connect()
4190 tcon->status = TID_IN_TCON; in cifs_tree_connect()
4191 spin_unlock(&tcon->tc_lock); in cifs_tree_connect()
4193 rc = ops->tree_connect(xid, tcon->ses, tcon->tree_name, tcon, nlsc); in cifs_tree_connect()
4195 spin_lock(&tcon->tc_lock); in cifs_tree_connect()
4196 if (tcon->status == TID_IN_TCON) in cifs_tree_connect()
4197 tcon->status = TID_NEED_TCON; in cifs_tree_connect()
4198 spin_unlock(&tcon->tc_lock); in cifs_tree_connect()
4200 spin_lock(&tcon->tc_lock); in cifs_tree_connect()
4201 if (tcon->status == TID_IN_TCON) in cifs_tree_connect()
4202 tcon->status = TID_GOOD; in cifs_tree_connect()
4203 tcon->need_reconnect = false; in cifs_tree_connect()
4204 spin_unlock(&tcon->tc_lock); in cifs_tree_connect()