diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:22:48 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:23 -0400 |
commit | 4f727296d2428b60138793a0a1207a4085eacf99 (patch) | |
tree | 52c69d21dd90164fed413925ed194866d7a11136 /fs/nfs/super.c | |
parent | 8bac9db9cf85f2518cb523bb1d69c481975c1f9a (diff) |
NFSv4: Reduce the stack footprint of nfs4_remote_referral_get_sb
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index fa3111eea29a..dd589dee1eea 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2880,17 +2880,21 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, | |||
2880 | struct super_block *s; | 2880 | struct super_block *s; |
2881 | struct nfs_server *server; | 2881 | struct nfs_server *server; |
2882 | struct dentry *mntroot; | 2882 | struct dentry *mntroot; |
2883 | struct nfs_fh mntfh; | 2883 | struct nfs_fh *mntfh; |
2884 | int (*compare_super)(struct super_block *, void *) = nfs_compare_super; | 2884 | int (*compare_super)(struct super_block *, void *) = nfs_compare_super; |
2885 | struct nfs_sb_mountdata sb_mntdata = { | 2885 | struct nfs_sb_mountdata sb_mntdata = { |
2886 | .mntflags = flags, | 2886 | .mntflags = flags, |
2887 | }; | 2887 | }; |
2888 | int error; | 2888 | int error = -ENOMEM; |
2889 | 2889 | ||
2890 | dprintk("--> nfs4_referral_get_sb()\n"); | 2890 | dprintk("--> nfs4_referral_get_sb()\n"); |
2891 | 2891 | ||
2892 | mntfh = nfs_alloc_fhandle(); | ||
2893 | if (mntfh == NULL) | ||
2894 | goto out_err_nofh; | ||
2895 | |||
2892 | /* create a new volume representation */ | 2896 | /* create a new volume representation */ |
2893 | server = nfs4_create_referral_server(data, &mntfh); | 2897 | server = nfs4_create_referral_server(data, mntfh); |
2894 | if (IS_ERR(server)) { | 2898 | if (IS_ERR(server)) { |
2895 | error = PTR_ERR(server); | 2899 | error = PTR_ERR(server); |
2896 | goto out_err_noserver; | 2900 | goto out_err_noserver; |
@@ -2922,7 +2926,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, | |||
2922 | nfs_fscache_get_super_cookie(s, NULL, data); | 2926 | nfs_fscache_get_super_cookie(s, NULL, data); |
2923 | } | 2927 | } |
2924 | 2928 | ||
2925 | mntroot = nfs4_get_root(s, &mntfh); | 2929 | mntroot = nfs4_get_root(s, mntfh); |
2926 | if (IS_ERR(mntroot)) { | 2930 | if (IS_ERR(mntroot)) { |
2927 | error = PTR_ERR(mntroot); | 2931 | error = PTR_ERR(mntroot); |
2928 | goto error_splat_super; | 2932 | goto error_splat_super; |
@@ -2939,12 +2943,15 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, | |||
2939 | 2943 | ||
2940 | security_sb_clone_mnt_opts(data->sb, s); | 2944 | security_sb_clone_mnt_opts(data->sb, s); |
2941 | 2945 | ||
2946 | nfs_free_fhandle(mntfh); | ||
2942 | dprintk("<-- nfs4_referral_get_sb() = 0\n"); | 2947 | dprintk("<-- nfs4_referral_get_sb() = 0\n"); |
2943 | return 0; | 2948 | return 0; |
2944 | 2949 | ||
2945 | out_err_nosb: | 2950 | out_err_nosb: |
2946 | nfs_free_server(server); | 2951 | nfs_free_server(server); |
2947 | out_err_noserver: | 2952 | out_err_noserver: |
2953 | nfs_free_fhandle(mntfh); | ||
2954 | out_err_nofh: | ||
2948 | dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error); | 2955 | dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error); |
2949 | return error; | 2956 | return error; |
2950 | 2957 | ||
@@ -2953,6 +2960,7 @@ error_splat_super: | |||
2953 | bdi_unregister(&server->backing_dev_info); | 2960 | bdi_unregister(&server->backing_dev_info); |
2954 | error_splat_bdi: | 2961 | error_splat_bdi: |
2955 | deactivate_locked_super(s); | 2962 | deactivate_locked_super(s); |
2963 | nfs_free_fhandle(mntfh); | ||
2956 | dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error); | 2964 | dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error); |
2957 | return error; | 2965 | return error; |
2958 | } | 2966 | } |