xfs: factor out a new xfs_log_force_inode helper
Create a new helper to force the log up to the last LSN touching an inode. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
d9fdd0adf9
commit
54fbdd1035
@@ -80,19 +80,9 @@ xfs_dir_fsync(
|
||||
int datasync)
|
||||
{
|
||||
struct xfs_inode *ip = XFS_I(file->f_mapping->host);
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
xfs_lsn_t lsn = 0;
|
||||
|
||||
trace_xfs_dir_fsync(ip);
|
||||
|
||||
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
||||
if (xfs_ipincount(ip))
|
||||
lsn = ip->i_itemp->ili_last_lsn;
|
||||
xfs_iunlock(ip, XFS_ILOCK_SHARED);
|
||||
|
||||
if (!lsn)
|
||||
return 0;
|
||||
return xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, NULL);
|
||||
return xfs_log_force_inode(ip);
|
||||
}
|
||||
|
||||
STATIC int
|
||||
|
Reference in New Issue
Block a user