xfs: separate log cleaning from log quiesce
authorBrian Foster <bfoster@redhat.com>
Sat, 23 Jan 2021 00:48:21 +0000 (16:48 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Sat, 23 Jan 2021 00:54:51 +0000 (16:54 -0800)
Log quiesce is currently associated with cleaning the log, which is
accomplished by writing an unmount record as the last step of the
quiesce sequence. The quiesce codepath is a bit convoluted in this
regard due to how it is reused from various contexts. In preparation
to create separate log cleaning and log covering interfaces, lift
the write of the unmount record into a new cleaning helper and call
that wherever xfs_log_quiesce() is currently invoked. No functional
changes.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_log.c
fs/xfs/xfs_log.h
fs/xfs/xfs_super.c

index 3ede7ad431c0f4983e28ec2a602c7f4d1178f945..d02e140549568cee3c54c5b38cac2187a343090c 100644 (file)
@@ -957,7 +957,13 @@ xfs_log_quiesce(
        xfs_buftarg_wait(mp->m_ddev_targp);
        xfs_buf_lock(mp->m_sb_bp);
        xfs_buf_unlock(mp->m_sb_bp);
+}
 
+void
+xfs_log_clean(
+       struct xfs_mount        *mp)
+{
+       xfs_log_quiesce(mp);
        xfs_log_unmount_write(mp);
 }
 
@@ -972,7 +978,7 @@ void
 xfs_log_unmount(
        struct xfs_mount        *mp)
 {
-       xfs_log_quiesce(mp);
+       xfs_log_clean(mp);
 
        xfs_buftarg_drain(mp->m_ddev_targp);
 
index 98c913da7587eb5014eeeb245ecaf7e4303a21c6..b0400589f824cfd8f39a8f337d23461941d014ea 100644 (file)
@@ -139,6 +139,7 @@ bool        xfs_log_item_in_current_chkpt(struct xfs_log_item *lip);
 
 void   xfs_log_work_queue(struct xfs_mount *mp);
 void   xfs_log_quiesce(struct xfs_mount *mp);
+void   xfs_log_clean(struct xfs_mount *mp);
 bool   xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
 bool   xfs_log_in_recovery(struct xfs_mount *);
 
index 813be879a5e51d928f8b10523b41f835c308c523..09d956e30fd81f31d466e81e5a5fe439ebf78020 100644 (file)
@@ -897,7 +897,7 @@ xfs_quiesce_attr(
        if (error)
                xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. "
                                "Frozen image may not be consistent.");
-       xfs_log_quiesce(mp);
+       xfs_log_clean(mp);
 }
 
 /*