aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-09-28 08:49:05 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:07:25 -0500
commit9ff8ec32e58875022447af619bec6e5aee7c77e4 (patch)
tree0c626762f334d1cc066113b3e47a2fa02a72af0c /fs/gfs2/lops.c
parent5561093e2cac9f7d2a77e39cc689b8d2b7f9b2bc (diff)
[GFS2] Split gfs2_writepage into three cases
This patch splits gfs2_writepage into separate functions for each of the three cases: writeback, ordered and journalled. As a result it becomes a lot easier to see what each one is doing. The common code is moved into gfs2_writepage_common. This fixes a performance bug where we were doing more work than strictly required in the ordered write case. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 6c27cea761c6..e901f8f7d650 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -556,17 +556,20 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
556 556
557 lock_buffer(bd->bd_bh); 557 lock_buffer(bd->bd_bh);
558 gfs2_log_lock(sdp); 558 gfs2_log_lock(sdp);
559 if (!list_empty(&bd->bd_list_tr)) 559 if (tr) {
560 goto out; 560 if (!list_empty(&bd->bd_list_tr))
561 tr->tr_touched = 1; 561 goto out;
562 if (gfs2_is_jdata(ip)) { 562 tr->tr_touched = 1;
563 tr->tr_num_buf++; 563 if (gfs2_is_jdata(ip)) {
564 list_add(&bd->bd_list_tr, &tr->tr_list_buf); 564 tr->tr_num_buf++;
565 list_add(&bd->bd_list_tr, &tr->tr_list_buf);
566 }
565 } 567 }
566 if (!list_empty(&le->le_list)) 568 if (!list_empty(&le->le_list))
567 goto out; 569 goto out;
568 570
569 __glock_lo_add(sdp, &bd->bd_gl->gl_le); 571 if (tr)
572 __glock_lo_add(sdp, &bd->bd_gl->gl_le);
570 if (gfs2_is_jdata(ip)) { 573 if (gfs2_is_jdata(ip)) {
571 gfs2_pin(sdp, bd->bd_bh); 574 gfs2_pin(sdp, bd->bd_bh);
572 tr->tr_num_databuf_new++; 575 tr->tr_num_databuf_new++;