aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 76693793cedd..ee9ec7fa3011 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -491,24 +491,23 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit,
491 gfs2_log_unlock(sdp); 491 gfs2_log_unlock(sdp);
492} 492}
493 493
494static void buf_lo_before_commit(struct gfs2_sbd *sdp) 494static void buf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
495{ 495{
496 unsigned int limit = buf_limit(sdp); /* 503 for 4k blocks */ 496 unsigned int limit = buf_limit(sdp); /* 503 for 4k blocks */
497 497 if (tr == NULL)
498 gfs2_before_commit(sdp, limit, sdp->sd_log_num_buf, 498 return;
499 &sdp->sd_log_le_buf, 0); 499 gfs2_before_commit(sdp, limit, sdp->sd_log_num_buf, &tr->tr_buf, 0);
500} 500}
501 501
502static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) 502static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
503{ 503{
504 struct list_head *head = &sdp->sd_log_le_buf; 504 struct list_head *head;
505 struct gfs2_bufdata *bd; 505 struct gfs2_bufdata *bd;
506 506
507 if (tr == NULL) { 507 if (tr == NULL)
508 gfs2_assert(sdp, list_empty(head));
509 return; 508 return;
510 }
511 509
510 head = &tr->tr_buf;
512 while (!list_empty(head)) { 511 while (!list_empty(head)) {
513 bd = list_entry(head->next, struct gfs2_bufdata, bd_list); 512 bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
514 list_del_init(&bd->bd_list); 513 list_del_init(&bd->bd_list);
@@ -620,7 +619,7 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
620 jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); 619 jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks);
621} 620}
622 621
623static void revoke_lo_before_commit(struct gfs2_sbd *sdp) 622static void revoke_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
624{ 623{
625 struct gfs2_meta_header *mh; 624 struct gfs2_meta_header *mh;
626 unsigned int offset; 625 unsigned int offset;
@@ -760,12 +759,12 @@ static void revoke_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
760 * 759 *
761 */ 760 */
762 761
763static void databuf_lo_before_commit(struct gfs2_sbd *sdp) 762static void databuf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
764{ 763{
765 unsigned int limit = buf_limit(sdp) / 2; 764 unsigned int limit = buf_limit(sdp) / 2;
766 765 if (tr == NULL)
767 gfs2_before_commit(sdp, limit, sdp->sd_log_num_databuf, 766 return;
768 &sdp->sd_log_le_databuf, 1); 767 gfs2_before_commit(sdp, limit, sdp->sd_log_num_databuf, &tr->tr_databuf, 1);
769} 768}
770 769
771static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start, 770static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
@@ -840,14 +839,13 @@ static void databuf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
840 839
841static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) 840static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
842{ 841{
843 struct list_head *head = &sdp->sd_log_le_databuf; 842 struct list_head *head;
844 struct gfs2_bufdata *bd; 843 struct gfs2_bufdata *bd;
845 844
846 if (tr == NULL) { 845 if (tr == NULL)
847 gfs2_assert(sdp, list_empty(head));
848 return; 846 return;
849 }
850 847
848 head = &tr->tr_databuf;
851 while (!list_empty(head)) { 849 while (!list_empty(head)) {
852 bd = list_entry(head->next, struct gfs2_bufdata, bd_list); 850 bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
853 list_del_init(&bd->bd_list); 851 list_del_init(&bd->bd_list);