Remove ail2 list from the ai
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.
fs/gfs2/incore.h +0 -2
@@ -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; };
fs/gfs2/log.c +2 -26
@@ -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 flif (!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 ==
fs/gfs2/lops.c +5 -9
@@ -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);
Signature · 1 line
1.5.1.2
Quoted 7 lines · Steven Whitehouse
Quoted 1 line
From
2a666f519dd12e8b3a82d1e16cad3114cfdd917dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Mon, 27 Aug 2007 16:42:29 +0100
Subject: [PATCH] [GFS2] Remove ail2 list from the aiThe 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:
Why is it no longer used?
Hi,
Quoted 9 lines · David Teigland
Quoted 7 lines · Steven Whitehouse
Quoted 1 line
From
2a666f519dd12e8b3a82d1e16cad3114cfdd917dMon Sep 17 00:00:00 2001From: Steven Whitehouse <[email protected]>
Date: Mon, 27 Aug 2007 16:42:29 +0100
Subject: [PATCH] [GFS2] Remove ail2 list from the aiThe ail2 list wasn't actually used for anything other than gathering buffers at the end of in-place writeback, so remove it.
Quoted 7 lines
cluster/doc/journaling.txthas a nice description of ail2 and what it does: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.