aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2014-02-21 10:22:35 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2014-02-24 11:54:54 -0500
commitd69a3c6561362a53d1be908ca343d899161d602c (patch)
tree8e9827ef9c25a21fab641dcaf263f84b026d535e /fs/gfs2/lops.c
parent654a6d2f962edb7bf85973cfe93a04e24f56f902 (diff)
GFS2: Move log buffer lists into transaction
Over time, we hope to be able to improve the concurrency available in the log code. This is one small step towards that, by moving the buffer lists from the super block, and into the transaction structure, so that each transaction builds its own buffer lists. At transaction commit time, the buffer lists are merged into the currently accumulating transaction. That transaction then is passed into the before and after commit functions at journal flush time. Thus there should be no change in overall behaviour yet. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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);