Lines Matching refs:tcon

317 	struct cifs_tcon *tcon;  in cifs_reconnect()  local
347 tcon = list_entry(tmp2, struct cifs_tcon, tcon_list); in cifs_reconnect()
348 tcon->need_reconnect = true; in cifs_reconnect()
2584 static int match_tcon(struct cifs_tcon *tcon, const char *unc) in match_tcon() argument
2586 if (tcon->tidStatus == CifsExiting) in match_tcon()
2588 if (strncmp(tcon->treeName, unc, MAX_TREE_SIZE)) in match_tcon()
2597 struct cifs_tcon *tcon; in cifs_find_tcon() local
2601 tcon = list_entry(tmp, struct cifs_tcon, tcon_list); in cifs_find_tcon()
2602 if (!match_tcon(tcon, unc)) in cifs_find_tcon()
2604 ++tcon->tc_count; in cifs_find_tcon()
2606 return tcon; in cifs_find_tcon()
2613 cifs_put_tcon(struct cifs_tcon *tcon) in cifs_put_tcon() argument
2616 struct cifs_ses *ses = tcon->ses; in cifs_put_tcon()
2618 cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count); in cifs_put_tcon()
2620 if (--tcon->tc_count > 0) { in cifs_put_tcon()
2625 list_del_init(&tcon->tcon_list); in cifs_put_tcon()
2630 ses->server->ops->tree_disconnect(xid, tcon); in cifs_put_tcon()
2633 cifs_fscache_release_super_cookie(tcon); in cifs_put_tcon()
2634 tconInfoFree(tcon); in cifs_put_tcon()
2642 struct cifs_tcon *tcon; in cifs_get_tcon() local
2644 tcon = cifs_find_tcon(ses, volume_info->UNC); in cifs_get_tcon()
2645 if (tcon) { in cifs_get_tcon()
2649 if (tcon->seal != volume_info->seal) in cifs_get_tcon()
2651 return tcon; in cifs_get_tcon()
2659 tcon = tconInfoAlloc(); in cifs_get_tcon()
2660 if (tcon == NULL) { in cifs_get_tcon()
2665 tcon->ses = ses; in cifs_get_tcon()
2667 tcon->password = kstrdup(volume_info->password, GFP_KERNEL); in cifs_get_tcon()
2668 if (!tcon->password) { in cifs_get_tcon()
2679 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon, in cifs_get_tcon()
2687 tcon->Flags &= ~SMB_SHARE_IS_IN_DFS; in cifs_get_tcon()
2688 cifs_dbg(FYI, "DFS disabled (%d)\n", tcon->Flags); in cifs_get_tcon()
2690 tcon->seal = volume_info->seal; in cifs_get_tcon()
2691 tcon->use_persistent = false; in cifs_get_tcon()
2702 tcon->use_persistent = true; in cifs_get_tcon()
2711 } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) in cifs_get_tcon()
2715 tcon->use_persistent = true; in cifs_get_tcon()
2724 tcon->use_resilient = true; in cifs_get_tcon()
2732 tcon->retry = volume_info->retry; in cifs_get_tcon()
2733 tcon->nocase = volume_info->nocase; in cifs_get_tcon()
2734 tcon->local_lease = volume_info->local_lease; in cifs_get_tcon()
2735 INIT_LIST_HEAD(&tcon->pending_opens); in cifs_get_tcon()
2738 list_add(&tcon->tcon_list, &ses->tcon_list); in cifs_get_tcon()
2741 cifs_fscache_get_super_cookie(tcon); in cifs_get_tcon()
2743 return tcon; in cifs_get_tcon()
2746 tconInfoFree(tcon); in cifs_get_tcon()
2821 struct cifs_tcon *tcon; in cifs_match_super() local
2832 tcon = tlink_tcon(tlink); in cifs_match_super()
2833 ses = tcon->ses; in cifs_match_super()
2840 !match_tcon(tcon, volume_info->UNC)) { in cifs_match_super()
3155 void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon, in reset_cifs_unix_caps() argument
3167 __u64 saved_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3170 tcon->fsUnixInfo.Capability = 0; in reset_cifs_unix_caps()
3171 tcon->unix_ext = 0; /* Unix Extensions disabled */ in reset_cifs_unix_caps()
3175 tcon->unix_ext = 1; /* Unix Extensions supported */ in reset_cifs_unix_caps()
3177 if (tcon->unix_ext == 0) { in reset_cifs_unix_caps()
3182 if (!CIFSSMBQFSUnixInfo(xid, tcon)) { in reset_cifs_unix_caps()
3183 __u64 cap = le64_to_cpu(tcon->fsUnixInfo.Capability); in reset_cifs_unix_caps()
3245 if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) { in reset_cifs_unix_caps()
3524 struct cifs_tcon *tcon; in cifs_mount() local
3540 if (tcon) in cifs_mount()
3541 cifs_put_tcon(tcon); in cifs_mount()
3551 tcon = NULL; in cifs_mount()
3585 tcon = cifs_get_tcon(ses, volume_info); in cifs_mount()
3586 if (IS_ERR(tcon)) { in cifs_mount()
3587 rc = PTR_ERR(tcon); in cifs_mount()
3588 tcon = NULL; in cifs_mount()
3593 if (cap_unix(tcon->ses)) { in cifs_mount()
3596 reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info); in cifs_mount()
3597 if ((tcon->ses->server->tcpStatus == CifsNeedReconnect) && in cifs_mount()
3598 (le64_to_cpu(tcon->fsUnixInfo.Capability) & in cifs_mount()
3604 tcon->unix_ext = 0; /* server does not support them */ in cifs_mount()
3607 if (!tcon->ipc && server->ops->qfs_tcon) in cifs_mount()
3608 server->ops->qfs_tcon(xid, tcon); in cifs_mount()
3610 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, volume_info); in cifs_mount()
3611 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, volume_info); in cifs_mount()
3636 if (!rc && tcon) { in cifs_mount()
3644 full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon); in cifs_mount()
3649 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_mount()
3695 tlink->tl_tcon = tcon; in cifs_mount()
3713 if (tcon) in cifs_mount()
3714 cifs_put_tcon(tcon); in cifs_mount()
3733 const char *tree, struct cifs_tcon *tcon, in CIFSTCon() argument
3765 if (!tcon || (ses->server->sec_mode & SECMODE_USER)) { in CIFSTCon()
3781 calc_lanman_hash(tcon->password, ses->server->cryptkey, in CIFSTCon()
3787 rc = SMBNTencrypt(tcon->password, ses->server->cryptkey, in CIFSTCon()
3837 if ((rc == 0) && (tcon != NULL)) { in CIFSTCon()
3840 tcon->tidStatus = CifsGood; in CIFSTCon()
3841 tcon->need_reconnect = false; in CIFSTCon()
3842 tcon->tid = smb_buffer_response->Tid; in CIFSTCon()
3857 tcon->ipc = 1; in CIFSTCon()
3867 strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); in CIFSTCon()
3870 kfree(tcon->nativeFileSystem); in CIFSTCon()
3871 tcon->nativeFileSystem = cifs_strndup_from_utf16(bcc_ptr, in CIFSTCon()
3875 cifs_dbg(FYI, "nativeFileSystem=%s\n", tcon->nativeFileSystem); in CIFSTCon()
3880 tcon->Flags = le16_to_cpu(pSMBr->OptionalSupport); in CIFSTCon()
3882 tcon->Flags = 0; in CIFSTCon()
3883 cifs_dbg(FYI, "Tcon flags: 0x%x\n", tcon->Flags); in CIFSTCon()
3884 } else if ((rc == 0) && tcon == NULL) { in CIFSTCon()
3996 struct cifs_tcon *tcon = NULL; in cifs_construct_tcon() local
4016 tcon = ERR_PTR(rc); in cifs_construct_tcon()
4027 tcon = (struct cifs_tcon *)ses; in cifs_construct_tcon()
4032 tcon = cifs_get_tcon(ses, vol_info); in cifs_construct_tcon()
4033 if (IS_ERR(tcon)) { in cifs_construct_tcon()
4039 reset_cifs_unix_caps(0, tcon, NULL, vol_info); in cifs_construct_tcon()
4045 return tcon; in cifs_construct_tcon()