Lines Matching refs:cifs_sb
341 struct cifs_sb_info *cifs_sb, in reconn_set_next_dfs_target() argument
347 if (!cifs_sb || !cifs_sb->origin_fullpath) in reconn_set_next_dfs_target()
358 cifs_dbg(FYI, "%s: UNC: %s\n", __func__, cifs_sb->origin_fullpath); in reconn_set_next_dfs_target()
372 static inline int reconn_setup_dfs_targets(struct cifs_sb_info *cifs_sb, in reconn_setup_dfs_targets() argument
375 if (!cifs_sb->origin_fullpath) in reconn_setup_dfs_targets()
377 return dfs_cache_noreq_find(cifs_sb->origin_fullpath + 1, NULL, tl); in reconn_setup_dfs_targets()
400 struct cifs_sb_info *cifs_sb = NULL; in cifs_reconnect() local
416 cifs_sb = CIFS_SB(sb); in cifs_reconnect()
417 rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list); in cifs_reconnect()
419 cifs_sb = NULL; in cifs_reconnect()
526 reconn_set_next_dfs_target(server, cifs_sb, &tgt_list, &tgt_it); in cifs_reconnect()
555 rc = dfs_cache_noreq_update_tgthint(cifs_sb->origin_fullpath + 1, in cifs_reconnect()
561 rc = dfs_cache_update_vol(cifs_sb->origin_fullpath, server); in cifs_reconnect()
3449 struct cifs_sb_info *new = mnt_data->cifs_sb; in compare_mount_options()
3492 struct cifs_sb_info *new = mnt_data->cifs_sb; in match_prepath()
3511 struct cifs_sb_info *cifs_sb; in cifs_match_super() local
3519 cifs_sb = CIFS_SB(sb); in cifs_match_super()
3520 tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); in cifs_match_super()
3819 struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info) in reset_cifs_unix_caps() argument
3873 if (cifs_sb) in reset_cifs_unix_caps()
3874 cifs_sb->mnt_cifs_flags |= in reset_cifs_unix_caps()
3882 if (cifs_sb) in reset_cifs_unix_caps()
3883 cifs_sb->mnt_cifs_flags |= in reset_cifs_unix_caps()
3919 struct cifs_sb_info *cifs_sb) in cifs_setup_cifs_sb() argument
3921 INIT_DELAYED_WORK(&cifs_sb->prune_tlinks, cifs_prune_tlinks); in cifs_setup_cifs_sb()
3923 spin_lock_init(&cifs_sb->tlink_tree_lock); in cifs_setup_cifs_sb()
3924 cifs_sb->tlink_tree = RB_ROOT; in cifs_setup_cifs_sb()
3926 cifs_sb->bsize = pvolume_info->bsize; in cifs_setup_cifs_sb()
3931 cifs_sb->rsize = pvolume_info->rsize; in cifs_setup_cifs_sb()
3932 cifs_sb->wsize = pvolume_info->wsize; in cifs_setup_cifs_sb()
3934 cifs_sb->mnt_uid = pvolume_info->linux_uid; in cifs_setup_cifs_sb()
3935 cifs_sb->mnt_gid = pvolume_info->linux_gid; in cifs_setup_cifs_sb()
3936 cifs_sb->mnt_file_mode = pvolume_info->file_mode; in cifs_setup_cifs_sb()
3937 cifs_sb->mnt_dir_mode = pvolume_info->dir_mode; in cifs_setup_cifs_sb()
3939 cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); in cifs_setup_cifs_sb()
3941 cifs_sb->actimeo = pvolume_info->actimeo; in cifs_setup_cifs_sb()
3942 cifs_sb->local_nls = pvolume_info->local_nls; in cifs_setup_cifs_sb()
3945 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_DFS; in cifs_setup_cifs_sb()
3947 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM; in cifs_setup_cifs_sb()
3949 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_SET_UID; in cifs_setup_cifs_sb()
3951 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UID_FROM_ACL; in cifs_setup_cifs_sb()
3953 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_SERVER_INUM; in cifs_setup_cifs_sb()
3955 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SFM_CHR; in cifs_setup_cifs_sb()
3957 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; in cifs_setup_cifs_sb()
3959 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; in cifs_setup_cifs_sb()
3961 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL; in cifs_setup_cifs_sb()
3963 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_BRL; in cifs_setup_cifs_sb()
3965 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_HANDLE_CACHE; in cifs_setup_cifs_sb()
3967 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOSSYNC; in cifs_setup_cifs_sb()
3969 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL; in cifs_setup_cifs_sb()
3971 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RWPIDFORWARD; in cifs_setup_cifs_sb()
3973 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MODE_FROM_SID; in cifs_setup_cifs_sb()
3975 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_ACL; in cifs_setup_cifs_sb()
3977 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_BACKUPUID; in cifs_setup_cifs_sb()
3978 cifs_sb->mnt_backupuid = pvolume_info->backupuid; in cifs_setup_cifs_sb()
3981 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_BACKUPGID; in cifs_setup_cifs_sb()
3982 cifs_sb->mnt_backupgid = pvolume_info->backupgid; in cifs_setup_cifs_sb()
3985 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_UID; in cifs_setup_cifs_sb()
3987 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; in cifs_setup_cifs_sb()
3989 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; in cifs_setup_cifs_sb()
3991 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; in cifs_setup_cifs_sb()
3993 cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | in cifs_setup_cifs_sb()
3996 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO; in cifs_setup_cifs_sb()
3999 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; in cifs_setup_cifs_sb()
4003 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RO_CACHE; in cifs_setup_cifs_sb()
4006 cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_RO_CACHE | in cifs_setup_cifs_sb()
4024 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MF_SYMLINKS; in cifs_setup_cifs_sb()
4031 cifs_sb->prepath = kstrdup(pvolume_info->prepath, GFP_KERNEL); in cifs_setup_cifs_sb()
4032 if (cifs_sb->prepath == NULL) in cifs_setup_cifs_sb()
4034 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; in cifs_setup_cifs_sb()
4061 static inline void mount_put_conns(struct cifs_sb_info *cifs_sb, in mount_put_conns() argument
4074 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_POSIX_PATHS; in mount_put_conns()
4079 static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, in mount_get_conns() argument
4130 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; in mount_get_conns()
4138 reset_cifs_unix_caps(*xid, tcon, cifs_sb, vol); in mount_get_conns()
4148 server->ops->qfs_tcon(*xid, tcon, cifs_sb); in mount_get_conns()
4149 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE) { in mount_get_conns()
4153 else if ((cifs_sb->mnt_cifs_flags & in mount_get_conns()
4160 cifs_sb->wsize = server->ops->negotiate_wsize(tcon, vol); in mount_get_conns()
4161 cifs_sb->rsize = server->ops->negotiate_rsize(tcon, vol); in mount_get_conns()
4166 static int mount_setup_tlink(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, in mount_setup_tlink() argument
4182 cifs_sb->master_tlink = tlink; in mount_setup_tlink()
4183 spin_lock(&cifs_sb->tlink_tree_lock); in mount_setup_tlink()
4184 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); in mount_setup_tlink()
4185 spin_unlock(&cifs_sb->tlink_tree_lock); in mount_setup_tlink()
4187 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks, in mount_setup_tlink()
4199 const struct cifs_sb_info *cifs_sb, bool useppath) in build_unc_path_to_root() argument
4217 *pos = CIFS_DIR_SEP(cifs_sb); in build_unc_path_to_root()
4223 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb)); in build_unc_path_to_root()
4241 struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb, in expand_dfs_referral() argument
4248 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) in expand_dfs_referral()
4251 full_path = build_unc_path_to_root(volume_info, cifs_sb, true); in expand_dfs_referral()
4255 rc = dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), in expand_dfs_referral()
4260 mdata = cifs_compose_mount_options(cifs_sb->mountdata, in expand_dfs_referral()
4274 kfree(cifs_sb->mountdata); in expand_dfs_referral()
4275 cifs_sb->mountdata = mdata; in expand_dfs_referral()
4319 struct cifs_sb_info *cifs_sb, struct smb_vol *vol, unsigned int *xid, in setup_dfs_tgt_conn() argument
4334 mdata = cifs_compose_mount_options(cifs_sb->mountdata, full_path + 1, &ref, &fake_devname); in setup_dfs_tgt_conn()
4354 mount_put_conns(cifs_sb, *xid, *server, *ses, *tcon); in setup_dfs_tgt_conn()
4355 rc = mount_get_conns(&fake_vol, cifs_sb, xid, server, ses, in setup_dfs_tgt_conn()
4369 static int do_dfs_failover(const char *path, const char *full_path, struct cifs_sb_info *cifs_sb, in do_dfs_failover() argument
4378 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS) in do_dfs_failover()
4391 rc = setup_dfs_tgt_conn(path, full_path, tgt_it, cifs_sb, vol, xid, server, ses, in do_dfs_failover()
4402 cifs_sb->local_nls, in do_dfs_failover()
4403 cifs_remap(cifs_sb), path, in do_dfs_failover()
4473 struct cifs_sb_info *cifs_sb, in cifs_are_all_path_components_accessible() argument
4482 sep = CIFS_DIR_SEP(cifs_sb); in cifs_are_all_path_components_accessible()
4485 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, ""); in cifs_are_all_path_components_accessible()
4509 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in cifs_are_all_path_components_accessible()
4520 static int is_path_remote(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in is_path_remote() argument
4534 full_path = cifs_build_path_to_root(vol, cifs_sb, tcon, in is_path_remote()
4541 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, in is_path_remote()
4550 cifs_sb, full_path, tcon->Flags & SMB_SHARE_IS_IN_DFS); in is_path_remote()
4553 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; in is_path_remote()
4563 static void set_root_ses(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, in set_root_ses() argument
4570 ses->tcon_ipc->remap = cifs_remap(cifs_sb); in set_root_ses()
4583 static int check_dfs_prepath(struct cifs_sb_info *cifs_sb, struct smb_vol *vol, in check_dfs_prepath() argument
4588 char sep = CIFS_DIR_SEP(cifs_sb), tmp; in check_dfs_prepath()
4594 path = cifs_build_path_to_root(vol, cifs_sb, tcon, added_treename); in check_dfs_prepath()
4623 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, path); in check_dfs_prepath()
4632 npath = build_unc_path_to_root(&v, cifs_sb, true); in check_dfs_prepath()
4637 npath = build_unc_path_to_root(&v, cifs_sb, true); in check_dfs_prepath()
4653 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4665 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4673 if (dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), vol->UNC + 1, NULL, in cifs_mount()
4679 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4686 mntdata = kstrndup(cifs_sb->mountdata, strlen(cifs_sb->mountdata), GFP_KERNEL); in cifs_mount()
4692 ref_path = build_unc_path_to_root(vol, cifs_sb, false); in cifs_mount()
4699 set_root_ses(cifs_sb, ses, &root_ses); in cifs_mount()
4703 full_path = build_unc_path_to_root(vol, cifs_sb, !!count); in cifs_mount()
4710 oldmnt = cifs_sb->mountdata; in cifs_mount()
4711 rc = expand_dfs_referral(xid, root_ses, vol, cifs_sb, ref_path + 1); in cifs_mount()
4715 if (oldmnt != cifs_sb->mountdata) { in cifs_mount()
4716 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4717 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4721 rc = do_dfs_failover(ref_path + 1, full_path, cifs_sb, vol, root_ses, &xid, in cifs_mount()
4731 set_root_ses(cifs_sb, ses, &root_ses); in cifs_mount()
4734 rc = check_dfs_prepath(cifs_sb, vol, xid, server, tcon, &ref_path); in cifs_mount()
4754 cifs_sb->origin_fullpath = kstrndup(full_path, strlen(full_path), GFP_KERNEL); in cifs_mount()
4755 if (!cifs_sb->origin_fullpath) { in cifs_mount()
4762 tcon->remap = cifs_remap(cifs_sb); in cifs_mount()
4766 rc = dfs_cache_add_vol(mntdata, vol, cifs_sb->origin_fullpath); in cifs_mount()
4774 cifs_autodisable_serverino(cifs_sb); in cifs_mount()
4779 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; in cifs_mount()
4780 kfree(cifs_sb->prepath); in cifs_mount()
4781 cifs_sb->prepath = vol->prepath; in cifs_mount()
4787 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4793 kfree(cifs_sb->origin_fullpath); in cifs_mount()
4795 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4799 int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol) in cifs_mount() argument
4807 rc = mount_get_conns(vol, cifs_sb, &xid, &server, &ses, &tcon); in cifs_mount()
4812 rc = is_path_remote(cifs_sb, vol, xid, server, tcon); in cifs_mount()
4821 return mount_setup_tlink(cifs_sb, ses, tcon); in cifs_mount()
4824 mount_put_conns(cifs_sb, xid, server, ses, tcon); in cifs_mount()
4999 cifs_umount(struct cifs_sb_info *cifs_sb) in cifs_umount() argument
5001 struct rb_root *root = &cifs_sb->tlink_tree; in cifs_umount()
5005 cancel_delayed_work_sync(&cifs_sb->prune_tlinks); in cifs_umount()
5007 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_umount()
5014 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_umount()
5016 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_umount()
5018 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_umount()
5020 kfree(cifs_sb->mountdata); in cifs_umount()
5021 kfree(cifs_sb->prepath); in cifs_umount()
5023 dfs_cache_del_vol(cifs_sb->origin_fullpath); in cifs_umount()
5024 kfree(cifs_sb->origin_fullpath); in cifs_umount()
5026 call_rcu(&cifs_sb->rcu, delayed_free); in cifs_umount()
5101 cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) in cifs_construct_tcon() argument
5104 struct cifs_tcon *master_tcon = cifs_sb_master_tcon(cifs_sb); in cifs_construct_tcon()
5113 vol_info->local_nls = cifs_sb->local_nls; in cifs_construct_tcon()
5167 cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb) in cifs_sb_master_tcon() argument
5169 return tlink_tcon(cifs_sb_master_tlink(cifs_sb)); in cifs_sb_master_tcon()
5230 cifs_sb_tlink(struct cifs_sb_info *cifs_sb) in cifs_sb_tlink() argument
5236 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)) in cifs_sb_tlink()
5237 return cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); in cifs_sb_tlink()
5239 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_sb_tlink()
5240 tlink = tlink_rb_search(&cifs_sb->tlink_tree, fsuid); in cifs_sb_tlink()
5243 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_sb_tlink()
5255 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_sb_tlink()
5257 tlink = tlink_rb_search(&cifs_sb->tlink_tree, fsuid); in cifs_sb_tlink()
5260 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_sb_tlink()
5265 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); in cifs_sb_tlink()
5266 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_sb_tlink()
5290 tlink->tl_tcon = cifs_construct_tcon(cifs_sb, fsuid); in cifs_sb_tlink()
5309 struct cifs_sb_info *cifs_sb = container_of(work, struct cifs_sb_info, in cifs_prune_tlinks() local
5311 struct rb_root *root = &cifs_sb->tlink_tree; in cifs_prune_tlinks()
5323 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_prune_tlinks()
5339 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_prune_tlinks()
5341 spin_lock(&cifs_sb->tlink_tree_lock); in cifs_prune_tlinks()
5343 spin_unlock(&cifs_sb->tlink_tree_lock); in cifs_prune_tlinks()
5345 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks, in cifs_prune_tlinks()