Commit 2a2fceca authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd: exportfs: reduce stack usage

find_exported_dentry() declares
	char nbuf[NAME_MAX+1];
in 2 separate places, and gcc allocates space on the stack for both
of them.  Having just one of them will suffice, if we can put put
with its scope.

Reduces function stack usage on x86-32 from 0x230 to 0x130.
Signed-off-by: default avatarRandy Dunlap <rddunlap@osdl.org>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a5801ce9
...@@ -55,7 +55,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, ...@@ -55,7 +55,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
struct list_head *le, *head; struct list_head *le, *head;
struct dentry *toput = NULL; struct dentry *toput = NULL;
int noprogress; int noprogress;
char nbuf[NAME_MAX+1];
/* /*
* Attempt to find the inode. * Attempt to find the inode.
...@@ -176,7 +176,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, ...@@ -176,7 +176,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
*/ */
struct dentry *ppd; struct dentry *ppd;
struct dentry *npd; struct dentry *npd;
char nbuf[NAME_MAX+1];
down(&pd->d_inode->i_sem); down(&pd->d_inode->i_sem);
ppd = CALL(nops,get_parent)(pd); ppd = CALL(nops,get_parent)(pd);
...@@ -241,7 +240,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, ...@@ -241,7 +240,6 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
/* if we weren't after a directory, have one more step to go */ /* if we weren't after a directory, have one more step to go */
if (result != target_dir) { if (result != target_dir) {
struct dentry *nresult; struct dentry *nresult;
char nbuf[NAME_MAX+1];
err = CALL(nops,get_name)(target_dir, nbuf, result); err = CALL(nops,get_name)(target_dir, nbuf, result);
if (!err) { if (!err) {
down(&target_dir->d_inode->i_sem); down(&target_dir->d_inode->i_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment