提交 4f727296 编写于 作者: T Trond Myklebust

NFSv4: Reduce the stack footprint of nfs4_remote_referral_get_sb

Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 8bac9db9
...@@ -2880,17 +2880,21 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ...@@ -2880,17 +2880,21 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
struct super_block *s; struct super_block *s;
struct nfs_server *server; struct nfs_server *server;
struct dentry *mntroot; struct dentry *mntroot;
struct nfs_fh mntfh; struct nfs_fh *mntfh;
int (*compare_super)(struct super_block *, void *) = nfs_compare_super; int (*compare_super)(struct super_block *, void *) = nfs_compare_super;
struct nfs_sb_mountdata sb_mntdata = { struct nfs_sb_mountdata sb_mntdata = {
.mntflags = flags, .mntflags = flags,
}; };
int error; int error = -ENOMEM;
dprintk("--> nfs4_referral_get_sb()\n"); dprintk("--> nfs4_referral_get_sb()\n");
mntfh = nfs_alloc_fhandle();
if (mntfh == NULL)
goto out_err_nofh;
/* create a new volume representation */ /* create a new volume representation */
server = nfs4_create_referral_server(data, &mntfh); server = nfs4_create_referral_server(data, mntfh);
if (IS_ERR(server)) { if (IS_ERR(server)) {
error = PTR_ERR(server); error = PTR_ERR(server);
goto out_err_noserver; goto out_err_noserver;
...@@ -2922,7 +2926,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ...@@ -2922,7 +2926,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
nfs_fscache_get_super_cookie(s, NULL, data); nfs_fscache_get_super_cookie(s, NULL, data);
} }
mntroot = nfs4_get_root(s, &mntfh); mntroot = nfs4_get_root(s, mntfh);
if (IS_ERR(mntroot)) { if (IS_ERR(mntroot)) {
error = PTR_ERR(mntroot); error = PTR_ERR(mntroot);
goto error_splat_super; goto error_splat_super;
...@@ -2939,12 +2943,15 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ...@@ -2939,12 +2943,15 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
security_sb_clone_mnt_opts(data->sb, s); security_sb_clone_mnt_opts(data->sb, s);
nfs_free_fhandle(mntfh);
dprintk("<-- nfs4_referral_get_sb() = 0\n"); dprintk("<-- nfs4_referral_get_sb() = 0\n");
return 0; return 0;
out_err_nosb: out_err_nosb:
nfs_free_server(server); nfs_free_server(server);
out_err_noserver: out_err_noserver:
nfs_free_fhandle(mntfh);
out_err_nofh:
dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error); dprintk("<-- nfs4_referral_get_sb() = %d [error]\n", error);
return error; return error;
...@@ -2953,6 +2960,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type, ...@@ -2953,6 +2960,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
bdi_unregister(&server->backing_dev_info); bdi_unregister(&server->backing_dev_info);
error_splat_bdi: error_splat_bdi:
deactivate_locked_super(s); deactivate_locked_super(s);
nfs_free_fhandle(mntfh);
dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error); dprintk("<-- nfs4_referral_get_sb() = %d [splat]\n", error);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册