Reorder writeback for glock sync
From 601765436dd953ef0749bf90d1f467aa35f9dd77 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Fri, 2 Nov 2007 08:39:34 +0000
Subject: [PATCH] [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.
fs/gfs2/glock.c +6 -7
@@ -947,8 +947,8 @@ static void gfs2_glock_drop_th(struct gfs2_glock *gl)const struct gfs2_glock_operations *glops = gl->gl_ops;unsigned int ret; -if (glops->go_drop_th) - glops->go_drop_th (gl); +if (glops->go_xmote_th) + glops->go_xmote_th (gl);gfs2_assert_warn (sdp,test_bit (GLF_LOCK , &gl->gl_flags));gfs2_assert_warn (sdp,list_empty (&gl->gl_holders));
@@ -1252,12 +1252,11 @@ void gfs2_glock_dq(struct gfs2_holder *gh)list_del_init (&gh->gh_list);if (list_empty (&gl->gl_holders)) { -spin_unlock (&gl->gl_spin); - -if (glops->go_unlock) +if (glops->go_unlock) { +spin_unlock (&gl->gl_spin); glops->go_unlock (gh); - -spin_lock (&gl->gl_spin); +spin_lock (&gl->gl_spin); + } gl->gl_stamp = jiffies; }
fs/gfs2/glops.c +16 -64
150 lines not on this page · raw message
Signature · 1 line
1.5.1.2