Skip to content

Commit

Permalink
NFSv4: Return the delegation before returning the layout in evict_ino…
Browse files Browse the repository at this point in the history
…de()

Minor optimisation for the case where the layout has return-on-close
enabled.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
trondmypd committed Mar 27, 2015
1 parent 81b79af commit 415320f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/nfs/nfs4super.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ static void nfs4_evict_inode(struct inode *inode)
{
truncate_inode_pages_final(&inode->i_data);
clear_inode(inode);
pnfs_return_layout(inode);
pnfs_destroy_layout(NFS_I(inode));
/* If we are holding a delegation, return it! */
nfs_inode_return_delegation_noreclaim(inode);
/* Note that above delegreturn would trigger pnfs return-on-close */
pnfs_return_layout(inode);
pnfs_destroy_layout(NFS_I(inode));
/* First call standard NFS clear_inode() code */
nfs_clear_inode(inode);
}
Expand Down

0 comments on commit 415320f

Please sign in to comment.