Split gfs2_writepage into three cases
From da6ae988ab5a8f1a111b1dc857c705c2e143c309 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Fri, 28 Sep 2007 13:49:05 +0100
Subject: [PATCH] [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 <[email protected]>
fs/gfs2/lops.c +10 -7
@@ -556,17 +556,20 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)lock_buffer (bd->bd_bh);gfs2_log_lock (sdp); -if (!list_empty (&bd->bd_list_tr)) - goto out; - tr->tr_touched =1 ; -if (gfs2_is_jdata (ip)) { - tr->tr_num_buf++; -list_add (&bd->bd_list_tr, &tr->tr_list_buf); +if (tr) { +if (!list_empty (&bd->bd_list_tr)) + goto out; + tr->tr_touched =1 ; +if (gfs2_is_jdata (ip)) { + tr->tr_num_buf++; +list_add (&bd->bd_list_tr, &tr->tr_list_buf); + } }if (!list_empty (&le->le_list)) goto out; -__glock_lo_add (sdp, &bd->bd_gl->gl_le); +if (tr) +__glock_lo_add (sdp, &bd->bd_gl->gl_le);if (gfs2_is_jdata (ip)) {gfs2_pin (sdp, bd->bd_bh); tr->tr_num_databuf_new++;
fs/gfs2/ops_address.c +91 -21
151 lines not on this page · raw message
Signature · 1 line
1.5.1.2