xfs: merge _xfs_log_force and xfs_log_force
authorChristoph Hellwig <hch@lst.de>
Wed, 14 Mar 2018 06:15:28 +0000 (23:15 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 14 Mar 2018 18:12:52 +0000 (11:12 -0700)
Switch to a single interface for flushing the whole log, which gives
consistent trace point coverage, and removes the unused log_flushed
argument for the previous _xfs_log_force callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/scrub/common.c
fs/xfs/xfs_extent_busy.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log.h

index 8033ab9d8f47d51f63e64ac168f3a9ac82d23055..ddcdda3364023ab1e7b076c499edc2a4215a322b 100644 (file)
@@ -619,7 +619,7 @@ xfs_scrub_checkpoint_log(
 {
        int                     error;
 
-       error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL);
+       error = xfs_log_force(mp, XFS_LOG_SYNC);
        if (error)
                return error;
        xfs_ail_push_all_sync(mp->m_ail);
index 1b439db95634bf354a4196db021b354d283ff28c..13e3d1a69e761ed3f19f0258201d677f888d9bb9 100644 (file)
@@ -613,8 +613,7 @@ xfs_extent_busy_flush(
        DEFINE_WAIT             (wait);
        int                     error;
 
-       trace_xfs_log_force(mp, 0, _THIS_IP_);
-       error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL);
+       error = xfs_log_force(mp, XFS_LOG_SYNC);
        if (error)
                return;
 
index 2f529fd7bf6750f5ce54f0ea9d36a3310a0ae575..3ce17e79b6e0f8a5fbda53e7c9c9ed009bef0efe 100644 (file)
@@ -869,7 +869,7 @@ xfs_log_unmount_write(xfs_mount_t *mp)
                return 0;
        }
 
-       error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL);
+       error = xfs_log_force(mp, XFS_LOG_SYNC);
        ASSERT(error || !(XLOG_FORCED_SHUTDOWN(log)));
 
 #ifdef DEBUG
@@ -3304,16 +3304,16 @@ xlog_state_switch_iclogs(
  *             not in the active nor dirty state.
  */
 int
-_xfs_log_force(
+xfs_log_force(
        struct xfs_mount        *mp,
-       uint                    flags,
-       int                     *log_flushed)
+       uint                    flags)
 {
        struct xlog             *log = mp->m_log;
        struct xlog_in_core     *iclog;
        xfs_lsn_t               lsn;
 
        XFS_STATS_INC(mp, xs_log_force);
+       trace_xfs_log_force(mp, 0, _RET_IP_);
 
        xlog_cil_force(log);
 
@@ -3362,8 +3362,6 @@ _xfs_log_force(
                                if (xlog_state_release_iclog(log, iclog))
                                        return -EIO;
 
-                               if (log_flushed)
-                                       *log_flushed = 1;
                                spin_lock(&log->l_icloglock);
                                if (be64_to_cpu(iclog->ic_header.h_lsn) == lsn &&
                                    iclog->ic_state != XLOG_STATE_DIRTY)
@@ -3415,20 +3413,6 @@ no_sleep:
        return 0;
 }
 
-/*
- * Wrapper for _xfs_log_force(), 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(
-       xfs_mount_t     *mp,
-       uint            flags)
-{
-       trace_xfs_log_force(mp, 0, _RET_IP_);
-       _xfs_log_force(mp, flags, NULL);
-}
-
 /*
  * Force the in-core log to disk for a specific LSN.
  *
@@ -4035,7 +4019,7 @@ xfs_log_force_umount(
         * to guarantee this.
         */
        if (!logerror)
-               _xfs_log_force(mp, XFS_LOG_SYNC, NULL);
+               xfs_log_force(mp, XFS_LOG_SYNC);
 
        /*
         * mark the filesystem and the as in a shutdown state and wake
index bf212772595cc6fede65e1fc4137405a0eb52d7f..726dd9a330b4a93e6bef3a959477f35e99c466d3 100644 (file)
@@ -129,11 +129,7 @@ xfs_lsn_t xfs_log_done(struct xfs_mount *mp,
                       struct xlog_ticket *ticket,
                       struct xlog_in_core **iclog,
                       bool regrant);
-int      _xfs_log_force(struct xfs_mount *mp,
-                        uint           flags,
-                        int            *log_forced);
-void     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,
                             xfs_lsn_t          lsn,
                             uint               flags,