Commit f8ad9c4b authored by Al Viro's avatar Al Viro

nfs: nfs_do_{ref,sub}mount() superblock argument is redundant

It's always equal to dentry->d_sb
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b514f872
...@@ -163,10 +163,10 @@ static inline void nfs_fs_proc_exit(void) ...@@ -163,10 +163,10 @@ static inline void nfs_fs_proc_exit(void)
/* nfs4namespace.c */ /* nfs4namespace.c */
#ifdef CONFIG_NFS_V4 #ifdef CONFIG_NFS_V4
extern struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry); extern struct vfsmount *nfs_do_refmount(struct dentry *dentry);
#else #else
static inline static inline
struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) struct vfsmount *nfs_do_refmount(struct dentry *dentry)
{ {
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
} }
......
...@@ -25,8 +25,7 @@ static LIST_HEAD(nfs_automount_list); ...@@ -25,8 +25,7 @@ static LIST_HEAD(nfs_automount_list);
static DECLARE_DELAYED_WORK(nfs_automount_task, nfs_expire_automounts); static DECLARE_DELAYED_WORK(nfs_automount_task, nfs_expire_automounts);
int nfs_mountpoint_expiry_timeout = 500 * HZ; int nfs_mountpoint_expiry_timeout = 500 * HZ;
static struct vfsmount *nfs_do_submount(struct super_block *sb, static struct vfsmount *nfs_do_submount(struct dentry *dentry,
struct dentry *dentry,
struct nfs_fh *fh, struct nfs_fh *fh,
struct nfs_fattr *fattr); struct nfs_fattr *fattr);
...@@ -164,9 +163,9 @@ struct vfsmount *nfs_d_automount(struct path *path) ...@@ -164,9 +163,9 @@ struct vfsmount *nfs_d_automount(struct path *path)
} }
if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL)
mnt = nfs_do_refmount(path->mnt->mnt_sb, path->dentry); mnt = nfs_do_refmount(path->dentry);
else else
mnt = nfs_do_submount(path->mnt->mnt_sb, path->dentry, fh, fattr); mnt = nfs_do_submount(path->dentry, fh, fattr);
if (IS_ERR(mnt)) if (IS_ERR(mnt))
goto out; goto out;
...@@ -230,19 +229,17 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server, ...@@ -230,19 +229,17 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server,
/** /**
* nfs_do_submount - set up mountpoint when crossing a filesystem boundary * nfs_do_submount - set up mountpoint when crossing a filesystem boundary
* @sb - superblock of parent directory
* @dentry - parent directory * @dentry - parent directory
* @fh - filehandle for new root dentry * @fh - filehandle for new root dentry
* @fattr - attributes for new root inode * @fattr - attributes for new root inode
* *
*/ */
static struct vfsmount *nfs_do_submount(struct super_block *sb, static struct vfsmount *nfs_do_submount(struct dentry *dentry,
struct dentry *dentry,
struct nfs_fh *fh, struct nfs_fh *fh,
struct nfs_fattr *fattr) struct nfs_fattr *fattr)
{ {
struct nfs_clone_mount mountdata = { struct nfs_clone_mount mountdata = {
.sb = sb, .sb = dentry->d_sb,
.dentry = dentry, .dentry = dentry,
.fh = fh, .fh = fh,
.fattr = fattr, .fattr = fattr,
...@@ -262,7 +259,7 @@ static struct vfsmount *nfs_do_submount(struct super_block *sb, ...@@ -262,7 +259,7 @@ static struct vfsmount *nfs_do_submount(struct super_block *sb,
mnt = (struct vfsmount *)devname; mnt = (struct vfsmount *)devname;
if (IS_ERR(devname)) if (IS_ERR(devname))
goto free_page; goto free_page;
mnt = nfs_do_clone_mount(NFS_SB(sb), devname, &mountdata); mnt = nfs_do_clone_mount(NFS_SB(dentry->d_sb), devname, &mountdata);
free_page: free_page:
free_page((unsigned long)page); free_page((unsigned long)page);
out: out:
......
...@@ -161,20 +161,18 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, ...@@ -161,20 +161,18 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
/** /**
* nfs_follow_referral - set up mountpoint when hitting a referral on moved error * nfs_follow_referral - set up mountpoint when hitting a referral on moved error
* @sb - superblock of parent directory
* @dentry - parent directory * @dentry - parent directory
* @locations - array of NFSv4 server location information * @locations - array of NFSv4 server location information
* *
*/ */
static struct vfsmount *nfs_follow_referral(struct super_block *sb, static struct vfsmount *nfs_follow_referral(struct dentry *dentry,
struct dentry *dentry,
const struct nfs4_fs_locations *locations) const struct nfs4_fs_locations *locations)
{ {
struct vfsmount *mnt = ERR_PTR(-ENOENT); struct vfsmount *mnt = ERR_PTR(-ENOENT);
struct nfs_clone_mount mountdata = { struct nfs_clone_mount mountdata = {
.sb = sb, .sb = dentry->d_sb,
.dentry = dentry, .dentry = dentry,
.authflavor = NFS_SB(sb)->client->cl_auth->au_flavor, .authflavor = NFS_SB(dentry->d_sb)->client->cl_auth->au_flavor,
}; };
char *page = NULL, *page2 = NULL; char *page = NULL, *page2 = NULL;
int loc, error; int loc, error;
...@@ -224,7 +222,7 @@ static struct vfsmount *nfs_follow_referral(struct super_block *sb, ...@@ -224,7 +222,7 @@ static struct vfsmount *nfs_follow_referral(struct super_block *sb,
* @dentry - dentry of referral * @dentry - dentry of referral
* *
*/ */
struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) struct vfsmount *nfs_do_refmount(struct dentry *dentry)
{ {
struct vfsmount *mnt = ERR_PTR(-ENOMEM); struct vfsmount *mnt = ERR_PTR(-ENOMEM);
struct dentry *parent; struct dentry *parent;
...@@ -257,7 +255,7 @@ struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) ...@@ -257,7 +255,7 @@ struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry)
fs_locations->fs_path.ncomponents <= 0) fs_locations->fs_path.ncomponents <= 0)
goto out_free; goto out_free;
mnt = nfs_follow_referral(sb, dentry, fs_locations); mnt = nfs_follow_referral(dentry, fs_locations);
out_free: out_free:
__free_page(page); __free_page(page);
kfree(fs_locations); kfree(fs_locations);
......
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