>From 2a666f519dd12e8b3a82d1e16cad3114cfdd917d Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[EMAIL PROTECTED]>
Date: Mon, 27 Aug 2007 16:42:29 +0100
Subject: [PATCH] [GFS2] Remove ail2 list from the ai

The ail2 list wasn't actually used for anything other than gathering
buffers at the end of in-place writeback, so remove it.

Signed-off-by: Steven Whitehouse <[EMAIL PROTECTED]>

diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 23b611a..540ca0c 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -373,8 +373,6 @@ struct gfs2_ail {
 
        unsigned int ai_first;
        struct list_head ai_ail1_list;
-       struct list_head ai_ail2_list;
-
        u64 ai_sync_gen;
 };
 
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index d8232ec..b5f5cb1 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -109,7 +109,7 @@ static void gfs2_ail1_start_one(struct gfs2_sbd *sdp, 
struct gfs2_ail *ai)
                                        gfs2_io_error_bh(sdp, bh);
                                        gfs2_log_lock(sdp);
                                }
-                               list_move(&bd->bd_ail_st_list, 
&ai->ai_ail2_list);
+                               
gfs2_remove_from_ail(bd->bd_bh->b_page->mapping, bd);
                                continue;
                        }
 
@@ -157,7 +157,7 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct 
gfs2_ail *ai, int fl
                if (!buffer_uptodate(bh))
                        gfs2_io_error_bh(sdp, bh);
 
-               list_move(&bd->bd_ail_st_list, &ai->ai_ail2_list);
+               gfs2_remove_from_ail(bd->bd_bh->b_page->mapping, bd);
        }
 
        return list_empty(&ai->ai_ail1_list);
@@ -227,27 +227,6 @@ int gfs2_ail1_empty(struct gfs2_sbd *sdp, int flags)
        return ret;
 }
 
-
-/**
- * gfs2_ail2_empty_one - Check whether or not a trans in the AIL has been 
synced
- * @sdp: the filesystem
- * @ai: the AIL entry
- *
- */
-
-static void gfs2_ail2_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
-{
-       struct list_head *head = &ai->ai_ail2_list;
-       struct gfs2_bufdata *bd;
-
-       while (!list_empty(head)) {
-               bd = list_entry(head->prev, struct gfs2_bufdata,
-                               bd_ail_st_list);
-               gfs2_assert(sdp, bd->bd_ail == ai);
-               gfs2_remove_from_ail(bd->bd_bh->b_page->mapping, bd);
-       }
-}
-
 static void ail2_empty(struct gfs2_sbd *sdp, unsigned int new_tail)
 {
        struct gfs2_ail *ai, *safe;
@@ -264,10 +243,8 @@ static void ail2_empty(struct gfs2_sbd *sdp, unsigned int 
new_tail)
                if (!rm)
                        continue;
 
-               gfs2_ail2_empty_one(sdp, ai);
                list_del(&ai->ai_list);
                gfs2_assert_warn(sdp, list_empty(&ai->ai_ail1_list));
-               gfs2_assert_warn(sdp, list_empty(&ai->ai_ail2_list));
                kfree(ai);
        }
 
@@ -645,7 +622,6 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock 
*gl)
 
        ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL);
        INIT_LIST_HEAD(&ai->ai_ail1_list);
-       INIT_LIST_HEAD(&ai->ai_ail2_list);
 
        gfs2_assert_withdraw(sdp,
                             sdp->sd_log_num_buf + sdp->sd_log_num_jdata ==
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 3ec5871..e76ba7f 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -50,7 +50,7 @@ static void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head 
*bh)
         * to in-place disk block, remove it from the AIL.
         */
        if (bd->bd_ail)
-               list_move(&bd->bd_ail_st_list, &bd->bd_ail->ai_ail2_list);
+               gfs2_remove_from_ail(NULL, bd);
        get_bh(bh);
 }
 
@@ -66,6 +66,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct 
buffer_head *bh,
                       struct gfs2_ail *ai)
 {
        struct gfs2_bufdata *bd = bh->b_private;
+       struct gfs2_glock *gl = bd->bd_gl;
 
        gfs2_assert_withdraw(sdp, buffer_uptodate(bh));
 
@@ -77,14 +78,9 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct 
buffer_head *bh,
        clear_buffer_pinned(bh);
 
        gfs2_log_lock(sdp);
-       if (bd->bd_ail) {
-               list_del(&bd->bd_ail_st_list);
-               brelse(bh);
-       } else {
-               struct gfs2_glock *gl = bd->bd_gl;
-               list_add(&bd->bd_ail_gl_list, &gl->gl_ail_list);
-               atomic_inc(&gl->gl_ail_count);
-       }
+       BUG_ON(bd->bd_ail);
+       list_add(&bd->bd_ail_gl_list, &gl->gl_ail_list);
+       atomic_inc(&gl->gl_ail_count);
        bd->bd_ail = ai;
        list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list);
        gfs2_log_unlock(sdp);
-- 
1.5.1.2



Reply via email to