aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_fsops.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-04-23 01:59:03 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:59 -0400
commit2af51f3a4ef93945d20ff27ab28c5c68b5a21efc (patch)
treeb07fb8fefd07abcbd3d14cb8ad724f0060e528e5 /fs/xfs/xfs_fsops.c
parent2a0ec1d9ed7f3aa7974fccfbb612fadda2e10bad (diff)
xfs: move xfs_do_force_shutdown() and kill xfs_rw.c
xfs_do_force_shutdown now is the only thing in xfs_rw.c. There is no need to keep it in it's own file anymore, so move it to xfs_fsops.c next to xfs_fs_goingdown() and kill xfs_rw.c. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r--fs/xfs/xfs_fsops.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index f6c7698c9a75..537c2aeb1ad2 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -688,3 +688,63 @@ xfs_fs_goingdown(
688 688
689 return 0; 689 return 0;
690} 690}
691
692/*
693 * Force a shutdown of the filesystem instantly while keeping the filesystem
694 * consistent. We don't do an unmount here; just shutdown the shop, make sure
695 * that absolutely nothing persistent happens to this filesystem after this
696 * point.
697 */
698void
699xfs_do_force_shutdown(
700 xfs_mount_t *mp,
701 int flags,
702 char *fname,
703 int lnnum)
704{
705 int logerror;
706
707 logerror = flags & SHUTDOWN_LOG_IO_ERROR;
708
709 if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
710 xfs_notice(mp,
711 "%s(0x%x) called from line %d of file %s. Return address = 0x%p",
712 __func__, flags, lnnum, fname, __return_address);
713 }
714 /*
715 * No need to duplicate efforts.
716 */
717 if (XFS_FORCED_SHUTDOWN(mp) && !logerror)
718 return;
719
720 /*
721 * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't
722 * queue up anybody new on the log reservations, and wakes up
723 * everybody who's sleeping on log reservations to tell them
724 * the bad news.
725 */
726 if (xfs_log_force_umount(mp, logerror))
727 return;
728
729 if (flags & SHUTDOWN_CORRUPT_INCORE) {
730 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT,
731 "Corruption of in-memory data detected. Shutting down filesystem");
732 if (XFS_ERRLEVEL_HIGH <= xfs_error_level)
733 xfs_stack_trace();
734 } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
735 if (logerror) {
736 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR,
737 "Log I/O Error Detected. Shutting down filesystem");
738 } else if (flags & SHUTDOWN_DEVICE_REQ) {
739 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
740 "All device paths lost. Shutting down filesystem");
741 } else if (!(flags & SHUTDOWN_REMOTE_REQ)) {
742 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
743 "I/O Error Detected. Shutting down filesystem");
744 }
745 }
746 if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
747 xfs_alert(mp,
748 "Please umount the filesystem and rectify the problem(s)");
749 }
750}