[GFS2] Remove semaphore.h from C files
[safe/jmp/linux-2.6] / fs / gfs2 / meta_io.c
index b85fa24..92c1a3f 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/swap.h>
 #include <linux/delay.h>
 #include <linux/gfs2_ondisk.h>
-#include <asm/semaphore.h>
 
 #include "gfs2.h"
 #include "lm_interface.h"
@@ -59,11 +58,12 @@ static int gfs2_aspace_writepage(struct page *page,
 
 static void stuck_releasepage(struct buffer_head *bh)
 {
-       struct gfs2_sbd *sdp = bh->b_page->mapping->host->i_sb->s_fs_info;
+       struct inode *inode = bh->b_page->mapping->host;
+       struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
        struct gfs2_bufdata *bd = bh->b_private;
        struct gfs2_glock *gl;
 
-       fs_warn(sdp, "stuck in gfs2_releasepage()\n");
+       fs_warn(sdp, "stuck in gfs2_releasepage() %p\n", inode);
        fs_warn(sdp, "blkno = %llu, bh->b_count = %d\n",
                (uint64_t)bh->b_blocknr, atomic_read(&bh->b_count));
        fs_warn(sdp, "pinned = %u\n", buffer_pinned(bh));
@@ -191,7 +191,6 @@ struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp)
                aspace->u.generic_ip = NULL;
                insert_inode_hash(aspace);
        }
-
        return aspace;
 }
 
@@ -214,6 +213,8 @@ void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
        struct buffer_head *bh;
        int retry;
 
+       BUG_ON(!spin_is_locked(&sdp->sd_log_lock));
+
        do {
                retry = 0;
 
@@ -224,8 +225,11 @@ void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
                        gfs2_assert(sdp, bd->bd_ail == ai);
 
                        if (!buffer_busy(bh)) {
-                               if (!buffer_uptodate(bh))
+                               if (!buffer_uptodate(bh)) {
+                                       gfs2_log_unlock(sdp);
                                        gfs2_io_error_bh(sdp, bh);
+                                       gfs2_log_lock(sdp);
+                               }
                                list_move(&bd->bd_ail_st_list,
                                          &ai->ai_ail2_list);
                                continue;
@@ -353,7 +357,7 @@ void gfs2_ail_empty_gl(struct gfs2_glock *gl)
        gfs2_log_unlock(sdp);
 
        gfs2_trans_end(sdp);
-       gfs2_log_flush(sdp);
+       gfs2_log_flush(sdp, NULL);
 }
 
 /**
@@ -876,12 +880,12 @@ void gfs2_meta_ra(struct gfs2_glock *gl, uint64_t dblock, uint32_t extlen)
 
 void gfs2_meta_syncfs(struct gfs2_sbd *sdp)
 {
-       gfs2_log_flush(sdp);
+       gfs2_log_flush(sdp, NULL);
        for (;;) {
                gfs2_ail1_start(sdp, DIO_ALL);
                if (gfs2_ail1_empty(sdp, DIO_ALL))
                        break;
-               msleep(100);
+               msleep(10);
        }
 }