Commit 656de4ff authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: merge _xfs_log_force_lsn and xfs_log_force_lsn

Switch to a single interface for flushing the log to a specific LSN, which
gives consistent trace point coverage and a less confusing interface.

The was only a single user of the previous xfs_log_force_lsn function,
which now also passes a NULL log_flushed argument.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 60e5bb78
...@@ -237,7 +237,7 @@ xfs_fs_nfs_commit_metadata( ...@@ -237,7 +237,7 @@ xfs_fs_nfs_commit_metadata(
if (!lsn) if (!lsn)
return 0; return 0;
return _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, NULL); 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 = {
......
...@@ -122,7 +122,7 @@ xfs_dir_fsync( ...@@ -122,7 +122,7 @@ xfs_dir_fsync(
if (!lsn) if (!lsn)
return 0; return 0;
return _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, NULL); return xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, NULL);
} }
STATIC int STATIC int
...@@ -182,7 +182,7 @@ xfs_file_fsync( ...@@ -182,7 +182,7 @@ xfs_file_fsync(
} }
if (lsn) { if (lsn) {
error = _xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, &log_flushed); error = xfs_log_force_lsn(mp, lsn, XFS_LOG_SYNC, &log_flushed);
ip->i_itemp->ili_fsync_fields = 0; ip->i_itemp->ili_fsync_fields = 0;
} }
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
......
...@@ -2502,7 +2502,7 @@ xfs_iunpin( ...@@ -2502,7 +2502,7 @@ xfs_iunpin(
trace_xfs_inode_unpin_nowait(ip, _RET_IP_); trace_xfs_inode_unpin_nowait(ip, _RET_IP_);
/* Give the log a push to start the unpinning I/O */ /* Give the log a push to start the unpinning I/O */
xfs_log_force_lsn(ip->i_mount, ip->i_itemp->ili_last_lsn, 0); xfs_log_force_lsn(ip->i_mount, ip->i_itemp->ili_last_lsn, 0, NULL);
} }
......
...@@ -3429,7 +3429,7 @@ xfs_log_force( ...@@ -3429,7 +3429,7 @@ xfs_log_force(
* sv. * sv.
*/ */
int int
_xfs_log_force_lsn( xfs_log_force_lsn(
struct xfs_mount *mp, struct xfs_mount *mp,
xfs_lsn_t lsn, xfs_lsn_t lsn,
uint flags, uint flags,
...@@ -3442,6 +3442,7 @@ _xfs_log_force_lsn( ...@@ -3442,6 +3442,7 @@ _xfs_log_force_lsn(
ASSERT(lsn != 0); ASSERT(lsn != 0);
XFS_STATS_INC(mp, xs_log_force); XFS_STATS_INC(mp, xs_log_force);
trace_xfs_log_force(mp, lsn, _RET_IP_);
lsn = xlog_cil_force_lsn(log, lsn); lsn = xlog_cil_force_lsn(log, lsn);
if (lsn == NULLCOMMITLSN) if (lsn == NULLCOMMITLSN)
...@@ -3538,21 +3539,6 @@ _xfs_log_force_lsn( ...@@ -3538,21 +3539,6 @@ _xfs_log_force_lsn(
return 0; return 0;
} }
/*
* Wrapper for _xfs_log_force_lsn(), to be used when caller doesn't care
* about errors or whether the log was flushed or not. This is the normal
* interface to use when trying to unpin items or move the log forward.
*/
void
xfs_log_force_lsn(
xfs_mount_t *mp,
xfs_lsn_t lsn,
uint flags)
{
trace_xfs_log_force(mp, lsn, _RET_IP_);
_xfs_log_force_lsn(mp, lsn, flags, NULL);
}
/* /*
* Called when we want to mark the current iclog as being ready to sync to * Called when we want to mark the current iclog as being ready to sync to
* disk. * disk.
......
...@@ -130,13 +130,8 @@ xfs_lsn_t xfs_log_done(struct xfs_mount *mp, ...@@ -130,13 +130,8 @@ xfs_lsn_t xfs_log_done(struct xfs_mount *mp,
struct xlog_in_core **iclog, struct xlog_in_core **iclog,
bool regrant); bool regrant);
int xfs_log_force(struct xfs_mount *mp, uint flags); int xfs_log_force(struct xfs_mount *mp, uint flags);
int _xfs_log_force_lsn(struct xfs_mount *mp, int xfs_log_force_lsn(struct xfs_mount *mp, xfs_lsn_t lsn, uint flags,
xfs_lsn_t lsn,
uint flags,
int *log_forced); int *log_forced);
void xfs_log_force_lsn(struct xfs_mount *mp,
xfs_lsn_t lsn,
uint flags);
int xfs_log_mount(struct xfs_mount *mp, int xfs_log_mount(struct xfs_mount *mp,
struct xfs_buftarg *log_target, struct xfs_buftarg *log_target,
xfs_daddr_t start_block, xfs_daddr_t start_block,
......
...@@ -970,7 +970,7 @@ __xfs_trans_commit( ...@@ -970,7 +970,7 @@ __xfs_trans_commit(
* log out now and wait for it. * log out now and wait for it.
*/ */
if (sync) { if (sync) {
error = _xfs_log_force_lsn(mp, commit_lsn, XFS_LOG_SYNC, NULL); error = xfs_log_force_lsn(mp, commit_lsn, XFS_LOG_SYNC, NULL);
XFS_STATS_INC(mp, xs_trans_sync); XFS_STATS_INC(mp, xs_trans_sync);
} else { } else {
XFS_STATS_INC(mp, xs_trans_async); XFS_STATS_INC(mp, xs_trans_async);
......
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