xfs: move xfs_do_force_shutdown() and kill xfs_rw.c
authorDave Chinner <dchinner@redhat.com>
Mon, 23 Apr 2012 05:59:03 +0000 (15:59 +1000)
committerBen Myers <bpm@sgi.com>
Mon, 14 May 2012 21:20:59 +0000 (16:20 -0500)
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>
fs/xfs/Makefile
fs/xfs/xfs_fsops.c
fs/xfs/xfs_rw.c [deleted file]

index ca9229ff8ac02dde04836ba739599de9c66fbac1..d2bf974b1a2f68db6a47901cebd060bb49518bd1 100644 (file)
@@ -50,7 +50,6 @@ xfs-y                         += xfs_aops.o \
                                   xfs_sync.o \
                                   xfs_xattr.o \
                                   xfs_rename.o \
-                                  xfs_rw.o \
                                   xfs_utils.o \
                                   xfs_vnodeops.o \
                                   kmem.o \
index f6c7698c9a75e0c6deac1ba182768caac902cc4d..537c2aeb1ad25a0546f3f10f5b4d7d9be1e69876 100644 (file)
@@ -688,3 +688,63 @@ xfs_fs_goingdown(
 
        return 0;
 }
+
+/*
+ * Force a shutdown of the filesystem instantly while keeping the filesystem
+ * consistent. We don't do an unmount here; just shutdown the shop, make sure
+ * that absolutely nothing persistent happens to this filesystem after this
+ * point.
+ */
+void
+xfs_do_force_shutdown(
+       xfs_mount_t     *mp,
+       int             flags,
+       char            *fname,
+       int             lnnum)
+{
+       int             logerror;
+
+       logerror = flags & SHUTDOWN_LOG_IO_ERROR;
+
+       if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
+               xfs_notice(mp,
+       "%s(0x%x) called from line %d of file %s.  Return address = 0x%p",
+                       __func__, flags, lnnum, fname, __return_address);
+       }
+       /*
+        * No need to duplicate efforts.
+        */
+       if (XFS_FORCED_SHUTDOWN(mp) && !logerror)
+               return;
+
+       /*
+        * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't
+        * queue up anybody new on the log reservations, and wakes up
+        * everybody who's sleeping on log reservations to tell them
+        * the bad news.
+        */
+       if (xfs_log_force_umount(mp, logerror))
+               return;
+
+       if (flags & SHUTDOWN_CORRUPT_INCORE) {
+               xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT,
+    "Corruption of in-memory data detected.  Shutting down filesystem");
+               if (XFS_ERRLEVEL_HIGH <= xfs_error_level)
+                       xfs_stack_trace();
+       } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
+               if (logerror) {
+                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR,
+               "Log I/O Error Detected.  Shutting down filesystem");
+               } else if (flags & SHUTDOWN_DEVICE_REQ) {
+                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
+               "All device paths lost.  Shutting down filesystem");
+               } else if (!(flags & SHUTDOWN_REMOTE_REQ)) {
+                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
+               "I/O Error Detected. Shutting down filesystem");
+               }
+       }
+       if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
+               xfs_alert(mp,
+       "Please umount the filesystem and rectify the problem(s)");
+       }
+}
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
deleted file mode 100644 (file)
index c406cb6..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#include "xfs.h"
-#include "xfs_fs.h"
-#include "xfs_types.h"
-#include "xfs_bit.h"
-#include "xfs_log.h"
-#include "xfs_trans.h"
-#include "xfs_sb.h"
-#include "xfs_ag.h"
-#include "xfs_mount.h"
-#include "xfs_bmap_btree.h"
-#include "xfs_dinode.h"
-#include "xfs_inode.h"
-#include "xfs_error.h"
-
-/*
- * Force a shutdown of the filesystem instantly while keeping
- * the filesystem consistent. We don't do an unmount here; just shutdown
- * the shop, make sure that absolutely nothing persistent happens to
- * this filesystem after this point.
- */
-void
-xfs_do_force_shutdown(
-       xfs_mount_t     *mp,
-       int             flags,
-       char            *fname,
-       int             lnnum)
-{
-       int             logerror;
-
-       logerror = flags & SHUTDOWN_LOG_IO_ERROR;
-
-       if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
-               xfs_notice(mp,
-       "%s(0x%x) called from line %d of file %s.  Return address = 0x%p",
-                       __func__, flags, lnnum, fname, __return_address);
-       }
-       /*
-        * No need to duplicate efforts.
-        */
-       if (XFS_FORCED_SHUTDOWN(mp) && !logerror)
-               return;
-
-       /*
-        * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't
-        * queue up anybody new on the log reservations, and wakes up
-        * everybody who's sleeping on log reservations to tell them
-        * the bad news.
-        */
-       if (xfs_log_force_umount(mp, logerror))
-               return;
-
-       if (flags & SHUTDOWN_CORRUPT_INCORE) {
-               xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT,
-    "Corruption of in-memory data detected.  Shutting down filesystem");
-               if (XFS_ERRLEVEL_HIGH <= xfs_error_level)
-                       xfs_stack_trace();
-       } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
-               if (logerror) {
-                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR,
-               "Log I/O Error Detected.  Shutting down filesystem");
-               } else if (flags & SHUTDOWN_DEVICE_REQ) {
-                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
-               "All device paths lost.  Shutting down filesystem");
-               } else if (!(flags & SHUTDOWN_REMOTE_REQ)) {
-                       xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR,
-               "I/O Error Detected. Shutting down filesystem");
-               }
-       }
-       if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
-               xfs_alert(mp,
-       "Please umount the filesystem and rectify the problem(s)");
-       }
-}