cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2] Remove ail2 list from the ai
@ 2007-08-27 16:00 Steven Whitehouse
  2007-08-27 16:30 ` David Teigland
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Whitehouse @ 2007-08-27 16:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From 2a666f519dd12e8b3a82d1e16cad3114cfdd917d Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
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 <swhiteho@redhat.com>

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Cluster-devel] [GFS2] Remove ail2 list from the ai
  2007-08-27 16:00 [Cluster-devel] [GFS2] Remove ail2 list from the ai Steven Whitehouse
@ 2007-08-27 16:30 ` David Teigland
  2007-08-27 16:46   ` Steven Whitehouse
  0 siblings, 1 reply; 3+ messages in thread
From: David Teigland @ 2007-08-27 16:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Mon, Aug 27, 2007 at 05:00:06PM +0100, Steven Whitehouse wrote:
> >From 2a666f519dd12e8b3a82d1e16cad3114cfdd917d Mon Sep 17 00:00:00 2001
> From: Steven Whitehouse <swhiteho@redhat.com>
> 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.

cluster/doc/journaling.txt has a nice description of ail2 and what it
does:

http://sources.redhat.com/cgi-bin/cvsweb.cgi/cluster/doc/journaling.txt?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=cluster

Why is it no longer used?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] [GFS2] Remove ail2 list from the ai
  2007-08-27 16:30 ` David Teigland
@ 2007-08-27 16:46   ` Steven Whitehouse
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Whitehouse @ 2007-08-27 16:46 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

On Mon, 2007-08-27 at 11:30 -0500, David Teigland wrote:
> On Mon, Aug 27, 2007 at 05:00:06PM +0100, Steven Whitehouse wrote:
> > >From 2a666f519dd12e8b3a82d1e16cad3114cfdd917d Mon Sep 17 00:00:00 2001
> > From: Steven Whitehouse <swhiteho@redhat.com>
> > 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.
> 
> cluster/doc/journaling.txt has a nice description of ail2 and what it
> does:
> 
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/cluster/doc/journaling.txt?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=cluster
> 
> Why is it no longer used?
> 

Sorry, I'd not spotted that gfs2_ail_empty_gl() was always processing
entries that were only on ail2. I need to rethink this one, but we do
need to make some changes in this area still,

Steve.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-27 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-27 16:00 [Cluster-devel] [GFS2] Remove ail2 list from the ai Steven Whitehouse
2007-08-27 16:30 ` David Teigland
2007-08-27 16:46   ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).