aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-11-02 04:39:34 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:07:42 -0500
commit3042a2ccd68d2b609d283219e51cba363aa35c1d (patch)
tree032653f2111bf20c1f4610d3801c42020c3a1abd /fs/gfs2/glock.c
parent52d4c74b08bf859f698ddb4e8a43c0dc8d4a0685 (diff)
[GFS2] Reorder writeback for glock sync
Previously we were doing (write data, wait for data, write metadata, wait for metadata). After this patch we so (write metadata, write data, wait for data, wait for metadata) which should be more efficient. Also I noticed that the drop_bh and xmote_bh functions were almost identical. In fact the only difference was a single test, and that test is such that in the drop_bh case, it would always evaluate to the correct result. As such we can use the xmote_bh functions in all the places where we were using the drop_bh function and remove the drop_bh functions. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 159a5479c4e4..e668808b127f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -947,8 +947,8 @@ static void gfs2_glock_drop_th(struct gfs2_glock *gl)
947 const struct gfs2_glock_operations *glops = gl->gl_ops; 947 const struct gfs2_glock_operations *glops = gl->gl_ops;
948 unsigned int ret; 948 unsigned int ret;
949 949
950 if (glops->go_drop_th) 950 if (glops->go_xmote_th)
951 glops->go_drop_th(gl); 951 glops->go_xmote_th(gl);
952 952
953 gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags)); 953 gfs2_assert_warn(sdp, test_bit(GLF_LOCK, &gl->gl_flags));
954 gfs2_assert_warn(sdp, list_empty(&gl->gl_holders)); 954 gfs2_assert_warn(sdp, list_empty(&gl->gl_holders));
@@ -1252,12 +1252,11 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
1252 list_del_init(&gh->gh_list); 1252 list_del_init(&gh->gh_list);
1253 1253
1254 if (list_empty(&gl->gl_holders)) { 1254 if (list_empty(&gl->gl_holders)) {
1255 spin_unlock(&gl->gl_spin); 1255 if (glops->go_unlock) {
1256 1256 spin_unlock(&gl->gl_spin);
1257 if (glops->go_unlock)
1258 glops->go_unlock(gh); 1257 glops->go_unlock(gh);
1259 1258 spin_lock(&gl->gl_spin);
1260 spin_lock(&gl->gl_spin); 1259 }
1261 gl->gl_stamp = jiffies; 1260 gl->gl_stamp = jiffies;
1262 } 1261 }
1263 1262