Skip to content

Commit

Permalink
NFS: Reduce stack footprint of nfs_revalidate_inode()
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 14, 2010
1 parent c407d41 commit a3cba2a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ int
__nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
{
int status = -ESTALE;
struct nfs_fattr fattr;
struct nfs_fattr *fattr = NULL;
struct nfs_inode *nfsi = NFS_I(inode);

dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n",
Expand All @@ -693,8 +693,13 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
if (NFS_STALE(inode))
goto out;

status = -ENOMEM;
fattr = nfs_alloc_fattr();
if (fattr == NULL)
goto out;

nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr);
status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), fattr);
if (status != 0) {
dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) getattr failed, error=%d\n",
inode->i_sb->s_id,
Expand All @@ -707,7 +712,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
goto out;
}

status = nfs_refresh_inode(inode, &fattr);
status = nfs_refresh_inode(inode, fattr);
if (status) {
dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n",
inode->i_sb->s_id,
Expand All @@ -723,6 +728,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
(long long)NFS_FILEID(inode));

out:
nfs_free_fattr(fattr);
return status;
}

Expand Down

0 comments on commit a3cba2a

Please sign in to comment.