Lines Matching refs:vol
1336 cifs_parse_devname(const char *devname, struct smb_vol *vol) in cifs_parse_devname() argument
1365 vol->UNC = kstrndup(devname, pos - devname, GFP_KERNEL); in cifs_parse_devname()
1366 if (!vol->UNC) in cifs_parse_devname()
1369 convert_delimiter(vol->UNC, '\\'); in cifs_parse_devname()
1379 vol->prepath = kstrdup(pos, GFP_KERNEL); in cifs_parse_devname()
1380 if (!vol->prepath) in cifs_parse_devname()
1388 struct smb_vol *vol, bool is_smb3) in cifs_parse_mount_options() argument
1407 struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr; in cifs_parse_mount_options()
1414 memset(vol, 0, sizeof(*vol)); in cifs_parse_mount_options()
1421 memset(vol->source_rfc1001_name, 0x20, RFC1001_NAME_LEN); in cifs_parse_mount_options()
1423 vol->source_rfc1001_name[i] = toupper(nodename[i]); in cifs_parse_mount_options()
1425 vol->source_rfc1001_name[RFC1001_NAME_LEN] = 0; in cifs_parse_mount_options()
1428 vol->target_rfc1001_name[0] = 0; in cifs_parse_mount_options()
1429 vol->cred_uid = current_uid(); in cifs_parse_mount_options()
1430 vol->linux_uid = current_uid(); in cifs_parse_mount_options()
1431 vol->linux_gid = current_gid(); in cifs_parse_mount_options()
1432 vol->bsize = 1024 * 1024; /* can improve cp performance significantly */ in cifs_parse_mount_options()
1439 vol->remap = true; in cifs_parse_mount_options()
1442 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; in cifs_parse_mount_options()
1446 vol->posix_paths = 1; in cifs_parse_mount_options()
1448 vol->server_ino = 1; in cifs_parse_mount_options()
1451 vol->strict_io = true; in cifs_parse_mount_options()
1453 vol->actimeo = CIFS_DEF_ACTIMEO; in cifs_parse_mount_options()
1456 vol->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */ in cifs_parse_mount_options()
1459 vol->ops = &smb30_operations; in cifs_parse_mount_options()
1460 vol->vals = &smbdefault_values; in cifs_parse_mount_options()
1462 vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; in cifs_parse_mount_options()
1465 vol->multichannel = false; in cifs_parse_mount_options()
1466 vol->max_channels = 1; in cifs_parse_mount_options()
1486 vol->backupuid_specified = false; /* no backup intent for a user */ in cifs_parse_mount_options()
1487 vol->backupgid_specified = false; /* no backup intent for a group */ in cifs_parse_mount_options()
1489 switch (cifs_parse_devname(devname, vol)) { in cifs_parse_mount_options()
1521 vol->no_xattr = 0; in cifs_parse_mount_options()
1524 vol->no_xattr = 1; in cifs_parse_mount_options()
1539 vol->noblocksnd = 1; in cifs_parse_mount_options()
1542 vol->noautotune = 1; in cifs_parse_mount_options()
1545 vol->no_lease = 1; in cifs_parse_mount_options()
1548 vol->retry = 1; in cifs_parse_mount_options()
1551 vol->retry = 0; in cifs_parse_mount_options()
1554 vol->noperm = 0; in cifs_parse_mount_options()
1557 vol->noperm = 1; in cifs_parse_mount_options()
1560 vol->nodelete = 1; in cifs_parse_mount_options()
1563 vol->sfu_remap = true; in cifs_parse_mount_options()
1564 vol->remap = false; /* disable SFM mapping */ in cifs_parse_mount_options()
1567 vol->sfu_remap = false; in cifs_parse_mount_options()
1570 vol->remap = true; in cifs_parse_mount_options()
1571 vol->sfu_remap = false; /* disable SFU mapping */ in cifs_parse_mount_options()
1574 vol->remap = false; in cifs_parse_mount_options()
1577 vol->sfu_emul = 1; in cifs_parse_mount_options()
1580 vol->sfu_emul = 0; in cifs_parse_mount_options()
1583 vol->nodfs = 1; in cifs_parse_mount_options()
1587 vol->rootfs = true; in cifs_parse_mount_options()
1591 vol->posix_paths = 1; in cifs_parse_mount_options()
1594 vol->posix_paths = 0; in cifs_parse_mount_options()
1597 if (vol->linux_ext) in cifs_parse_mount_options()
1600 vol->no_linux_ext = 1; in cifs_parse_mount_options()
1603 if (vol->no_linux_ext) in cifs_parse_mount_options()
1606 vol->linux_ext = 1; in cifs_parse_mount_options()
1609 vol->nocase = 1; in cifs_parse_mount_options()
1612 vol->nobrl = 0; in cifs_parse_mount_options()
1615 vol->nobrl = 1; in cifs_parse_mount_options()
1621 if (vol->file_mode == in cifs_parse_mount_options()
1623 vol->file_mode = S_IALLUGO; in cifs_parse_mount_options()
1626 vol->nohandlecache = 1; in cifs_parse_mount_options()
1629 vol->nohandlecache = 0; in cifs_parse_mount_options()
1632 vol->mand_lock = 1; in cifs_parse_mount_options()
1635 vol->setuids = 1; in cifs_parse_mount_options()
1638 vol->setuids = 0; in cifs_parse_mount_options()
1641 vol->setuidfromacl = 1; in cifs_parse_mount_options()
1644 vol->dynperm = true; in cifs_parse_mount_options()
1647 vol->dynperm = false; in cifs_parse_mount_options()
1650 vol->retry = 0; in cifs_parse_mount_options()
1653 vol->retry = 1; in cifs_parse_mount_options()
1656 vol->intr = 0; in cifs_parse_mount_options()
1659 vol->intr = 1; in cifs_parse_mount_options()
1662 vol->nostrictsync = 1; in cifs_parse_mount_options()
1665 vol->nostrictsync = 0; in cifs_parse_mount_options()
1668 vol->server_ino = 1; in cifs_parse_mount_options()
1671 vol->server_ino = 0; in cifs_parse_mount_options()
1674 vol->rwpidforward = 1; in cifs_parse_mount_options()
1677 vol->mode_ace = 1; in cifs_parse_mount_options()
1680 vol->cifs_acl = 1; in cifs_parse_mount_options()
1683 vol->cifs_acl = 0; in cifs_parse_mount_options()
1686 vol->no_psx_acl = 0; in cifs_parse_mount_options()
1689 vol->no_psx_acl = 1; in cifs_parse_mount_options()
1692 vol->local_lease = 1; in cifs_parse_mount_options()
1695 vol->sign = true; in cifs_parse_mount_options()
1698 vol->sign = true; in cifs_parse_mount_options()
1699 vol->ignore_signature = true; in cifs_parse_mount_options()
1707 vol->seal = 1; in cifs_parse_mount_options()
1717 vol->fsc = true; in cifs_parse_mount_options()
1720 vol->mfsymlinks = true; in cifs_parse_mount_options()
1723 vol->multiuser = true; in cifs_parse_mount_options()
1729 vol->nosharesock = true; in cifs_parse_mount_options()
1732 vol->nopersistent = true; in cifs_parse_mount_options()
1733 if (vol->persistent) { in cifs_parse_mount_options()
1740 vol->persistent = true; in cifs_parse_mount_options()
1741 if ((vol->nopersistent) || (vol->resilient)) { in cifs_parse_mount_options()
1748 vol->resilient = true; in cifs_parse_mount_options()
1749 if (vol->persistent) { in cifs_parse_mount_options()
1756 vol->resilient = false; /* already the default */ in cifs_parse_mount_options()
1759 vol->domainauto = true; in cifs_parse_mount_options()
1762 vol->rdma = true; in cifs_parse_mount_options()
1765 vol->multichannel = true; in cifs_parse_mount_options()
1767 if (vol->max_channels < 2) in cifs_parse_mount_options()
1768 vol->max_channels = 2; in cifs_parse_mount_options()
1771 vol->multichannel = false; in cifs_parse_mount_options()
1772 vol->max_channels = 1; in cifs_parse_mount_options()
1775 vol->compression = UNKNOWN_TYPE; in cifs_parse_mount_options()
1782 if (get_option_uid(args, &vol->backupuid)) { in cifs_parse_mount_options()
1787 vol->backupuid_specified = true; in cifs_parse_mount_options()
1790 if (get_option_gid(args, &vol->backupgid)) { in cifs_parse_mount_options()
1795 vol->backupgid_specified = true; in cifs_parse_mount_options()
1798 if (get_option_uid(args, &vol->linux_uid)) { in cifs_parse_mount_options()
1806 if (get_option_uid(args, &vol->cred_uid)) { in cifs_parse_mount_options()
1813 if (get_option_gid(args, &vol->linux_gid)) { in cifs_parse_mount_options()
1826 vol->file_mode = option; in cifs_parse_mount_options()
1834 vol->dir_mode = option; in cifs_parse_mount_options()
1850 vol->min_offload = option; in cifs_parse_mount_options()
1870 vol->bsize = option; in cifs_parse_mount_options()
1878 vol->rsize = option; in cifs_parse_mount_options()
1886 vol->wsize = option; in cifs_parse_mount_options()
1894 vol->actimeo = HZ * option; in cifs_parse_mount_options()
1895 if (vol->actimeo > CIFS_MAX_ACTIMEO) { in cifs_parse_mount_options()
1906 vol->handle_timeout = option; in cifs_parse_mount_options()
1907 if (vol->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) { in cifs_parse_mount_options()
1918 vol->echo_interval = option; in cifs_parse_mount_options()
1926 vol->snapshot_time = option; in cifs_parse_mount_options()
1935 vol->max_credits = option; in cifs_parse_mount_options()
1944 vol->max_channels = option; in cifs_parse_mount_options()
1951 vol->nullauth = 1; in cifs_parse_mount_options()
1952 vol->username = NULL; in cifs_parse_mount_options()
1965 kfree(vol->username); in cifs_parse_mount_options()
1966 vol->username = kstrdup(string, GFP_KERNEL); in cifs_parse_mount_options()
1967 if (!vol->username) in cifs_parse_mount_options()
1984 kfree_sensitive(vol->password); in cifs_parse_mount_options()
1985 vol->password = NULL; in cifs_parse_mount_options()
2022 kfree_sensitive(vol->password); in cifs_parse_mount_options()
2025 vol->password = kzalloc(temp_len+1, GFP_KERNEL); in cifs_parse_mount_options()
2026 if (vol->password == NULL) { in cifs_parse_mount_options()
2032 vol->password[j] = value[i]; in cifs_parse_mount_options()
2038 vol->password[j] = '\0'; in cifs_parse_mount_options()
2067 kfree(vol->domainname); in cifs_parse_mount_options()
2068 vol->domainname = kstrdup(string, GFP_KERNEL); in cifs_parse_mount_options()
2069 if (!vol->domainname) { in cifs_parse_mount_options()
2081 (struct sockaddr *)&vol->srcaddr, in cifs_parse_mount_options()
2099 kfree(vol->iocharset); in cifs_parse_mount_options()
2100 vol->iocharset = kstrdup(string, in cifs_parse_mount_options()
2102 if (!vol->iocharset) { in cifs_parse_mount_options()
2117 memset(vol->source_rfc1001_name, 0x20, in cifs_parse_mount_options()
2128 vol->source_rfc1001_name[i] = string[i]; in cifs_parse_mount_options()
2143 memset(vol->target_rfc1001_name, 0x20, in cifs_parse_mount_options()
2155 vol->target_rfc1001_name[i] = string[i]; in cifs_parse_mount_options()
2187 if (cifs_parse_smb_version(string, vol, is_smb3) != 0) in cifs_parse_mount_options()
2196 if (cifs_parse_security_flavors(string, vol) != 0) in cifs_parse_mount_options()
2204 if (cifs_parse_cache_flavor(string, vol) != 0) in cifs_parse_mount_options()
2226 if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) { in cifs_parse_mount_options()
2233 if (vol->multiuser) { in cifs_parse_mount_options()
2238 if (!vol->UNC) { in cifs_parse_mount_options()
2244 if (!strchr(vol->UNC + 3, '\\')) { in cifs_parse_mount_options()
2255 slash = strchr(&vol->UNC[2], '\\'); in cifs_parse_mount_options()
2256 len = slash - &vol->UNC[2]; in cifs_parse_mount_options()
2257 if (!cifs_convert_address(dstaddr, &vol->UNC[2], len)) { in cifs_parse_mount_options()
2267 vol->override_uid = override_uid; in cifs_parse_mount_options()
2272 vol->override_gid = override_gid; in cifs_parse_mount_options()
2393 match_security(struct TCP_Server_Info *server, struct smb_vol *vol) in match_security() argument
2400 if (server->ops->select_sectype(server, vol->sectype) in match_security()
2409 if (vol->sign && !server->sign) in match_security()
2415 static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol) in match_server() argument
2417 struct sockaddr *addr = (struct sockaddr *)&vol->dstaddr; in match_server()
2419 if (vol->nosharesock) in match_server()
2423 if (strcmp(vol->vals->version_string, SMB3ANY_VERSION_STRING) == 0) { in match_server()
2426 } else if (strcmp(vol->vals->version_string, in match_server()
2430 } else if ((server->vals != vol->vals) || (server->ops != vol->ops)) in match_server()
2437 (struct sockaddr *)&vol->srcaddr)) in match_server()
2443 if (!match_security(server, vol)) in match_server()
2446 if (server->echo_interval != vol->echo_interval * HZ) in match_server()
2449 if (server->rdma != vol->rdma) in match_server()
2452 if (server->ignore_signature != vol->ignore_signature) in match_server()
2455 if (server->min_offload != vol->min_offload) in match_server()
2462 cifs_find_tcp_session(struct smb_vol *vol) in cifs_find_tcp_session() argument
2472 if (server->is_channel || !match_server(server, vol)) in cifs_find_tcp_session()
2680 static int match_session(struct cifs_ses *ses, struct smb_vol *vol) in match_session() argument
2682 if (vol->sectype != Unspecified && in match_session()
2683 vol->sectype != ses->sectype) in match_session()
2690 if (ses->chan_max < vol->max_channels) in match_session()
2695 if (!uid_eq(vol->cred_uid, ses->cred_uid)) in match_session()
2701 if (!vol->nullauth) in match_session()
2708 vol->username ? vol->username : "", in match_session()
2711 if ((vol->username && strlen(vol->username) != 0) && in match_session()
2714 vol->password ? vol->password : "", in match_session()
2810 cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) in cifs_find_smb_ses() argument
2818 if (!match_session(ses, vol)) in cifs_find_smb_ses()
2885 cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) in cifs_set_cifscreds() argument
2965 vol->username = kstrndup(payload, len, GFP_KERNEL); in cifs_set_cifscreds()
2966 if (!vol->username) { in cifs_set_cifscreds()
2972 cifs_dbg(FYI, "%s: username=%s\n", __func__, vol->username); in cifs_set_cifscreds()
2978 kfree(vol->username); in cifs_set_cifscreds()
2979 vol->username = NULL; in cifs_set_cifscreds()
2984 vol->password = kstrndup(delim, len, GFP_KERNEL); in cifs_set_cifscreds()
2985 if (!vol->password) { in cifs_set_cifscreds()
2989 kfree(vol->username); in cifs_set_cifscreds()
2990 vol->username = NULL; in cifs_set_cifscreds()
2999 vol->domainname = kstrndup(ses->domainName, in cifs_set_cifscreds()
3002 if (!vol->domainname) { in cifs_set_cifscreds()
3006 kfree(vol->username); in cifs_set_cifscreds()
3007 vol->username = NULL; in cifs_set_cifscreds()
3008 kfree_sensitive(vol->password); in cifs_set_cifscreds()
3009 vol->password = NULL; in cifs_set_cifscreds()
3024 cifs_set_cifscreds(struct smb_vol *vol __attribute__((unused)), in cifs_set_cifscreds() argument
3528 volume_info = mnt_data->vol; in cifs_match_super()
4077 static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, in mount_get_conns() argument
4094 server = cifs_get_tcp_session(vol); in mount_get_conns()
4103 ses = cifs_get_smb_ses(server, vol); in mount_get_conns()
4111 if ((vol->persistent == true) && (!(ses->server->capabilities & in mount_get_conns()
4118 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4136 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4158 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4159 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4196 build_unc_path_to_root(const struct smb_vol *vol, in build_unc_path_to_root() argument
4200 unsigned int pplen = useppath && vol->prepath ? in build_unc_path_to_root()
4201 strlen(vol->prepath) + 1 : 0; in build_unc_path_to_root()
4202 unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1); in build_unc_path_to_root()
4211 memcpy(full_path, vol->UNC, unc_len); in build_unc_path_to_root()
4216 memcpy(pos + 1, vol->prepath, pplen); in build_unc_path_to_root()
4291 struct smb_vol *fake_vol, struct smb_vol *vol) in update_vol_info() argument
4302 kfree(vol->UNC); in update_vol_info()
4303 vol->UNC = new_unc; in update_vol_info()
4306 kfree(vol->prepath); in update_vol_info()
4307 vol->prepath = fake_vol->prepath; in update_vol_info()
4310 memcpy(&vol->dstaddr, &fake_vol->dstaddr, sizeof(vol->dstaddr)); in update_vol_info()
4317 struct cifs_sb_info *cifs_sb, struct smb_vol *vol, unsigned int *xid, in setup_dfs_tgt_conn() argument
4360 rc = update_vol_info(tgt_it, &fake_vol, vol); in setup_dfs_tgt_conn()
4368 struct smb_vol *vol, struct cifs_ses *root_ses, unsigned int *xid, in do_dfs_failover() argument
4389 rc = setup_dfs_tgt_conn(path, full_path, tgt_it, cifs_sb, vol, xid, server, ses, in do_dfs_failover()
4518 static int is_path_remote(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in is_path_remote() argument
4532 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4581 static int check_dfs_prepath(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in check_dfs_prepath() argument
4592 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename); in check_dfs_prepath()
4633 v.UNC = vol->UNC; in check_dfs_prepath()
4651 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4663 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4671 if (dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), vol->UNC + 1, NULL, in cifs_mount()
4677 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4690 ref_path = build_unc_path_to_root(vol, cifs_sb, false); in cifs_mount()
4701 full_path = build_unc_path_to_root(vol, cifs_sb, !!count); in cifs_mount()
4709 rc = expand_dfs_referral(xid, root_ses, vol, cifs_sb, ref_path + 1); in cifs_mount()
4715 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4719 rc = do_dfs_failover(ref_path + 1, full_path, cifs_sb, vol, root_ses, &xid, in cifs_mount()
4732 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path); in cifs_mount()
4764 rc = dfs_cache_add_vol(mntdata, vol, cifs_sb->origin_fullpath); in cifs_mount()
4779 cifs_sb->prepath = vol->prepath; in cifs_mount()
4780 vol->prepath = NULL; in cifs_mount()
4797 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4805 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4810 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
5087 cifs_set_vol_auth(struct smb_vol *vol, struct cifs_ses *ses) in cifs_set_vol_auth() argument
5089 vol->sectype = ses->sectype; in cifs_set_vol_auth()
5092 if (vol->sectype == Kerberos) in cifs_set_vol_auth()
5095 return cifs_set_cifscreds(vol, ses); in cifs_set_vol_auth()