Skip to content

Commit

Permalink
NFS: Remove the NFS v4 xdev mount function
Browse files Browse the repository at this point in the history
I can now share this code with the v2 and v3 code by using the NFS
subversion structure.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Bryan Schumaker authored and Trond Myklebust committed Jul 30, 2012
1 parent ab7017a commit e8f25e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 58 deletions.
13 changes: 0 additions & 13 deletions fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,7 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server,
const char *devname,
struct nfs_clone_mount *mountdata)
{
#ifdef CONFIG_NFS_V4
struct vfsmount *mnt = ERR_PTR(-EINVAL);
switch (server->nfs_client->rpc_ops->version) {
case 2:
case 3:
mnt = vfs_kern_mount(&nfs_xdev_fs_type, 0, devname, mountdata);
break;
case 4:
mnt = vfs_kern_mount(&nfs4_xdev_fs_type, 0, devname, mountdata);
}
return mnt;
#else
return vfs_kern_mount(&nfs_xdev_fs_type, 0, devname, mountdata);
#endif
}

/**
Expand Down
25 changes: 0 additions & 25 deletions fs/nfs/nfs4super.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

static struct dentry *nfs4_remote_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data);
static struct dentry *nfs4_xdev_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data);
static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data);
static struct dentry *nfs4_remote_referral_mount(struct file_system_type *fs_type,
Expand All @@ -37,14 +35,6 @@ static struct file_system_type nfs4_remote_fs_type = {
.fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
};

struct file_system_type nfs4_xdev_fs_type = {
.owner = THIS_MODULE,
.name = "nfs4",
.mount = nfs4_xdev_mount,
.kill_sb = nfs_kill_super,
.fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
};

static struct file_system_type nfs4_remote_referral_fs_type = {
.owner = THIS_MODULE,
.name = "nfs4",
Expand Down Expand Up @@ -261,21 +251,6 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,
return res;
}

/*
* Clone an NFS4 server record on xdev traversal (FSID-change)
*/
static struct dentry *
nfs4_xdev_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
{
struct nfs_mount_info mount_info = {
.fill_super = nfs_clone_super,
.set_security = nfs_clone_sb_security,
.cloned = raw_data,
};
return nfs_xdev_mount_common(&nfs4_fs_type, flags, dev_name, &mount_info);
}

static struct dentry *
nfs4_remote_referral_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
Expand Down
30 changes: 10 additions & 20 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,18 +2445,23 @@ void nfs_kill_super(struct super_block *s)
* Clone an NFS2/3/4 server record on xdev traversal (FSID-change)
*/
struct dentry *
nfs_xdev_mount_common(struct file_system_type *fs_type, int flags,
const char *dev_name, struct nfs_mount_info *mount_info)
nfs_xdev_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
{
struct nfs_clone_mount *data = mount_info->cloned;
struct nfs_clone_mount *data = raw_data;
struct nfs_mount_info mount_info = {
.fill_super = nfs_clone_super,
.set_security = nfs_clone_sb_security,
.cloned = data,
};
struct nfs_server *server;
struct dentry *mntroot = ERR_PTR(-ENOMEM);
struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod;
int error;

dprintk("--> nfs_xdev_mount_common()\n");

mount_info->mntfh = data->fh;
mount_info.mntfh = mount_info.cloned->fh;

/* create a new volume representation */
server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor);
Expand All @@ -2465,7 +2470,7 @@ nfs_xdev_mount_common(struct file_system_type *fs_type, int flags,
goto out_err;
}

mntroot = nfs_fs_mount_common(server, flags, dev_name, mount_info, nfs_mod);
mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod);
dprintk("<-- nfs_xdev_mount_common() = 0\n");
out:
return mntroot;
Expand All @@ -2475,21 +2480,6 @@ nfs_xdev_mount_common(struct file_system_type *fs_type, int flags,
goto out;
}

/*
* Clone an NFS2/3 server record on xdev traversal (FSID-change)
*/
static struct dentry *
nfs_xdev_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *raw_data)
{
struct nfs_mount_info mount_info = {
.fill_super = nfs_clone_super,
.set_security = nfs_clone_sb_security,
.cloned = raw_data,
};
return nfs_xdev_mount_common(&nfs_fs_type, flags, dev_name, &mount_info);
}

#ifdef CONFIG_NFS_V4

static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
Expand Down

0 comments on commit e8f25e6

Please sign in to comment.