aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-10-08 06:56:03 -0400
committerBen Myers <bpm@sgi.com>2012-10-17 12:57:10 -0400
commitcf2931db2d189ce0583be7ae880d7e3f8c15f623 (patch)
treec775754810bd0657fe770f6fedb429f0cc6dc586 /fs/xfs/xfs_mount.c
parentf661f1e0bf5002bdcc8b5810ad0a184a1841537f (diff)
xfs: Bring some sanity to log unmounting
When unmounting the filesystem, there are lots of operations that need to be done in a specific order, and they are spread across across a couple of functions. We have to drain the AIL before we write the unmount record, and we have to shut down the background log work before we do either of them. But this is all split haphazardly across xfs_unmountfs() and xfs_log_unmount(). Move all the AIL flushing and log manipulations to xfs_log_unmount() so that the responisbilities of each function is clear and the operations they perform obvious. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index d9a31c6a0c53..c195ec85c725 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1460,13 +1460,6 @@ xfs_unmountfs(
1460 xfs_qm_unmount(mp); 1460 xfs_qm_unmount(mp);
1461 1461
1462 /* 1462 /*
1463 * Flush out the log synchronously so that we know for sure
1464 * that nothing is pinned. This is important because bflush()
1465 * will skip pinned buffers.
1466 */
1467 xfs_log_force(mp, XFS_LOG_SYNC);
1468
1469 /*
1470 * Unreserve any blocks we have so that when we unmount we don't account 1463 * Unreserve any blocks we have so that when we unmount we don't account
1471 * the reserved free space as used. This is really only necessary for 1464 * the reserved free space as used. This is really only necessary for
1472 * lazy superblock counting because it trusts the incore superblock 1465 * lazy superblock counting because it trusts the incore superblock
@@ -1491,23 +1484,6 @@ xfs_unmountfs(
1491 xfs_warn(mp, "Unable to update superblock counters. " 1484 xfs_warn(mp, "Unable to update superblock counters. "
1492 "Freespace may not be correct on next mount."); 1485 "Freespace may not be correct on next mount.");
1493 1486
1494 /*
1495 * At this point we might have modified the superblock again and thus
1496 * added an item to the AIL, thus flush it again.
1497 */
1498 xfs_ail_push_all_sync(mp->m_ail);
1499 xfs_wait_buftarg(mp->m_ddev_targp);
1500
1501 /*
1502 * The superblock buffer is uncached and xfsaild_push() will lock and
1503 * set the XBF_ASYNC flag on the buffer. We cannot do xfs_buf_iowait()
1504 * here but a lock on the superblock buffer will block until iodone()
1505 * has completed.
1506 */
1507 xfs_buf_lock(mp->m_sb_bp);
1508 xfs_buf_unlock(mp->m_sb_bp);
1509
1510 xfs_log_unmount_write(mp);
1511 xfs_log_unmount(mp); 1487 xfs_log_unmount(mp);
1512 xfs_uuid_unmount(mp); 1488 xfs_uuid_unmount(mp);
1513 1489