Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158613
b: refs/heads/master
c: a6fe23b
h: refs/heads/master
i:
  158611: 51d3aaf
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Sep 8, 2009
1 parent dce2374 commit 9d192b1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7630c852e19c7fffb85b50d98eeb5516fec7c088
refs/heads/master: a6fe23be90aa78783523a25330e09bfaa43a1581
44 changes: 31 additions & 13 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ static const struct super_operations nfs_sops = {
#ifdef CONFIG_NFS_V4
static int nfs4_validate_text_mount_data(void *options,
struct nfs_parsed_mount_data *args, const char *dev_name);
static int nfs4_try_mount(int flags, const char *dev_name,
struct nfs_parsed_mount_data *data, struct vfsmount *mnt);
static int nfs4_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
static int nfs4_remote_get_sb(struct file_system_type *fs_type,
Expand Down Expand Up @@ -2565,15 +2567,41 @@ static int nfs_follow_remote_path(struct vfsmount *root_mnt,
return ret;
}

static int nfs4_try_mount(int flags, const char *dev_name,
struct nfs_parsed_mount_data *data,
struct vfsmount *mnt)
{
char *export_path;
struct vfsmount *root_mnt;
int error;

dfprintk(MOUNT, "--> nfs4_try_mount()\n");

export_path = data->nfs_server.export_path;
data->nfs_server.export_path = "/";
root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, data,
data->nfs_server.hostname);
data->nfs_server.export_path = export_path;

error = PTR_ERR(root_mnt);
if (IS_ERR(root_mnt))
goto out;

error = nfs_follow_remote_path(root_mnt, export_path, mnt);

out:
dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", error,
error != 0 ? " [error]" : "");
return error;
}

/*
* Get the superblock for an NFS4 mountpoint
*/
static int nfs4_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt)
{
struct nfs_parsed_mount_data *data;
char *export_path;
struct vfsmount *root_mnt;
int error = -ENOMEM;

data = kzalloc(sizeof(*data), GFP_KERNEL);
Expand All @@ -2585,17 +2613,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
if (error < 0)
goto out;

export_path = data->nfs_server.export_path;
data->nfs_server.export_path = "/";
root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, data,
data->nfs_server.hostname);
data->nfs_server.export_path = export_path;

error = PTR_ERR(root_mnt);
if (IS_ERR(root_mnt))
goto out;

error = nfs_follow_remote_path(root_mnt, export_path, mnt);
error = nfs4_try_mount(flags, dev_name, data, mnt);

out:
kfree(data->client_address);
Expand Down

0 comments on commit 9d192b1

Please sign in to comment.