Commit 8292d88c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

xfs: unlock the inode before log force in xfs_fs_nfs_commit_metadata

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent b1037058
...@@ -229,16 +229,16 @@ xfs_fs_nfs_commit_metadata( ...@@ -229,16 +229,16 @@ xfs_fs_nfs_commit_metadata(
{ {
struct xfs_inode *ip = XFS_I(inode); struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
int error = 0; xfs_lsn_t lsn = 0;
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
if (xfs_ipincount(ip)) { if (xfs_ipincount(ip))
error = _xfs_log_force_lsn(mp, ip->i_itemp->ili_last_lsn, lsn = ip->i_itemp->ili_last_lsn;
XFS_LOG_SYNC, NULL);
}
xfs_iunlock(ip, XFS_ILOCK_SHARED); 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 = { const struct export_operations xfs_export_operations = {
......
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