diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-04-16 16:22:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:24 -0400 |
commit | a3cba2aad9c0a63279716d377efbf37c176ed400 (patch) | |
tree | fdd2291d67c611947bb93022ff8e2d17a093f4ae /fs/nfs/inode.c | |
parent | c407d41a1612aa487f5a9cb5338ed7dc60fe1da2 (diff) |
NFS: Reduce stack footprint of nfs_revalidate_inode()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 0f9852ab87bb..e64867eec895 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -682,7 +682,7 @@ int | |||
682 | __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | 682 | __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) |
683 | { | 683 | { |
684 | int status = -ESTALE; | 684 | int status = -ESTALE; |
685 | struct nfs_fattr fattr; | 685 | struct nfs_fattr *fattr = NULL; |
686 | struct nfs_inode *nfsi = NFS_I(inode); | 686 | struct nfs_inode *nfsi = NFS_I(inode); |
687 | 687 | ||
688 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", | 688 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", |
@@ -693,8 +693,13 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
693 | if (NFS_STALE(inode)) | 693 | if (NFS_STALE(inode)) |
694 | goto out; | 694 | goto out; |
695 | 695 | ||
696 | status = -ENOMEM; | ||
697 | fattr = nfs_alloc_fattr(); | ||
698 | if (fattr == NULL) | ||
699 | goto out; | ||
700 | |||
696 | nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); | 701 | nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); |
697 | status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr); | 702 | status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr); |
698 | if (status != 0) { | 703 | if (status != 0) { |
699 | dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", | 704 | dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n", |
700 | inode->i_sb->s_id, | 705 | inode->i_sb->s_id, |
@@ -707,7 +712,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
707 | goto out; | 712 | goto out; |
708 | } | 713 | } |
709 | 714 | ||
710 | status = nfs_refresh_inode(inode, &fattr); | 715 | status = nfs_refresh_inode(inode, fattr); |
711 | if (status) { | 716 | if (status) { |
712 | dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n", | 717 | dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n", |
713 | inode->i_sb->s_id, | 718 | inode->i_sb->s_id, |
@@ -723,6 +728,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
723 | (long long)NFS_FILEID(inode)); | 728 | (long long)NFS_FILEID(inode)); |
724 | 729 | ||
725 | out: | 730 | out: |
731 | nfs_free_fattr(fattr); | ||
726 | return status; | 732 | return status; |
727 | } | 733 | } |
728 | 734 | ||