diff options
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index b6ce4d4b6def..d2d59692739f 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -855,20 +855,17 @@ xfs_log_unmount_write(xfs_mount_t *mp) | |||
855 | } /* xfs_log_unmount_write */ | 855 | } /* xfs_log_unmount_write */ |
856 | 856 | ||
857 | /* | 857 | /* |
858 | * Shut down and release the AIL and Log. | 858 | * Empty the log for unmount/freeze. |
859 | * | ||
860 | * During unmount, we need to ensure we flush all the dirty metadata objects | ||
861 | * from the AIL so that the log is empty before we write the unmount record to | ||
862 | * the log. | ||
863 | * | 859 | * |
864 | * To do this, we first need to shut down the background log work so it is not | 860 | * To do this, we first need to shut down the background log work so it is not |
865 | * trying to cover the log as we clean up. We then need to unpin all objects in | 861 | * trying to cover the log as we clean up. We then need to unpin all objects in |
866 | * the log so we can then flush them out. Once they have completed their IO and | 862 | * the log so we can then flush them out. Once they have completed their IO and |
867 | * run the callbacks removing themselves from the AIL, we can write the unmount | 863 | * run the callbacks removing themselves from the AIL, we can write the unmount |
868 | * record, tear down the AIL and finally free the log. | 864 | * record. |
869 | */ | 865 | */ |
870 | void | 866 | void |
871 | xfs_log_unmount(xfs_mount_t *mp) | 867 | xfs_log_quiesce( |
868 | struct xfs_mount *mp) | ||
872 | { | 869 | { |
873 | cancel_delayed_work_sync(&mp->m_log->l_work); | 870 | cancel_delayed_work_sync(&mp->m_log->l_work); |
874 | xfs_log_force(mp, XFS_LOG_SYNC); | 871 | xfs_log_force(mp, XFS_LOG_SYNC); |
@@ -886,6 +883,20 @@ xfs_log_unmount(xfs_mount_t *mp) | |||
886 | xfs_buf_unlock(mp->m_sb_bp); | 883 | xfs_buf_unlock(mp->m_sb_bp); |
887 | 884 | ||
888 | xfs_log_unmount_write(mp); | 885 | xfs_log_unmount_write(mp); |
886 | } | ||
887 | |||
888 | /* | ||
889 | * Shut down and release the AIL and Log. | ||
890 | * | ||
891 | * During unmount, we need to ensure we flush all the dirty metadata objects | ||
892 | * from the AIL so that the log is empty before we write the unmount record to | ||
893 | * the log. Once this is done, we can tear down the AIL and the log. | ||
894 | */ | ||
895 | void | ||
896 | xfs_log_unmount( | ||
897 | struct xfs_mount *mp) | ||
898 | { | ||
899 | xfs_log_quiesce(mp); | ||
889 | 900 | ||
890 | xfs_trans_ail_destroy(mp); | 901 | xfs_trans_ail_destroy(mp); |
891 | xlog_dealloc_log(mp->m_log); | 902 | xlog_dealloc_log(mp->m_log); |