Skip to content

Commit

Permalink
xfs: unlock the inode before log force in xfs_fs_nfs_commit_metadata
Browse files Browse the repository at this point in the history
Only read the LSN we need to push to with the ilock held, and then release
it before we do the log force to improve concurrency.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Oct 12, 2011
1 parent b103705 commit 8292d88
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/xfs/xfs_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ xfs_fs_nfs_commit_metadata(
{
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
int error = 0;
xfs_lsn_t lsn = 0;

xfs_ilock(ip, XFS_ILOCK_SHARED);
if (xfs_ipincount(ip)) {
error = _xfs_log_force_lsn(mp, ip->i_itemp->ili_last_lsn,
XFS_LOG_SYNC, NULL);
}
if (xfs_ipincount(ip))
lsn = ip->i_itemp->ili_last_lsn;
xfs_iunlock(ip, XFS_ILOCK_SHARED);

return error;
if (!lsn)
return 0;
return _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, NULL);
}

const struct export_operations xfs_export_operations = {
Expand Down

0 comments on commit 8292d88

Please sign in to comment.