Lines Matching refs:vol
563 cifs_server_dbg(VFS, "%s: failed to update vol info in DFS cache: rc = %d\n",
1332 * Parse a devname into substrings and populate the vol->UNC and vol->prepath
1336 cifs_parse_devname(const char *devname, struct smb_vol *vol)
1365 vol->UNC = kstrndup(devname, pos - devname, GFP_KERNEL);
1366 if (!vol->UNC)
1369 convert_delimiter(vol->UNC, '\\');
1379 vol->prepath = kstrdup(pos, GFP_KERNEL);
1380 if (!vol->prepath)
1388 struct smb_vol *vol, bool is_smb3)
1407 struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr;
1414 memset(vol, 0, sizeof(*vol));
1421 memset(vol->source_rfc1001_name, 0x20, RFC1001_NAME_LEN);
1423 vol->source_rfc1001_name[i] = toupper(nodename[i]);
1425 vol->source_rfc1001_name[RFC1001_NAME_LEN] = 0;
1428 vol->target_rfc1001_name[0] = 0;
1429 vol->cred_uid = current_uid();
1430 vol->linux_uid = current_uid();
1431 vol->linux_gid = current_gid();
1432 vol->bsize = 1024 * 1024; /* can improve cp performance significantly */
1439 vol->remap = true;
1442 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
1444 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
1446 vol->posix_paths = 1;
1448 vol->server_ino = 1;
1451 vol->strict_io = true;
1453 vol->actimeo = CIFS_DEF_ACTIMEO;
1456 vol->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */
1459 vol->ops = &smb30_operations;
1460 vol->vals = &smbdefault_values;
1462 vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT;
1465 vol->multichannel = false;
1466 vol->max_channels = 1;
1486 vol->backupuid_specified = false; /* no backup intent for a user */
1487 vol->backupgid_specified = false; /* no backup intent for a group */
1489 switch (cifs_parse_devname(devname, vol)) {
1521 vol->no_xattr = 0;
1524 vol->no_xattr = 1;
1539 vol->noblocksnd = 1;
1542 vol->noautotune = 1;
1545 vol->no_lease = 1;
1548 vol->retry = 1;
1551 vol->retry = 0;
1554 vol->noperm = 0;
1557 vol->noperm = 1;
1560 vol->nodelete = 1;
1563 vol->sfu_remap = true;
1564 vol->remap = false; /* disable SFM mapping */
1567 vol->sfu_remap = false;
1570 vol->remap = true;
1571 vol->sfu_remap = false; /* disable SFU mapping */
1574 vol->remap = false;
1577 vol->sfu_emul = 1;
1580 vol->sfu_emul = 0;
1583 vol->nodfs = 1;
1587 vol->rootfs = true;
1591 vol->posix_paths = 1;
1594 vol->posix_paths = 0;
1597 if (vol->linux_ext)
1600 vol->no_linux_ext = 1;
1603 if (vol->no_linux_ext)
1606 vol->linux_ext = 1;
1609 vol->nocase = 1;
1612 vol->nobrl = 0;
1615 vol->nobrl = 1;
1621 if (vol->file_mode ==
1623 vol->file_mode = S_IALLUGO;
1626 vol->nohandlecache = 1;
1629 vol->nohandlecache = 0;
1632 vol->mand_lock = 1;
1635 vol->setuids = 1;
1638 vol->setuids = 0;
1641 vol->setuidfromacl = 1;
1644 vol->dynperm = true;
1647 vol->dynperm = false;
1650 vol->retry = 0;
1653 vol->retry = 1;
1656 vol->intr = 0;
1659 vol->intr = 1;
1662 vol->nostrictsync = 1;
1665 vol->nostrictsync = 0;
1668 vol->server_ino = 1;
1671 vol->server_ino = 0;
1674 vol->rwpidforward = 1;
1677 vol->mode_ace = 1;
1680 vol->cifs_acl = 1;
1683 vol->cifs_acl = 0;
1686 vol->no_psx_acl = 0;
1689 vol->no_psx_acl = 1;
1692 vol->local_lease = 1;
1695 vol->sign = true;
1698 vol->sign = true;
1699 vol->ignore_signature = true;
1705 * vol->secFlg |= CIFSSEC_MUST_SEAL;
1707 vol->seal = 1;
1717 vol->fsc = true;
1720 vol->mfsymlinks = true;
1723 vol->multiuser = true;
1729 vol->nosharesock = true;
1732 vol->nopersistent = true;
1733 if (vol->persistent) {
1740 vol->persistent = true;
1741 if ((vol->nopersistent) || (vol->resilient)) {
1748 vol->resilient = true;
1749 if (vol->persistent) {
1756 vol->resilient = false; /* already the default */
1759 vol->domainauto = true;
1762 vol->rdma = true;
1765 vol->multichannel = true;
1767 if (vol->max_channels < 2)
1768 vol->max_channels = 2;
1771 vol->multichannel = false;
1772 vol->max_channels = 1;
1775 vol->compression = UNKNOWN_TYPE;
1782 if (get_option_uid(args, &vol->backupuid)) {
1787 vol->backupuid_specified = true;
1790 if (get_option_gid(args, &vol->backupgid)) {
1795 vol->backupgid_specified = true;
1798 if (get_option_uid(args, &vol->linux_uid)) {
1806 if (get_option_uid(args, &vol->cred_uid)) {
1813 if (get_option_gid(args, &vol->linux_gid)) {
1826 vol->file_mode = option;
1834 vol->dir_mode = option;
1850 vol->min_offload = option;
1870 vol->bsize = option;
1878 vol->rsize = option;
1886 vol->wsize = option;
1894 vol->actimeo = HZ * option;
1895 if (vol->actimeo > CIFS_MAX_ACTIMEO) {
1906 vol->handle_timeout = option;
1907 if (vol->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) {
1918 vol->echo_interval = option;
1926 vol->snapshot_time = option;
1935 vol->max_credits = option;
1944 vol->max_channels = option;
1951 vol->nullauth = 1;
1952 vol->username = NULL;
1965 kfree(vol->username);
1966 vol->username = kstrdup(string, GFP_KERNEL);
1967 if (!vol->username)
1984 kfree_sensitive(vol->password);
1985 vol->password = NULL;
2022 kfree_sensitive(vol->password);
2025 vol->password = kzalloc(temp_len+1, GFP_KERNEL);
2026 if (vol->password == NULL) {
2032 vol->password[j] = value[i];
2038 vol->password[j] = '\0';
2067 kfree(vol->domainname);
2068 vol->domainname = kstrdup(string, GFP_KERNEL);
2069 if (!vol->domainname) {
2081 (struct sockaddr *)&vol->srcaddr,
2099 kfree(vol->iocharset);
2100 vol->iocharset = kstrdup(string,
2102 if (!vol->iocharset) {
2117 memset(vol->source_rfc1001_name, 0x20,
2128 vol->source_rfc1001_name[i] = string[i];
2143 memset(vol->target_rfc1001_name, 0x20,
2155 vol->target_rfc1001_name[i] = string[i];
2187 if (cifs_parse_smb_version(string, vol, is_smb3) != 0)
2196 if (cifs_parse_security_flavors(string, vol) != 0)
2204 if (cifs_parse_cache_flavor(string, vol) != 0)
2226 if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) {
2233 if (vol->multiuser) {
2238 if (!vol->UNC) {
2244 if (!strchr(vol->UNC + 3, '\\')) {
2255 slash = strchr(&vol->UNC[2], '\\');
2256 len = slash - &vol->UNC[2];
2257 if (!cifs_convert_address(dstaddr, &vol->UNC[2], len)) {
2267 vol->override_uid = override_uid;
2272 vol->override_gid = override_gid;
2393 match_security(struct TCP_Server_Info *server, struct smb_vol *vol)
2396 * The select_sectype function should either return the vol->sectype
2400 if (server->ops->select_sectype(server, vol->sectype)
2409 if (vol->sign && !server->sign)
2415 static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol)
2417 struct sockaddr *addr = (struct sockaddr *)&vol->dstaddr;
2419 if (vol->nosharesock)
2423 if (strcmp(vol->vals->version_string, SMB3ANY_VERSION_STRING) == 0) {
2426 } else if (strcmp(vol->vals->version_string,
2430 } else if ((server->vals != vol->vals) || (server->ops != vol->ops))
2437 (struct sockaddr *)&vol->srcaddr))
2443 if (!match_security(server, vol))
2446 if (server->echo_interval != vol->echo_interval * HZ)
2449 if (server->rdma != vol->rdma)
2452 if (server->ignore_signature != vol->ignore_signature)
2455 if (server->min_offload != vol->min_offload)
2462 cifs_find_tcp_session(struct smb_vol *vol)
2472 if (server->is_channel || !match_server(server, vol))
2680 static int match_session(struct cifs_ses *ses, struct smb_vol *vol)
2682 if (vol->sectype != Unspecified &&
2683 vol->sectype != ses->sectype)
2690 if (ses->chan_max < vol->max_channels)
2695 if (!uid_eq(vol->cred_uid, ses->cred_uid))
2701 if (!vol->nullauth)
2708 vol->username ? vol->username : "",
2711 if ((vol->username && strlen(vol->username) != 0) &&
2714 vol->password ? vol->password : "",
2810 cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
2818 if (!match_session(ses, vol))
2885 cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
2965 vol->username = kstrndup(payload, len, GFP_KERNEL);
2966 if (!vol->username) {
2972 cifs_dbg(FYI, "%s: username=%s\n", __func__, vol->username);
2978 kfree(vol->username);
2979 vol->username = NULL;
2984 vol->password = kstrndup(delim, len, GFP_KERNEL);
2985 if (!vol->password) {
2989 kfree(vol->username);
2990 vol->username = NULL;
2999 vol->domainname = kstrndup(ses->domainName,
3002 if (!vol->domainname) {
3006 kfree(vol->username);
3007 vol->username = NULL;
3008 kfree_sensitive(vol->password);
3009 vol->password = NULL;
3024 cifs_set_cifscreds(struct smb_vol *vol __attribute__((unused)),
3530 volume_info = mnt_data->vol;
4079 static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
4096 server = cifs_get_tcp_session(vol);
4105 ses = cifs_get_smb_ses(server, vol);
4113 if ((vol->persistent == true) && (!(ses->server->capabilities &
4120 tcon = cifs_get_tcon(ses, vol);
4138 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol);
4160 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol);
4161 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol);
4198 build_unc_path_to_root(const struct smb_vol *vol,
4202 unsigned int pplen = useppath && vol->prepath ?
4203 strlen(vol->prepath) + 1 : 0;
4204 unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
4213 memcpy(full_path, vol->UNC, unc_len);
4218 memcpy(pos + 1, vol->prepath, pplen);
4293 struct smb_vol *fake_vol, struct smb_vol *vol)
4304 kfree(vol->UNC);
4305 vol->UNC = new_unc;
4308 kfree(vol->prepath);
4309 vol->prepath = fake_vol->prepath;
4312 memcpy(&vol->dstaddr, &fake_vol->dstaddr, sizeof(vol->dstaddr));
4319 struct cifs_sb_info *cifs_sb, struct smb_vol *vol, unsigned int *xid,
4362 rc = update_vol_info(tgt_it, &fake_vol, vol);
4370 struct smb_vol *vol, struct cifs_ses *root_ses, unsigned int *xid,
4391 rc = setup_dfs_tgt_conn(path, full_path, tgt_it, cifs_sb, vol, xid, server, ses,
4520 static int is_path_remote(struct cifs_sb_info *cifs_sb, struct smb_vol *vol,
4534 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon,
4583 static int check_dfs_prepath(struct cifs_sb_info *cifs_sb, struct smb_vol *vol,
4594 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename);
4635 v.UNC = vol->UNC;
4653 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol)
4665 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon);
4673 if (dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), vol->UNC + 1, NULL,
4679 rc = is_path_remote(cifs_sb, vol, xid, server, tcon);
4692 ref_path = build_unc_path_to_root(vol, cifs_sb, false);
4703 full_path = build_unc_path_to_root(vol, cifs_sb, !!count);
4711 rc = expand_dfs_referral(xid, root_ses, vol, cifs_sb, ref_path + 1);
4717 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon);
4721 rc = do_dfs_failover(ref_path + 1, full_path, cifs_sb, vol, root_ses, &xid,
4734 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path);
4766 rc = dfs_cache_add_vol(mntdata, vol, cifs_sb->origin_fullpath);
4781 cifs_sb->prepath = vol->prepath;
4782 vol->prepath = NULL;
4799 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol)
4807 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon);
4812 rc = is_path_remote(cifs_sb, vol, xid, server, tcon);
5089 cifs_set_vol_auth(struct smb_vol *vol, struct cifs_ses *ses)
5091 vol->sectype = ses->sectype;
5094 if (vol->sectype == Kerberos)
5097 return cifs_set_cifscreds(vol, ses);