[GFS2] Remove lm.[ch] and distribute content
[safe/jmp/linux-2.6] / fs / gfs2 / util.c
index fe9c28e..d31e355 100644 (file)
@@ -19,7 +19,6 @@
 #include "gfs2.h"
 #include "incore.h"
 #include "glock.h"
-#include "lm.h"
 #include "util.h"
 
 struct kmem_cache *gfs2_glock_cachep __read_mostly;
@@ -33,6 +32,28 @@ void gfs2_assert_i(struct gfs2_sbd *sdp)
               sdp->sd_fsname);
 }
 
+int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
+{
+       va_list args;
+
+       if (test_and_set_bit(SDF_SHUTDOWN, &sdp->sd_flags))
+               return 0;
+
+       va_start(args, fmt);
+       vprintk(fmt, args);
+       va_end(args);
+
+       fs_err(sdp, "about to withdraw this file system\n");
+       BUG_ON(sdp->sd_args.ar_debug);
+
+       fs_err(sdp, "telling LM to withdraw\n");
+       gfs2_withdraw_lockproto(&sdp->sd_lockstruct);
+       fs_err(sdp, "withdrawn\n");
+       dump_stack();
+
+       return -1;
+}
+
 /**
  * gfs2_assert_withdraw_i - Cause the machine to withdraw if @assertion is false
  * Returns: -1 if this call withdrew the machine,