Merge branch 'master'
[powerpc.git] / fs / gfs2 / lm.c
index cc74422..f45c0ff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
 #include <linux/completion.h>
 #include <linux/buffer_head.h>
 #include <linux/delay.h>
-#include <asm/semaphore.h>
+#include <linux/gfs2_ondisk.h>
 
 #include "gfs2.h"
+#include "lm_interface.h"
+#include "incore.h"
 #include "glock.h"
 #include "lm.h"
 #include "super.h"
+#include "util.h"
+#include "lvb.h"
 
 /**
  * gfs2_lm_mount - mount a locking protocol
@@ -80,7 +84,8 @@ int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
 void gfs2_lm_others_may_mount(struct gfs2_sbd *sdp)
 {
        if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-               sdp->sd_lockstruct.ls_ops->lm_others_may_mount(sdp->sd_lockstruct.ls_lockspace);
+               sdp->sd_lockstruct.ls_ops->lm_others_may_mount(
+                                       sdp->sd_lockstruct.ls_lockspace);
 }
 
 void gfs2_lm_unmount(struct gfs2_sbd *sdp)
@@ -101,8 +106,8 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
        va_end(args);
 
        fs_err(sdp, "about to withdraw from the cluster\n");
-       if (sdp->sd_args.ar_debug)
-               BUG();
+       BUG_ON(sdp->sd_args.ar_debug);
+       
 
        fs_err(sdp, "waiting for outstanding I/O\n");
 
@@ -124,7 +129,8 @@ int gfs2_lm_get_lock(struct gfs2_sbd *sdp, struct lm_lockname *name,
        if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
                error = -EIO;
        else
-               error = sdp->sd_lockstruct.ls_ops->lm_get_lock(sdp->sd_lockstruct.ls_lockspace, name, lockp);
+               error = sdp->sd_lockstruct.ls_ops->lm_get_lock(
+                               sdp->sd_lockstruct.ls_lockspace, name, lockp);
        return error;
 }
 
@@ -181,11 +187,13 @@ void gfs2_lm_unhold_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb)
                sdp->sd_lockstruct.ls_ops->lm_unhold_lvb(lock, lvb);
 }
 
+#if 0
 void gfs2_lm_sync_lvb(struct gfs2_sbd *sdp, lm_lock_t *lock, char *lvb)
 {
        if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
                sdp->sd_lockstruct.ls_ops->lm_sync_lvb(lock, lvb);
 }
+#endif  /*  0  */
 
 int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name,
                      struct file *file, struct file_lock *fl)
@@ -230,6 +238,7 @@ void gfs2_lm_recovery_done(struct gfs2_sbd *sdp, unsigned int jid,
                           unsigned int message)
 {
        if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
-               sdp->sd_lockstruct.ls_ops->lm_recovery_done(sdp->sd_lockstruct.ls_lockspace, jid, message);
+               sdp->sd_lockstruct.ls_ops->lm_recovery_done(
+                       sdp->sd_lockstruct.ls_lockspace, jid, message);
 }