diff options
author | Bob Peterson <rpeterso@redhat.com> | 2012-05-01 12:00:34 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-05-02 04:14:36 -0400 |
commit | c0752aa7e4d48cc19e167ccb0092bea8e5b6ca3a (patch) | |
tree | 2ff43322a35871364f9be2c2e4a6427db7db8a0f /fs/gfs2 | |
parent | 1c47f09592148ba629edb2020d4dd94f81b16d11 (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')
-rw-r--r-- | fs/gfs2/aops.c | 8 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 12 | ||||
-rw-r--r-- | fs/gfs2/log.c | 12 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 41 | ||||
-rw-r--r-- | fs/gfs2/lops.h | 12 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 6 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 12 |
7 files changed, 48 insertions, 55 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 695bbe16d1f0..e80a464850c8 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -942,8 +942,8 @@ static void gfs2_discard(struct gfs2_sbd *sdp, struct buffer_head *bh) | |||
942 | clear_buffer_dirty(bh); | 942 | clear_buffer_dirty(bh); |
943 | bd = bh->b_private; | 943 | bd = bh->b_private; |
944 | if (bd) { | 944 | if (bd) { |
945 | if (!list_empty(&bd->bd_le.le_list) && !buffer_pinned(bh)) | 945 | if (!list_empty(&bd->bd_list) && !buffer_pinned(bh)) |
946 | list_del_init(&bd->bd_le.le_list); | 946 | list_del_init(&bd->bd_list); |
947 | else | 947 | else |
948 | gfs2_remove_from_journal(bh, current->journal_info, 0); | 948 | gfs2_remove_from_journal(bh, current->journal_info, 0); |
949 | } | 949 | } |
@@ -1083,9 +1083,9 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask) | |||
1083 | bd = bh->b_private; | 1083 | bd = bh->b_private; |
1084 | if (bd) { | 1084 | if (bd) { |
1085 | gfs2_assert_warn(sdp, bd->bd_bh == bh); | 1085 | gfs2_assert_warn(sdp, bd->bd_bh == bh); |
1086 | if (!list_empty(&bd->bd_le.le_list)) { | 1086 | if (!list_empty(&bd->bd_list)) { |
1087 | if (!buffer_pinned(bh)) | 1087 | if (!buffer_pinned(bh)) |
1088 | list_del_init(&bd->bd_le.le_list); | 1088 | list_del_init(&bd->bd_list); |
1089 | else | 1089 | else |
1090 | bd = NULL; | 1090 | bd = NULL; |
1091 | } | 1091 | } |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index f1189a2cdb78..aa9949e5de26 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define DIO_METADATA 0x00000020 | 26 | #define DIO_METADATA 0x00000020 |
27 | 27 | ||
28 | struct gfs2_log_operations; | 28 | struct gfs2_log_operations; |
29 | struct gfs2_log_element; | 29 | struct gfs2_bufdata; |
30 | struct gfs2_holder; | 30 | struct gfs2_holder; |
31 | struct gfs2_glock; | 31 | struct gfs2_glock; |
32 | struct gfs2_quota_data; | 32 | struct gfs2_quota_data; |
@@ -52,7 +52,7 @@ struct gfs2_log_header_host { | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | struct gfs2_log_operations { | 54 | struct gfs2_log_operations { |
55 | void (*lo_add) (struct gfs2_sbd *sdp, struct gfs2_log_element *le); | 55 | void (*lo_add) (struct gfs2_sbd *sdp, struct gfs2_bufdata *bd); |
56 | void (*lo_before_commit) (struct gfs2_sbd *sdp); | 56 | void (*lo_before_commit) (struct gfs2_sbd *sdp); |
57 | void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai); | 57 | void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai); |
58 | void (*lo_before_scan) (struct gfs2_jdesc *jd, | 58 | void (*lo_before_scan) (struct gfs2_jdesc *jd, |
@@ -64,11 +64,6 @@ struct gfs2_log_operations { | |||
64 | const char *lo_name; | 64 | const char *lo_name; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct gfs2_log_element { | ||
68 | struct list_head le_list; | ||
69 | const struct gfs2_log_operations *le_ops; | ||
70 | }; | ||
71 | |||
72 | #define GBF_FULL 1 | 67 | #define GBF_FULL 1 |
73 | 68 | ||
74 | struct gfs2_bitmap { | 69 | struct gfs2_bitmap { |
@@ -120,7 +115,8 @@ struct gfs2_bufdata { | |||
120 | struct gfs2_glock *bd_gl; | 115 | struct gfs2_glock *bd_gl; |
121 | u64 bd_blkno; | 116 | u64 bd_blkno; |
122 | 117 | ||
123 | struct gfs2_log_element bd_le; | 118 | struct list_head bd_list; |
119 | const struct gfs2_log_operations *bd_ops; | ||
124 | 120 | ||
125 | struct gfs2_ail *bd_ail; | 121 | struct gfs2_ail *bd_ail; |
126 | struct list_head bd_ail_st_list; | 122 | struct list_head bd_ail_st_list; |
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 | } |
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 11fedb569225..852c1be1dd3b 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -388,9 +388,8 @@ static struct page *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type, | |||
388 | return page; | 388 | return page; |
389 | } | 389 | } |
390 | 390 | ||
391 | static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | 391 | static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
392 | { | 392 | { |
393 | struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le); | ||
394 | struct gfs2_meta_header *mh; | 393 | struct gfs2_meta_header *mh; |
395 | struct gfs2_trans *tr; | 394 | struct gfs2_trans *tr; |
396 | 395 | ||
@@ -398,7 +397,7 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
398 | gfs2_log_lock(sdp); | 397 | gfs2_log_lock(sdp); |
399 | tr = current->journal_info; | 398 | tr = current->journal_info; |
400 | tr->tr_touched = 1; | 399 | tr->tr_touched = 1; |
401 | if (!list_empty(&le->le_list)) | 400 | if (!list_empty(&bd->bd_list)) |
402 | goto out; | 401 | goto out; |
403 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); | 402 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
404 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); | 403 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
@@ -408,7 +407,7 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
408 | mh->__pad0 = cpu_to_be64(0); | 407 | mh->__pad0 = cpu_to_be64(0); |
409 | mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid); | 408 | mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid); |
410 | sdp->sd_log_num_buf++; | 409 | sdp->sd_log_num_buf++; |
411 | list_add(&le->le_list, &sdp->sd_log_le_buf); | 410 | list_add(&bd->bd_list, &sdp->sd_log_le_buf); |
412 | tr->tr_num_buf_new++; | 411 | tr->tr_num_buf_new++; |
413 | out: | 412 | out: |
414 | gfs2_log_unlock(sdp); | 413 | gfs2_log_unlock(sdp); |
@@ -440,7 +439,7 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, | |||
440 | __be64 *ptr; | 439 | __be64 *ptr; |
441 | 440 | ||
442 | gfs2_log_lock(sdp); | 441 | gfs2_log_lock(sdp); |
443 | bd1 = bd2 = list_prepare_entry(bd1, blist, bd_le.le_list); | 442 | bd1 = bd2 = list_prepare_entry(bd1, blist, bd_list); |
444 | while(total) { | 443 | while(total) { |
445 | num = total; | 444 | num = total; |
446 | if (total > limit) | 445 | if (total > limit) |
@@ -452,7 +451,7 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, | |||
452 | ptr = (__be64 *)(ld + 1); | 451 | ptr = (__be64 *)(ld + 1); |
453 | 452 | ||
454 | n = 0; | 453 | n = 0; |
455 | list_for_each_entry_continue(bd1, blist, bd_le.le_list) { | 454 | list_for_each_entry_continue(bd1, blist, bd_list) { |
456 | *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr); | 455 | *ptr++ = cpu_to_be64(bd1->bd_bh->b_blocknr); |
457 | if (is_databuf) { | 456 | if (is_databuf) { |
458 | gfs2_check_magic(bd1->bd_bh); | 457 | gfs2_check_magic(bd1->bd_bh); |
@@ -467,7 +466,7 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit, | |||
467 | gfs2_log_lock(sdp); | 466 | gfs2_log_lock(sdp); |
468 | 467 | ||
469 | n = 0; | 468 | n = 0; |
470 | list_for_each_entry_continue(bd2, blist, bd_le.le_list) { | 469 | list_for_each_entry_continue(bd2, blist, bd_list) { |
471 | get_bh(bd2->bd_bh); | 470 | get_bh(bd2->bd_bh); |
472 | gfs2_log_unlock(sdp); | 471 | gfs2_log_unlock(sdp); |
473 | lock_buffer(bd2->bd_bh); | 472 | lock_buffer(bd2->bd_bh); |
@@ -513,8 +512,8 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai) | |||
513 | struct gfs2_bufdata *bd; | 512 | struct gfs2_bufdata *bd; |
514 | 513 | ||
515 | while (!list_empty(head)) { | 514 | while (!list_empty(head)) { |
516 | bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list); | 515 | bd = list_entry(head->next, struct gfs2_bufdata, bd_list); |
517 | list_del_init(&bd->bd_le.le_list); | 516 | list_del_init(&bd->bd_list); |
518 | sdp->sd_log_num_buf--; | 517 | sdp->sd_log_num_buf--; |
519 | 518 | ||
520 | gfs2_unpin(sdp, bd->bd_bh, ai); | 519 | gfs2_unpin(sdp, bd->bd_bh, ai); |
@@ -601,9 +600,8 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) | |||
601 | jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); | 600 | jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); |
602 | } | 601 | } |
603 | 602 | ||
604 | static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | 603 | static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
605 | { | 604 | { |
606 | struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le); | ||
607 | struct gfs2_glock *gl = bd->bd_gl; | 605 | struct gfs2_glock *gl = bd->bd_gl; |
608 | struct gfs2_trans *tr; | 606 | struct gfs2_trans *tr; |
609 | 607 | ||
@@ -613,7 +611,7 @@ static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
613 | sdp->sd_log_num_revoke++; | 611 | sdp->sd_log_num_revoke++; |
614 | atomic_inc(&gl->gl_revokes); | 612 | atomic_inc(&gl->gl_revokes); |
615 | set_bit(GLF_LFLUSH, &gl->gl_flags); | 613 | set_bit(GLF_LFLUSH, &gl->gl_flags); |
616 | list_add(&le->le_list, &sdp->sd_log_le_revoke); | 614 | list_add(&bd->bd_list, &sdp->sd_log_le_revoke); |
617 | } | 615 | } |
618 | 616 | ||
619 | static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | 617 | static void revoke_lo_before_commit(struct gfs2_sbd *sdp) |
@@ -634,7 +632,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | |||
634 | ld = page_address(page); | 632 | ld = page_address(page); |
635 | offset = sizeof(struct gfs2_log_descriptor); | 633 | offset = sizeof(struct gfs2_log_descriptor); |
636 | 634 | ||
637 | list_for_each_entry(bd, head, bd_le.le_list) { | 635 | list_for_each_entry(bd, head, bd_list) { |
638 | sdp->sd_log_num_revoke--; | 636 | sdp->sd_log_num_revoke--; |
639 | 637 | ||
640 | if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) { | 638 | if (offset + sizeof(u64) > sdp->sd_sb.sb_bsize) { |
@@ -664,8 +662,8 @@ static void revoke_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai) | |||
664 | struct gfs2_glock *gl; | 662 | struct gfs2_glock *gl; |
665 | 663 | ||
666 | while (!list_empty(head)) { | 664 | while (!list_empty(head)) { |
667 | bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list); | 665 | bd = list_entry(head->next, struct gfs2_bufdata, bd_list); |
668 | list_del_init(&bd->bd_le.le_list); | 666 | list_del_init(&bd->bd_list); |
669 | gl = bd->bd_gl; | 667 | gl = bd->bd_gl; |
670 | atomic_dec(&gl->gl_revokes); | 668 | atomic_dec(&gl->gl_revokes); |
671 | clear_bit(GLF_LFLUSH, &gl->gl_flags); | 669 | clear_bit(GLF_LFLUSH, &gl->gl_flags); |
@@ -768,9 +766,8 @@ static void revoke_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) | |||
768 | * blocks, which isn't an enormous overhead but twice as much as | 766 | * blocks, which isn't an enormous overhead but twice as much as |
769 | * for normal metadata blocks. | 767 | * for normal metadata blocks. |
770 | */ | 768 | */ |
771 | static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | 769 | static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
772 | { | 770 | { |
773 | struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le); | ||
774 | struct gfs2_trans *tr = current->journal_info; | 771 | struct gfs2_trans *tr = current->journal_info; |
775 | struct address_space *mapping = bd->bd_bh->b_page->mapping; | 772 | struct address_space *mapping = bd->bd_bh->b_page->mapping; |
776 | struct gfs2_inode *ip = GFS2_I(mapping->host); | 773 | struct gfs2_inode *ip = GFS2_I(mapping->host); |
@@ -779,7 +776,7 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
779 | gfs2_log_lock(sdp); | 776 | gfs2_log_lock(sdp); |
780 | if (tr) | 777 | if (tr) |
781 | tr->tr_touched = 1; | 778 | tr->tr_touched = 1; |
782 | if (!list_empty(&le->le_list)) | 779 | if (!list_empty(&bd->bd_list)) |
783 | goto out; | 780 | goto out; |
784 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); | 781 | set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
785 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); | 782 | set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); |
@@ -787,9 +784,9 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | |||
787 | gfs2_pin(sdp, bd->bd_bh); | 784 | gfs2_pin(sdp, bd->bd_bh); |
788 | tr->tr_num_databuf_new++; | 785 | tr->tr_num_databuf_new++; |
789 | sdp->sd_log_num_databuf++; | 786 | sdp->sd_log_num_databuf++; |
790 | list_add_tail(&le->le_list, &sdp->sd_log_le_databuf); | 787 | list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); |
791 | } else { | 788 | } else { |
792 | list_add_tail(&le->le_list, &sdp->sd_log_le_ordered); | 789 | list_add_tail(&bd->bd_list, &sdp->sd_log_le_ordered); |
793 | } | 790 | } |
794 | out: | 791 | out: |
795 | gfs2_log_unlock(sdp); | 792 | gfs2_log_unlock(sdp); |
@@ -885,8 +882,8 @@ static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai) | |||
885 | struct gfs2_bufdata *bd; | 882 | struct gfs2_bufdata *bd; |
886 | 883 | ||
887 | while (!list_empty(head)) { | 884 | while (!list_empty(head)) { |
888 | bd = list_entry(head->next, struct gfs2_bufdata, bd_le.le_list); | 885 | bd = list_entry(head->next, struct gfs2_bufdata, bd_list); |
889 | list_del_init(&bd->bd_le.le_list); | 886 | list_del_init(&bd->bd_list); |
890 | sdp->sd_log_num_databuf--; | 887 | sdp->sd_log_num_databuf--; |
891 | gfs2_unpin(sdp, bd->bd_bh, ai); | 888 | gfs2_unpin(sdp, bd->bd_bh, ai); |
892 | } | 889 | } |
diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h index 825356d9dc14..954a330585f4 100644 --- a/fs/gfs2/lops.h +++ b/fs/gfs2/lops.h | |||
@@ -46,17 +46,17 @@ static inline unsigned int databuf_limit(struct gfs2_sbd *sdp) | |||
46 | return limit; | 46 | return limit; |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void lops_init_le(struct gfs2_log_element *le, | 49 | static inline void lops_init_le(struct gfs2_bufdata *bd, |
50 | const struct gfs2_log_operations *lops) | 50 | const struct gfs2_log_operations *lops) |
51 | { | 51 | { |
52 | INIT_LIST_HEAD(&le->le_list); | 52 | INIT_LIST_HEAD(&bd->bd_list); |
53 | le->le_ops = lops; | 53 | bd->bd_ops = lops; |
54 | } | 54 | } |
55 | 55 | ||
56 | static inline void lops_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) | 56 | static inline void lops_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
57 | { | 57 | { |
58 | if (le->le_ops->lo_add) | 58 | if (bd->bd_ops->lo_add) |
59 | le->le_ops->lo_add(sdp, le); | 59 | bd->bd_ops->lo_add(sdp, bd); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void lops_before_commit(struct gfs2_sbd *sdp) | 62 | static inline void lops_before_commit(struct gfs2_sbd *sdp) |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 8a82a4dc711f..7f69ae2595f0 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -294,9 +294,9 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, | |||
294 | bd->bd_gl = gl; | 294 | bd->bd_gl = gl; |
295 | 295 | ||
296 | if (meta) | 296 | if (meta) |
297 | lops_init_le(&bd->bd_le, &gfs2_buf_lops); | 297 | lops_init_le(bd, &gfs2_buf_lops); |
298 | else | 298 | else |
299 | lops_init_le(&bd->bd_le, &gfs2_databuf_lops); | 299 | lops_init_le(bd, &gfs2_databuf_lops); |
300 | bh->b_private = bd; | 300 | bh->b_private = bd; |
301 | 301 | ||
302 | if (meta) | 302 | if (meta) |
@@ -312,7 +312,7 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int | |||
312 | if (test_clear_buffer_pinned(bh)) { | 312 | if (test_clear_buffer_pinned(bh)) { |
313 | trace_gfs2_pin(bd, 0); | 313 | trace_gfs2_pin(bd, 0); |
314 | atomic_dec(&sdp->sd_log_pinned); | 314 | atomic_dec(&sdp->sd_log_pinned); |
315 | list_del_init(&bd->bd_le.le_list); | 315 | list_del_init(&bd->bd_list); |
316 | if (meta) { | 316 | if (meta) { |
317 | gfs2_assert_warn(sdp, sdp->sd_log_num_buf); | 317 | gfs2_assert_warn(sdp, sdp->sd_log_num_buf); |
318 | sdp->sd_log_num_buf--; | 318 | sdp->sd_log_num_buf--; |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 8fb631769172..ad3e2fb763d7 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -158,16 +158,16 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) | |||
158 | gfs2_attach_bufdata(gl, bh, meta); | 158 | gfs2_attach_bufdata(gl, bh, meta); |
159 | bd = bh->b_private; | 159 | bd = bh->b_private; |
160 | } | 160 | } |
161 | lops_add(sdp, &bd->bd_le); | 161 | lops_add(sdp, bd); |
162 | } | 162 | } |
163 | 163 | ||
164 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | 164 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
165 | { | 165 | { |
166 | BUG_ON(!list_empty(&bd->bd_le.le_list)); | 166 | BUG_ON(!list_empty(&bd->bd_list)); |
167 | BUG_ON(!list_empty(&bd->bd_ail_st_list)); | 167 | BUG_ON(!list_empty(&bd->bd_ail_st_list)); |
168 | BUG_ON(!list_empty(&bd->bd_ail_gl_list)); | 168 | BUG_ON(!list_empty(&bd->bd_ail_gl_list)); |
169 | lops_init_le(&bd->bd_le, &gfs2_revoke_lops); | 169 | lops_init_le(bd, &gfs2_revoke_lops); |
170 | lops_add(sdp, &bd->bd_le); | 170 | lops_add(sdp, bd); |
171 | } | 171 | } |
172 | 172 | ||
173 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) | 173 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) |
@@ -177,9 +177,9 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) | |||
177 | unsigned int n = len; | 177 | unsigned int n = len; |
178 | 178 | ||
179 | gfs2_log_lock(sdp); | 179 | gfs2_log_lock(sdp); |
180 | list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_le.le_list) { | 180 | list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_list) { |
181 | if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) { | 181 | if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) { |
182 | list_del_init(&bd->bd_le.le_list); | 182 | list_del_init(&bd->bd_list); |
183 | gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); | 183 | gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); |
184 | sdp->sd_log_num_revoke--; | 184 | sdp->sd_log_num_revoke--; |
185 | kmem_cache_free(gfs2_bufdata_cachep, bd); | 185 | kmem_cache_free(gfs2_bufdata_cachep, bd); |