Commit f67909cf authored by Steve French's avatar Steve French

[CIFS] remove redundant path walking in dfs_do_refmount

Reviewed-by: default avatarDave Howells <dhowells@redhat.com>
Signed-off-by: default avatarIgor Mammedov <niallain@gmail.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent f636a348
...@@ -230,28 +230,22 @@ char *cifs_compose_mount_options(const char *sb_mountdata, ...@@ -230,28 +230,22 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
goto compose_mount_options_out; goto compose_mount_options_out;
} }
/**
static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, * cifs_dfs_do_refmount - mounts specified path using provided refferal
struct dentry *dentry, const struct dfs_info3_param *ref) * @cifs_sb: parent/root superblock
* @fullpath: full path in UNC format
* @ref: server's referral
*/
static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
const char *fullpath, const struct dfs_info3_param *ref)
{ {
struct cifs_sb_info *cifs_sb;
struct vfsmount *mnt; struct vfsmount *mnt;
char *mountdata; char *mountdata;
char *devname = NULL; char *devname = NULL;
char *fullpath;
cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
/*
* this function gives us a path with a double backslash prefix. We
* require a single backslash for DFS.
*/
fullpath = build_path_from_dentry(dentry);
if (!fullpath)
return ERR_PTR(-ENOMEM);
/* strip first '\' from fullpath */
mountdata = cifs_compose_mount_options(cifs_sb->mountdata, mountdata = cifs_compose_mount_options(cifs_sb->mountdata,
fullpath + 1, ref, &devname); fullpath + 1, ref, &devname);
kfree(fullpath);
if (IS_ERR(mountdata)) if (IS_ERR(mountdata))
return (struct vfsmount *)mountdata; return (struct vfsmount *)mountdata;
...@@ -357,8 +351,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) ...@@ -357,8 +351,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
mnt = cifs_dfs_do_refmount(nd->path.mnt, mnt = cifs_dfs_do_refmount(cifs_sb,
nd->path.dentry, referrals + i); full_path, referrals + i);
cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__,
referrals[i].node_name, mnt); referrals[i].node_name, mnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment