Lines Matching refs:vol

1323 cifs_parse_devname(const char *devname, struct smb_vol *vol)  in cifs_parse_devname()  argument
1352 vol->UNC = kstrndup(devname, pos - devname, GFP_KERNEL); in cifs_parse_devname()
1353 if (!vol->UNC) in cifs_parse_devname()
1356 convert_delimiter(vol->UNC, '\\'); in cifs_parse_devname()
1366 vol->prepath = kstrdup(pos, GFP_KERNEL); in cifs_parse_devname()
1367 if (!vol->prepath) in cifs_parse_devname()
1375 struct smb_vol *vol, bool is_smb3) in cifs_parse_mount_options() argument
1394 struct sockaddr *dstaddr = (struct sockaddr *)&vol->dstaddr; in cifs_parse_mount_options()
1401 memset(vol, 0, sizeof(*vol)); in cifs_parse_mount_options()
1408 memset(vol->source_rfc1001_name, 0x20, RFC1001_NAME_LEN); in cifs_parse_mount_options()
1410 vol->source_rfc1001_name[i] = toupper(nodename[i]); in cifs_parse_mount_options()
1412 vol->source_rfc1001_name[RFC1001_NAME_LEN] = 0; in cifs_parse_mount_options()
1415 vol->target_rfc1001_name[0] = 0; in cifs_parse_mount_options()
1416 vol->cred_uid = current_uid(); in cifs_parse_mount_options()
1417 vol->linux_uid = current_uid(); in cifs_parse_mount_options()
1418 vol->linux_gid = current_gid(); in cifs_parse_mount_options()
1419 vol->bsize = 1024 * 1024; /* can improve cp performance significantly */ in cifs_parse_mount_options()
1426 vol->remap = true; in cifs_parse_mount_options()
1429 vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; in cifs_parse_mount_options()
1433 vol->posix_paths = 1; in cifs_parse_mount_options()
1435 vol->server_ino = 1; in cifs_parse_mount_options()
1438 vol->strict_io = true; in cifs_parse_mount_options()
1440 vol->actimeo = CIFS_DEF_ACTIMEO; in cifs_parse_mount_options()
1443 vol->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */ in cifs_parse_mount_options()
1446 vol->ops = &smb30_operations; in cifs_parse_mount_options()
1447 vol->vals = &smbdefault_values; in cifs_parse_mount_options()
1449 vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; in cifs_parse_mount_options()
1452 vol->multichannel = false; in cifs_parse_mount_options()
1453 vol->max_channels = 1; in cifs_parse_mount_options()
1473 vol->backupuid_specified = false; /* no backup intent for a user */ in cifs_parse_mount_options()
1474 vol->backupgid_specified = false; /* no backup intent for a group */ in cifs_parse_mount_options()
1476 switch (cifs_parse_devname(devname, vol)) { in cifs_parse_mount_options()
1508 vol->no_xattr = 0; in cifs_parse_mount_options()
1511 vol->no_xattr = 1; in cifs_parse_mount_options()
1526 vol->noblocksnd = 1; in cifs_parse_mount_options()
1529 vol->noautotune = 1; in cifs_parse_mount_options()
1532 vol->no_lease = 1; in cifs_parse_mount_options()
1535 vol->retry = 1; in cifs_parse_mount_options()
1538 vol->retry = 0; in cifs_parse_mount_options()
1541 vol->noperm = 0; in cifs_parse_mount_options()
1544 vol->noperm = 1; in cifs_parse_mount_options()
1547 vol->nodelete = 1; in cifs_parse_mount_options()
1550 vol->sfu_remap = true; in cifs_parse_mount_options()
1551 vol->remap = false; /* disable SFM mapping */ in cifs_parse_mount_options()
1554 vol->sfu_remap = false; in cifs_parse_mount_options()
1557 vol->remap = true; in cifs_parse_mount_options()
1558 vol->sfu_remap = false; /* disable SFU mapping */ in cifs_parse_mount_options()
1561 vol->remap = false; in cifs_parse_mount_options()
1564 vol->sfu_emul = 1; in cifs_parse_mount_options()
1567 vol->sfu_emul = 0; in cifs_parse_mount_options()
1570 vol->nodfs = 1; in cifs_parse_mount_options()
1574 vol->rootfs = true; in cifs_parse_mount_options()
1578 vol->posix_paths = 1; in cifs_parse_mount_options()
1581 vol->posix_paths = 0; in cifs_parse_mount_options()
1584 if (vol->linux_ext) in cifs_parse_mount_options()
1587 vol->no_linux_ext = 1; in cifs_parse_mount_options()
1590 if (vol->no_linux_ext) in cifs_parse_mount_options()
1593 vol->linux_ext = 1; in cifs_parse_mount_options()
1596 vol->nocase = 1; in cifs_parse_mount_options()
1599 vol->nobrl = 0; in cifs_parse_mount_options()
1602 vol->nobrl = 1; in cifs_parse_mount_options()
1608 if (vol->file_mode == in cifs_parse_mount_options()
1610 vol->file_mode = S_IALLUGO; in cifs_parse_mount_options()
1613 vol->nohandlecache = 1; in cifs_parse_mount_options()
1616 vol->nohandlecache = 0; in cifs_parse_mount_options()
1619 vol->mand_lock = 1; in cifs_parse_mount_options()
1622 vol->setuids = 1; in cifs_parse_mount_options()
1625 vol->setuids = 0; in cifs_parse_mount_options()
1628 vol->setuidfromacl = 1; in cifs_parse_mount_options()
1631 vol->dynperm = true; in cifs_parse_mount_options()
1634 vol->dynperm = false; in cifs_parse_mount_options()
1637 vol->retry = 0; in cifs_parse_mount_options()
1640 vol->retry = 1; in cifs_parse_mount_options()
1643 vol->intr = 0; in cifs_parse_mount_options()
1646 vol->intr = 1; in cifs_parse_mount_options()
1649 vol->nostrictsync = 1; in cifs_parse_mount_options()
1652 vol->nostrictsync = 0; in cifs_parse_mount_options()
1655 vol->server_ino = 1; in cifs_parse_mount_options()
1658 vol->server_ino = 0; in cifs_parse_mount_options()
1661 vol->rwpidforward = 1; in cifs_parse_mount_options()
1664 vol->mode_ace = 1; in cifs_parse_mount_options()
1667 vol->cifs_acl = 1; in cifs_parse_mount_options()
1670 vol->cifs_acl = 0; in cifs_parse_mount_options()
1673 vol->no_psx_acl = 0; in cifs_parse_mount_options()
1676 vol->no_psx_acl = 1; in cifs_parse_mount_options()
1679 vol->local_lease = 1; in cifs_parse_mount_options()
1682 vol->sign = true; in cifs_parse_mount_options()
1685 vol->sign = true; in cifs_parse_mount_options()
1686 vol->ignore_signature = true; in cifs_parse_mount_options()
1694 vol->seal = 1; in cifs_parse_mount_options()
1704 vol->fsc = true; in cifs_parse_mount_options()
1707 vol->mfsymlinks = true; in cifs_parse_mount_options()
1710 vol->multiuser = true; in cifs_parse_mount_options()
1716 vol->nosharesock = true; in cifs_parse_mount_options()
1719 vol->nopersistent = true; in cifs_parse_mount_options()
1720 if (vol->persistent) { in cifs_parse_mount_options()
1727 vol->persistent = true; in cifs_parse_mount_options()
1728 if ((vol->nopersistent) || (vol->resilient)) { in cifs_parse_mount_options()
1735 vol->resilient = true; in cifs_parse_mount_options()
1736 if (vol->persistent) { in cifs_parse_mount_options()
1743 vol->resilient = false; /* already the default */ in cifs_parse_mount_options()
1746 vol->domainauto = true; in cifs_parse_mount_options()
1749 vol->rdma = true; in cifs_parse_mount_options()
1752 vol->multichannel = true; in cifs_parse_mount_options()
1754 if (vol->max_channels < 2) in cifs_parse_mount_options()
1755 vol->max_channels = 2; in cifs_parse_mount_options()
1758 vol->multichannel = false; in cifs_parse_mount_options()
1759 vol->max_channels = 1; in cifs_parse_mount_options()
1762 vol->compression = UNKNOWN_TYPE; in cifs_parse_mount_options()
1769 if (get_option_uid(args, &vol->backupuid)) { in cifs_parse_mount_options()
1774 vol->backupuid_specified = true; in cifs_parse_mount_options()
1777 if (get_option_gid(args, &vol->backupgid)) { in cifs_parse_mount_options()
1782 vol->backupgid_specified = true; in cifs_parse_mount_options()
1785 if (get_option_uid(args, &vol->linux_uid)) { in cifs_parse_mount_options()
1793 if (get_option_uid(args, &vol->cred_uid)) { in cifs_parse_mount_options()
1800 if (get_option_gid(args, &vol->linux_gid)) { in cifs_parse_mount_options()
1813 vol->file_mode = option; in cifs_parse_mount_options()
1821 vol->dir_mode = option; in cifs_parse_mount_options()
1837 vol->min_offload = option; in cifs_parse_mount_options()
1857 vol->bsize = option; in cifs_parse_mount_options()
1865 vol->rsize = option; in cifs_parse_mount_options()
1873 vol->wsize = option; in cifs_parse_mount_options()
1881 vol->actimeo = HZ * option; in cifs_parse_mount_options()
1882 if (vol->actimeo > CIFS_MAX_ACTIMEO) { in cifs_parse_mount_options()
1893 vol->handle_timeout = option; in cifs_parse_mount_options()
1894 if (vol->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) { in cifs_parse_mount_options()
1905 vol->echo_interval = option; in cifs_parse_mount_options()
1913 vol->snapshot_time = option; in cifs_parse_mount_options()
1922 vol->max_credits = option; in cifs_parse_mount_options()
1931 vol->max_channels = option; in cifs_parse_mount_options()
1938 vol->nullauth = 1; in cifs_parse_mount_options()
1939 vol->username = NULL; in cifs_parse_mount_options()
1952 kfree(vol->username); in cifs_parse_mount_options()
1953 vol->username = kstrdup(string, GFP_KERNEL); in cifs_parse_mount_options()
1954 if (!vol->username) in cifs_parse_mount_options()
1971 kfree_sensitive(vol->password); in cifs_parse_mount_options()
1972 vol->password = NULL; in cifs_parse_mount_options()
2009 kfree_sensitive(vol->password); in cifs_parse_mount_options()
2012 vol->password = kzalloc(temp_len+1, GFP_KERNEL); in cifs_parse_mount_options()
2013 if (vol->password == NULL) { in cifs_parse_mount_options()
2019 vol->password[j] = value[i]; in cifs_parse_mount_options()
2025 vol->password[j] = '\0'; in cifs_parse_mount_options()
2054 kfree(vol->domainname); in cifs_parse_mount_options()
2055 vol->domainname = kstrdup(string, GFP_KERNEL); in cifs_parse_mount_options()
2056 if (!vol->domainname) { in cifs_parse_mount_options()
2068 (struct sockaddr *)&vol->srcaddr, in cifs_parse_mount_options()
2086 kfree(vol->iocharset); in cifs_parse_mount_options()
2087 vol->iocharset = kstrdup(string, in cifs_parse_mount_options()
2089 if (!vol->iocharset) { in cifs_parse_mount_options()
2104 memset(vol->source_rfc1001_name, 0x20, in cifs_parse_mount_options()
2115 vol->source_rfc1001_name[i] = string[i]; in cifs_parse_mount_options()
2130 memset(vol->target_rfc1001_name, 0x20, in cifs_parse_mount_options()
2142 vol->target_rfc1001_name[i] = string[i]; in cifs_parse_mount_options()
2174 if (cifs_parse_smb_version(string, vol, is_smb3) != 0) in cifs_parse_mount_options()
2183 if (cifs_parse_security_flavors(string, vol) != 0) in cifs_parse_mount_options()
2191 if (cifs_parse_cache_flavor(string, vol) != 0) in cifs_parse_mount_options()
2213 if (vol->rdma && vol->vals->protocol_id < SMB30_PROT_ID) { in cifs_parse_mount_options()
2220 if (vol->multiuser) { in cifs_parse_mount_options()
2225 if (!vol->UNC) { in cifs_parse_mount_options()
2231 if (!strchr(vol->UNC + 3, '\\')) { in cifs_parse_mount_options()
2242 slash = strchr(&vol->UNC[2], '\\'); in cifs_parse_mount_options()
2243 len = slash - &vol->UNC[2]; in cifs_parse_mount_options()
2244 if (!cifs_convert_address(dstaddr, &vol->UNC[2], len)) { in cifs_parse_mount_options()
2254 vol->override_uid = override_uid; in cifs_parse_mount_options()
2259 vol->override_gid = override_gid; in cifs_parse_mount_options()
2380 match_security(struct TCP_Server_Info *server, struct smb_vol *vol) in match_security() argument
2387 if (server->ops->select_sectype(server, vol->sectype) in match_security()
2396 if (vol->sign && !server->sign) in match_security()
2402 static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol) in match_server() argument
2404 struct sockaddr *addr = (struct sockaddr *)&vol->dstaddr; in match_server()
2406 if (vol->nosharesock) in match_server()
2410 if (strcmp(vol->vals->version_string, SMB3ANY_VERSION_STRING) == 0) { in match_server()
2413 } else if (strcmp(vol->vals->version_string, in match_server()
2417 } else if ((server->vals != vol->vals) || (server->ops != vol->ops)) in match_server()
2424 (struct sockaddr *)&vol->srcaddr)) in match_server()
2430 if (!match_security(server, vol)) in match_server()
2433 if (server->echo_interval != vol->echo_interval * HZ) in match_server()
2436 if (server->rdma != vol->rdma) in match_server()
2439 if (server->ignore_signature != vol->ignore_signature) in match_server()
2442 if (server->min_offload != vol->min_offload) in match_server()
2449 cifs_find_tcp_session(struct smb_vol *vol) in cifs_find_tcp_session() argument
2459 if (server->is_channel || !match_server(server, vol)) in cifs_find_tcp_session()
2662 static int match_session(struct cifs_ses *ses, struct smb_vol *vol) in match_session() argument
2664 if (vol->sectype != Unspecified && in match_session()
2665 vol->sectype != ses->sectype) in match_session()
2672 if (ses->chan_max < vol->max_channels) in match_session()
2677 if (!uid_eq(vol->cred_uid, ses->cred_uid)) in match_session()
2683 if (!vol->nullauth) in match_session()
2690 vol->username ? vol->username : "", in match_session()
2693 if ((vol->username && strlen(vol->username) != 0) && in match_session()
2696 vol->password ? vol->password : "", in match_session()
2792 cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) in cifs_find_smb_ses() argument
2800 if (!match_session(ses, vol)) in cifs_find_smb_ses()
2864 cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses) in cifs_set_cifscreds() argument
2944 vol->username = kstrndup(payload, len, GFP_KERNEL); in cifs_set_cifscreds()
2945 if (!vol->username) { in cifs_set_cifscreds()
2951 cifs_dbg(FYI, "%s: username=%s\n", __func__, vol->username); in cifs_set_cifscreds()
2957 kfree(vol->username); in cifs_set_cifscreds()
2958 vol->username = NULL; in cifs_set_cifscreds()
2963 vol->password = kstrndup(delim, len, GFP_KERNEL); in cifs_set_cifscreds()
2964 if (!vol->password) { in cifs_set_cifscreds()
2968 kfree(vol->username); in cifs_set_cifscreds()
2969 vol->username = NULL; in cifs_set_cifscreds()
2978 vol->domainname = kstrndup(ses->domainName, in cifs_set_cifscreds()
2981 if (!vol->domainname) { in cifs_set_cifscreds()
2985 kfree(vol->username); in cifs_set_cifscreds()
2986 vol->username = NULL; in cifs_set_cifscreds()
2987 kfree_sensitive(vol->password); in cifs_set_cifscreds()
2988 vol->password = NULL; in cifs_set_cifscreds()
3003 cifs_set_cifscreds(struct smb_vol *vol __attribute__((unused)), in cifs_set_cifscreds() argument
3506 volume_info = mnt_data->vol; in cifs_match_super()
4054 static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, in mount_get_conns() argument
4071 server = cifs_get_tcp_session(vol); in mount_get_conns()
4079 if ((vol->max_credits < 20) || (vol->max_credits > 60000)) in mount_get_conns()
4082 server->max_credits = vol->max_credits; in mount_get_conns()
4085 ses = cifs_get_smb_ses(server, vol); in mount_get_conns()
4093 if ((vol->persistent == true) && (!(ses->server->capabilities & in mount_get_conns()
4100 tcon = cifs_get_tcon(ses, vol); in mount_get_conns()
4118 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4140 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4141 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4178 build_unc_path_to_root(const struct smb_vol *vol, in build_unc_path_to_root() argument
4182 unsigned int pplen = useppath && vol->prepath ? in build_unc_path_to_root()
4183 strlen(vol->prepath) + 1 : 0; in build_unc_path_to_root()
4184 unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1); in build_unc_path_to_root()
4193 memcpy(full_path, vol->UNC, unc_len); in build_unc_path_to_root()
4198 memcpy(pos + 1, vol->prepath, pplen); in build_unc_path_to_root()
4273 struct smb_vol *fake_vol, struct smb_vol *vol) in update_vol_info() argument
4284 kfree(vol->UNC); in update_vol_info()
4285 vol->UNC = new_unc; in update_vol_info()
4288 kfree(vol->prepath); in update_vol_info()
4289 vol->prepath = fake_vol->prepath; in update_vol_info()
4292 memcpy(&vol->dstaddr, &fake_vol->dstaddr, sizeof(vol->dstaddr)); in update_vol_info()
4299 struct cifs_sb_info *cifs_sb, struct smb_vol *vol, unsigned int *xid, in setup_dfs_tgt_conn() argument
4342 rc = update_vol_info(tgt_it, &fake_vol, vol); in setup_dfs_tgt_conn()
4350 struct smb_vol *vol, struct cifs_ses *root_ses, unsigned int *xid, in do_dfs_failover() argument
4371 rc = setup_dfs_tgt_conn(path, full_path, tgt_it, cifs_sb, vol, xid, server, ses, in do_dfs_failover()
4500 static int is_path_remote(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in is_path_remote() argument
4514 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4563 static int check_dfs_prepath(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in check_dfs_prepath() argument
4574 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename); in check_dfs_prepath()
4615 v.UNC = vol->UNC; in check_dfs_prepath()
4633 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4645 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4653 if (dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), vol->UNC + 1, NULL, in cifs_mount()
4659 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4672 ref_path = build_unc_path_to_root(vol, cifs_sb, false); in cifs_mount()
4683 full_path = build_unc_path_to_root(vol, cifs_sb, !!count); in cifs_mount()
4691 rc = expand_dfs_referral(xid, root_ses, vol, cifs_sb, ref_path + 1); in cifs_mount()
4697 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4701 rc = do_dfs_failover(ref_path + 1, full_path, cifs_sb, vol, root_ses, &xid, in cifs_mount()
4714 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path); in cifs_mount()
4746 rc = dfs_cache_add_vol(mntdata, vol, cifs_sb->origin_fullpath); in cifs_mount()
4761 cifs_sb->prepath = vol->prepath; in cifs_mount()
4762 vol->prepath = NULL; in cifs_mount()
4779 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4787 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4792 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
5069 cifs_set_vol_auth(struct smb_vol *vol, struct cifs_ses *ses) in cifs_set_vol_auth() argument
5071 vol->sectype = ses->sectype; in cifs_set_vol_auth()
5074 if (vol->sectype == Kerberos) in cifs_set_vol_auth()
5077 return cifs_set_cifscreds(vol, ses); in cifs_set_vol_auth()