diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-05-10 15:07:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-14 20:30:31 -0400 |
commit | 46058d46d3fcf2900f18d9bd5585c8f89d59e1c4 (patch) | |
tree | 9016197e0ce1185fcbaa001affa7a1a091d8b0af /fs | |
parent | d72c727cd9de490f936a41634e34cd4a61ba6dd6 (diff) |
NFS: Allocate parsed mount data directly to the nfs_mount_info structure
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/super.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 5b025b08e766..fc6270120543 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2468,7 +2468,6 @@ error_splat_bdi: | |||
2468 | static struct dentry *nfs_fs_mount(struct file_system_type *fs_type, | 2468 | static struct dentry *nfs_fs_mount(struct file_system_type *fs_type, |
2469 | int flags, const char *dev_name, void *raw_data) | 2469 | int flags, const char *dev_name, void *raw_data) |
2470 | { | 2470 | { |
2471 | struct nfs_parsed_mount_data *data = NULL; | ||
2472 | struct nfs_mount_info mount_info = { | 2471 | struct nfs_mount_info mount_info = { |
2473 | .fill_super = nfs_fill_super, | 2472 | .fill_super = nfs_fill_super, |
2474 | .set_security = nfs_set_sb_security, | 2473 | .set_security = nfs_set_sb_security, |
@@ -2477,30 +2476,29 @@ static struct dentry *nfs_fs_mount(struct file_system_type *fs_type, | |||
2477 | struct dentry *mntroot = ERR_PTR(-ENOMEM); | 2476 | struct dentry *mntroot = ERR_PTR(-ENOMEM); |
2478 | int error; | 2477 | int error; |
2479 | 2478 | ||
2480 | data = nfs_alloc_parsed_mount_data(); | 2479 | mount_info.parsed = nfs_alloc_parsed_mount_data(); |
2481 | mntfh = nfs_alloc_fhandle(); | 2480 | mntfh = nfs_alloc_fhandle(); |
2482 | if (data == NULL || mntfh == NULL) | 2481 | if (mount_info.parsed == NULL || mntfh == NULL) |
2483 | goto out; | 2482 | goto out; |
2484 | 2483 | ||
2485 | /* Validate the mount data */ | 2484 | /* Validate the mount data */ |
2486 | error = nfs_validate_mount_data(fs_type, raw_data, data, mntfh, dev_name); | 2485 | error = nfs_validate_mount_data(fs_type, raw_data, mount_info.parsed, mntfh, dev_name); |
2487 | if (error == NFS_TEXT_DATA) | 2486 | if (error == NFS_TEXT_DATA) |
2488 | error = nfs_validate_text_mount_data(raw_data, data, dev_name); | 2487 | error = nfs_validate_text_mount_data(raw_data, mount_info.parsed, dev_name); |
2489 | if (error < 0) { | 2488 | if (error < 0) { |
2490 | mntroot = ERR_PTR(error); | 2489 | mntroot = ERR_PTR(error); |
2491 | goto out; | 2490 | goto out; |
2492 | } | 2491 | } |
2493 | mount_info.parsed = data; | ||
2494 | 2492 | ||
2495 | #ifdef CONFIG_NFS_V4 | 2493 | #ifdef CONFIG_NFS_V4 |
2496 | if (data->version == 4) | 2494 | if (mount_info.parsed->version == 4) |
2497 | mntroot = nfs4_try_mount(flags, dev_name, data); | 2495 | mntroot = nfs4_try_mount(flags, dev_name, mount_info.parsed); |
2498 | else | 2496 | else |
2499 | #endif /* CONFIG_NFS_V4 */ | 2497 | #endif /* CONFIG_NFS_V4 */ |
2500 | mntroot = nfs_try_mount(flags, dev_name, mntfh, &mount_info); | 2498 | mntroot = nfs_try_mount(flags, dev_name, mntfh, &mount_info); |
2501 | 2499 | ||
2502 | out: | 2500 | out: |
2503 | nfs_free_parsed_mount_data(data); | 2501 | nfs_free_parsed_mount_data(mount_info.parsed); |
2504 | nfs_free_fhandle(mntfh); | 2502 | nfs_free_fhandle(mntfh); |
2505 | return mntroot; | 2503 | return mntroot; |
2506 | } | 2504 | } |