aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2010-07-26 14:20:16 -0400
committerSteve French <sfrench@us.ibm.com>2010-08-02 08:40:40 -0400
commitf67909cf80051e8510194a51f88c4de323b92071 (patch)
tree06a172ec4e51a4531acd810c1159dbd647036a48
parentf636a34802e3913415410c6e595df2bf84851cff (diff)
[CIFS] remove redundant path walking in dfs_do_refmount
Reviewed-by: Dave Howells <dhowells@redhat.com> Signed-off-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifs_dfs_ref.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index ac19a6f3dae0..dc1ed50ea06e 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -230,28 +230,22 @@ compose_mount_options_err:
230 goto compose_mount_options_out; 230 goto compose_mount_options_out;
231} 231}
232 232
233 233/**
234static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent, 234 * cifs_dfs_do_refmount - mounts specified path using provided refferal
235 struct dentry *dentry, const struct dfs_info3_param *ref) 235 * @cifs_sb: parent/root superblock
236 * @fullpath: full path in UNC format
237 * @ref: server's referral
238 */
239static struct vfsmount *cifs_dfs_do_refmount(struct cifs_sb_info *cifs_sb,
240 const char *fullpath, const struct dfs_info3_param *ref)
236{ 241{
237 struct cifs_sb_info *cifs_sb;
238 struct vfsmount *mnt; 242 struct vfsmount *mnt;
239 char *mountdata; 243 char *mountdata;
240 char *devname = NULL; 244 char *devname = NULL;
241 char *fullpath;
242
243 cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
244 /*
245 * this function gives us a path with a double backslash prefix. We
246 * require a single backslash for DFS.
247 */
248 fullpath = build_path_from_dentry(dentry);
249 if (!fullpath)
250 return ERR_PTR(-ENOMEM);
251 245
246 /* strip first '\' from fullpath */
252 mountdata = cifs_compose_mount_options(cifs_sb->mountdata, 247 mountdata = cifs_compose_mount_options(cifs_sb->mountdata,
253 fullpath + 1, ref, &devname); 248 fullpath + 1, ref, &devname);
254 kfree(fullpath);
255 249
256 if (IS_ERR(mountdata)) 250 if (IS_ERR(mountdata))
257 return (struct vfsmount *)mountdata; 251 return (struct vfsmount *)mountdata;
@@ -357,8 +351,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
357 rc = -EINVAL; 351 rc = -EINVAL;
358 goto out_err; 352 goto out_err;
359 } 353 }
360 mnt = cifs_dfs_do_refmount(nd->path.mnt, 354 mnt = cifs_dfs_do_refmount(cifs_sb,
361 nd->path.dentry, referrals + i); 355 full_path, referrals + i);
362 cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__, 356 cFYI(1, "%s: cifs_dfs_do_refmount:%s , mnt:%p", __func__,
363 referrals[i].node_name, mnt); 357 referrals[i].node_name, mnt);
364 358