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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index ee9ec7fa3011..23c6e72f5164 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -494,9 +494,11 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit,
494static void buf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) 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 unsigned int nbuf;
497 if (tr == NULL) 498 if (tr == NULL)
498 return; 499 return;
499 gfs2_before_commit(sdp, limit, sdp->sd_log_num_buf, &tr->tr_buf, 0); 500 nbuf = tr->tr_num_buf_new - tr->tr_num_buf_rm;
501 gfs2_before_commit(sdp, limit, nbuf, &tr->tr_buf, 0);
500} 502}
501 503
502static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) 504static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
@@ -511,11 +513,8 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
511 while (!list_empty(head)) { 513 while (!list_empty(head)) {
512 bd = list_entry(head->next, struct gfs2_bufdata, bd_list); 514 bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
513 list_del_init(&bd->bd_list); 515 list_del_init(&bd->bd_list);
514 sdp->sd_log_num_buf--;
515
516 gfs2_unpin(sdp, bd->bd_bh, tr); 516 gfs2_unpin(sdp, bd->bd_bh, tr);
517 } 517 }
518 gfs2_assert_warn(sdp, !sdp->sd_log_num_buf);
519} 518}
520 519
521static void buf_lo_before_scan(struct gfs2_jdesc *jd, 520static void buf_lo_before_scan(struct gfs2_jdesc *jd,
@@ -761,10 +760,12 @@ static void revoke_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
761 760
762static void databuf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) 761static void databuf_lo_before_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
763{ 762{
764 unsigned int limit = buf_limit(sdp) / 2; 763 unsigned int limit = databuf_limit(sdp);
764 unsigned int nbuf;
765 if (tr == NULL) 765 if (tr == NULL)
766 return; 766 return;
767 gfs2_before_commit(sdp, limit, sdp->sd_log_num_databuf, &tr->tr_databuf, 1); 767 nbuf = tr->tr_num_databuf_new - tr->tr_num_databuf_rm;
768 gfs2_before_commit(sdp, limit, nbuf, &tr->tr_databuf, 1);
768} 769}
769 770
770static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start, 771static int databuf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
@@ -849,10 +850,8 @@ static void databuf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
849 while (!list_empty(head)) { 850 while (!list_empty(head)) {
850 bd = list_entry(head->next, struct gfs2_bufdata, bd_list); 851 bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
851 list_del_init(&bd->bd_list); 852 list_del_init(&bd->bd_list);
852 sdp->sd_log_num_databuf--;
853 gfs2_unpin(sdp, bd->bd_bh, tr); 853 gfs2_unpin(sdp, bd->bd_bh, tr);
854 } 854 }
855 gfs2_assert_warn(sdp, !sdp->sd_log_num_databuf);
856} 855}
857 856
858 857