diff options
| -rw-r--r-- | fs/nfs/internal.h | 4 | ||||
| -rw-r--r-- | fs/nfs/namespace.c | 15 | ||||
| -rw-r--r-- | fs/nfs/nfs4namespace.c | 12 | 
3 files changed, 13 insertions, 18 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index f0234118d044..e94ad22da5d2 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h  | |||
| @@ -163,10 +163,10 @@ static inline void nfs_fs_proc_exit(void) | |||
| 163 | 163 | ||
| 164 | /* nfs4namespace.c */ | 164 | /* nfs4namespace.c */ | 
| 165 | #ifdef CONFIG_NFS_V4 | 165 | #ifdef CONFIG_NFS_V4 | 
| 166 | extern struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry); | 166 | extern struct vfsmount *nfs_do_refmount(struct dentry *dentry); | 
| 167 | #else | 167 | #else | 
| 168 | static inline | 168 | static inline | 
| 169 | struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) | 169 | struct vfsmount *nfs_do_refmount(struct dentry *dentry) | 
| 170 | { | 170 | { | 
| 171 | return ERR_PTR(-ENOENT); | 171 | return ERR_PTR(-ENOENT); | 
| 172 | } | 172 | } | 
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 859cdaba4c1c..c0b8344db0c6 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c  | |||
| @@ -25,8 +25,7 @@ static LIST_HEAD(nfs_automount_list); | |||
| 25 | static DECLARE_DELAYED_WORK(nfs_automount_task, nfs_expire_automounts); | 25 | static DECLARE_DELAYED_WORK(nfs_automount_task, nfs_expire_automounts); | 
| 26 | int nfs_mountpoint_expiry_timeout = 500 * HZ; | 26 | int nfs_mountpoint_expiry_timeout = 500 * HZ; | 
| 27 | 27 | ||
| 28 | static struct vfsmount *nfs_do_submount(struct super_block *sb, | 28 | static struct vfsmount *nfs_do_submount(struct dentry *dentry, | 
| 29 | struct dentry *dentry, | ||
| 30 | struct nfs_fh *fh, | 29 | struct nfs_fh *fh, | 
| 31 | struct nfs_fattr *fattr); | 30 | struct nfs_fattr *fattr); | 
| 32 | 31 | ||
| @@ -164,9 +163,9 @@ struct vfsmount *nfs_d_automount(struct path *path) | |||
| 164 | } | 163 | } | 
| 165 | 164 | ||
| 166 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) | 165 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) | 
| 167 | mnt = nfs_do_refmount(path->mnt->mnt_sb, path->dentry); | 166 | mnt = nfs_do_refmount(path->dentry); | 
| 168 | else | 167 | else | 
| 169 | mnt = nfs_do_submount(path->mnt->mnt_sb, path->dentry, fh, fattr); | 168 | mnt = nfs_do_submount(path->dentry, fh, fattr); | 
| 170 | if (IS_ERR(mnt)) | 169 | if (IS_ERR(mnt)) | 
| 171 | goto out; | 170 | goto out; | 
| 172 | 171 | ||
| @@ -230,19 +229,17 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server, | |||
| 230 | 229 | ||
| 231 | /** | 230 | /** | 
| 232 | * nfs_do_submount - set up mountpoint when crossing a filesystem boundary | 231 | * nfs_do_submount - set up mountpoint when crossing a filesystem boundary | 
| 233 | * @sb - superblock of parent directory | ||
| 234 | * @dentry - parent directory | 232 | * @dentry - parent directory | 
| 235 | * @fh - filehandle for new root dentry | 233 | * @fh - filehandle for new root dentry | 
| 236 | * @fattr - attributes for new root inode | 234 | * @fattr - attributes for new root inode | 
| 237 | * | 235 | * | 
| 238 | */ | 236 | */ | 
| 239 | static struct vfsmount *nfs_do_submount(struct super_block *sb, | 237 | static struct vfsmount *nfs_do_submount(struct dentry *dentry, | 
| 240 | struct dentry *dentry, | ||
| 241 | struct nfs_fh *fh, | 238 | struct nfs_fh *fh, | 
| 242 | struct nfs_fattr *fattr) | 239 | struct nfs_fattr *fattr) | 
| 243 | { | 240 | { | 
| 244 | struct nfs_clone_mount mountdata = { | 241 | struct nfs_clone_mount mountdata = { | 
| 245 | .sb = sb, | 242 | .sb = dentry->d_sb, | 
| 246 | .dentry = dentry, | 243 | .dentry = dentry, | 
| 247 | .fh = fh, | 244 | .fh = fh, | 
| 248 | .fattr = fattr, | 245 | .fattr = fattr, | 
| @@ -262,7 +259,7 @@ static struct vfsmount *nfs_do_submount(struct super_block *sb, | |||
| 262 | mnt = (struct vfsmount *)devname; | 259 | mnt = (struct vfsmount *)devname; | 
| 263 | if (IS_ERR(devname)) | 260 | if (IS_ERR(devname)) | 
| 264 | goto free_page; | 261 | goto free_page; | 
| 265 | mnt = nfs_do_clone_mount(NFS_SB(sb), devname, &mountdata); | 262 | mnt = nfs_do_clone_mount(NFS_SB(dentry->d_sb), devname, &mountdata); | 
| 266 | free_page: | 263 | free_page: | 
| 267 | free_page((unsigned long)page); | 264 | free_page((unsigned long)page); | 
| 268 | out: | 265 | out: | 
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 46942e2680a0..bb80c49b6533 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c  | |||
| @@ -161,20 +161,18 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, | |||
| 161 | 161 | ||
| 162 | /** | 162 | /** | 
| 163 | * nfs_follow_referral - set up mountpoint when hitting a referral on moved error | 163 | * nfs_follow_referral - set up mountpoint when hitting a referral on moved error | 
| 164 | * @sb - superblock of parent directory | ||
| 165 | * @dentry - parent directory | 164 | * @dentry - parent directory | 
| 166 | * @locations - array of NFSv4 server location information | 165 | * @locations - array of NFSv4 server location information | 
| 167 | * | 166 | * | 
| 168 | */ | 167 | */ | 
| 169 | static struct vfsmount *nfs_follow_referral(struct super_block *sb, | 168 | static struct vfsmount *nfs_follow_referral(struct dentry *dentry, | 
| 170 | struct dentry *dentry, | ||
| 171 | const struct nfs4_fs_locations *locations) | 169 | const struct nfs4_fs_locations *locations) | 
| 172 | { | 170 | { | 
| 173 | struct vfsmount *mnt = ERR_PTR(-ENOENT); | 171 | struct vfsmount *mnt = ERR_PTR(-ENOENT); | 
| 174 | struct nfs_clone_mount mountdata = { | 172 | struct nfs_clone_mount mountdata = { | 
| 175 | .sb = sb, | 173 | .sb = dentry->d_sb, | 
| 176 | .dentry = dentry, | 174 | .dentry = dentry, | 
| 177 | .authflavor = NFS_SB(sb)->client->cl_auth->au_flavor, | 175 | .authflavor = NFS_SB(dentry->d_sb)->client->cl_auth->au_flavor, | 
| 178 | }; | 176 | }; | 
| 179 | char *page = NULL, *page2 = NULL; | 177 | char *page = NULL, *page2 = NULL; | 
| 180 | int loc, error; | 178 | int loc, error; | 
| @@ -224,7 +222,7 @@ out: | |||
| 224 | * @dentry - dentry of referral | 222 | * @dentry - dentry of referral | 
| 225 | * | 223 | * | 
| 226 | */ | 224 | */ | 
| 227 | struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) | 225 | struct vfsmount *nfs_do_refmount(struct dentry *dentry) | 
| 228 | { | 226 | { | 
| 229 | struct vfsmount *mnt = ERR_PTR(-ENOMEM); | 227 | struct vfsmount *mnt = ERR_PTR(-ENOMEM); | 
| 230 | struct dentry *parent; | 228 | struct dentry *parent; | 
| @@ -257,7 +255,7 @@ struct vfsmount *nfs_do_refmount(struct super_block *sb, struct dentry *dentry) | |||
| 257 | fs_locations->fs_path.ncomponents <= 0) | 255 | fs_locations->fs_path.ncomponents <= 0) | 
| 258 | goto out_free; | 256 | goto out_free; | 
| 259 | 257 | ||
| 260 | mnt = nfs_follow_referral(sb, dentry, fs_locations); | 258 | mnt = nfs_follow_referral(dentry, fs_locations); | 
| 261 | out_free: | 259 | out_free: | 
| 262 | __free_page(page); | 260 | __free_page(page); | 
| 263 | kfree(fs_locations); | 261 | kfree(fs_locations); | 
