aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.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/trans.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/trans.c')
-rw-r--r--fs/gfs2/trans.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 963b28c50fd4..e0464a22908c 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -51,6 +51,9 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
51 if (revokes) 51 if (revokes)
52 tr->tr_reserved += gfs2_struct2blk(sdp, revokes, 52 tr->tr_reserved += gfs2_struct2blk(sdp, revokes,
53 sizeof(u64)); 53 sizeof(u64));
54 INIT_LIST_HEAD(&tr->tr_databuf);
55 INIT_LIST_HEAD(&tr->tr_buf);
56
54 sb_start_intwrite(sdp->sd_vfs); 57 sb_start_intwrite(sdp->sd_vfs);
55 gfs2_holder_init(sdp->sd_trans_gl, LM_ST_SHARED, 0, &tr->tr_t_gh); 58 gfs2_holder_init(sdp->sd_trans_gl, LM_ST_SHARED, 0, &tr->tr_t_gh);
56 59
@@ -211,7 +214,7 @@ void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh)
211 gfs2_pin(sdp, bd->bd_bh); 214 gfs2_pin(sdp, bd->bd_bh);
212 tr->tr_num_databuf_new++; 215 tr->tr_num_databuf_new++;
213 sdp->sd_log_num_databuf++; 216 sdp->sd_log_num_databuf++;
214 list_add_tail(&bd->bd_list, &sdp->sd_log_le_databuf); 217 list_add_tail(&bd->bd_list, &tr->tr_databuf);
215 } 218 }
216 gfs2_log_unlock(sdp); 219 gfs2_log_unlock(sdp);
217 unlock_buffer(bh); 220 unlock_buffer(bh);
@@ -239,7 +242,7 @@ static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
239 mh->__pad0 = cpu_to_be64(0); 242 mh->__pad0 = cpu_to_be64(0);
240 mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid); 243 mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid);
241 sdp->sd_log_num_buf++; 244 sdp->sd_log_num_buf++;
242 list_add(&bd->bd_list, &sdp->sd_log_le_buf); 245 list_add(&bd->bd_list, &tr->tr_buf);
243 tr->tr_num_buf_new++; 246 tr->tr_num_buf_new++;
244} 247}
245 248