aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-05-01 12:00:34 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-05-02 04:14:36 -0400
commitc0752aa7e4d48cc19e167ccb0092bea8e5b6ca3a (patch)
tree2ff43322a35871364f9be2c2e4a6427db7db8a0f /fs/gfs2/log.c
parent1c47f09592148ba629edb2020d4dd94f81b16d11 (diff)
GFS2: eliminate log elements and simplify
This patch eliminates the gfs2_log_element data structure and rolls its two components into the gfs2_bufdata. This makes the code easier to understand and makes it easier to migrate to a rbtree to keep the list sorted. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index db9cb187b6a2..f4beeb9c81c1 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -486,8 +486,8 @@ static int bd_cmp(void *priv, struct list_head *a, struct list_head *b)
486{ 486{
487 struct gfs2_bufdata *bda, *bdb; 487 struct gfs2_bufdata *bda, *bdb;
488 488
489 bda = list_entry(a, struct gfs2_bufdata, bd_le.le_list); 489 bda = list_entry(a, struct gfs2_bufdata, bd_list);
490 bdb = list_entry(b, struct gfs2_bufdata, bd_le.le_list); 490 bdb = list_entry(b, struct gfs2_bufdata, bd_list);
491 491
492 if (bda->bd_bh->b_blocknr < bdb->bd_bh->b_blocknr) 492 if (bda->bd_bh->b_blocknr < bdb->bd_bh->b_blocknr)
493 return -1; 493 return -1;
@@ -505,8 +505,8 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp)
505 gfs2_log_lock(sdp); 505 gfs2_log_lock(sdp);
506 list_sort(NULL, &sdp->sd_log_le_ordered, &bd_cmp); 506 list_sort(NULL, &sdp->sd_log_le_ordered, &bd_cmp);
507 while (!list_empty(&sdp->sd_log_le_ordered)) { 507 while (!list_empty(&sdp->sd_log_le_ordered)) {
508 bd = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_bufdata, bd_le.le_list); 508 bd = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_bufdata, bd_list);
509 list_move(&bd->bd_le.le_list, &written); 509 list_move(&bd->bd_list, &written);
510 bh = bd->bd_bh; 510 bh = bd->bd_bh;
511 if (!buffer_dirty(bh)) 511 if (!buffer_dirty(bh))
512 continue; 512 continue;
@@ -533,7 +533,7 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)
533 533
534 gfs2_log_lock(sdp); 534 gfs2_log_lock(sdp);
535 while (!list_empty(&sdp->sd_log_le_ordered)) { 535 while (!list_empty(&sdp->sd_log_le_ordered)) {
536 bd = list_entry(sdp->sd_log_le_ordered.prev, struct gfs2_bufdata, bd_le.le_list); 536 bd = list_entry(sdp->sd_log_le_ordered.prev, struct gfs2_bufdata, bd_list);
537 bh = bd->bd_bh; 537 bh = bd->bd_bh;
538 if (buffer_locked(bh)) { 538 if (buffer_locked(bh)) {
539 get_bh(bh); 539 get_bh(bh);
@@ -543,7 +543,7 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)
543 gfs2_log_lock(sdp); 543 gfs2_log_lock(sdp);
544 continue; 544 continue;
545 } 545 }
546 list_del_init(&bd->bd_le.le_list); 546 list_del_init(&bd->bd_list);
547 } 547 }
548 gfs2_log_unlock(sdp); 548 gfs2_log_unlock(sdp);
549} 549}