aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-11-08 09:25:12 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:07:52 -0500
commit2bcd610d2fdea608a8fdac32788fc35a32a2327c (patch)
tree5b3753ff18c1da54bb860dbd67211e6abea78ca7 /fs/gfs2/log.c
parent8cbc4342478311c2a85260a7ca54d96cb7f71f7b (diff)
[GFS2] Don't add glocks to the journal
The only reason for adding glocks to the journal was to keep track of which locks required a log flush prior to release. We add a flag to the glock to allow this check to be made in a simpler way. This reduces the size of a glock (by 12 bytes on i386, 24 on x86_64) and means that we can avoid extra work during the journal flush. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 1e1fe8def375..d24684330bc3 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -692,20 +692,16 @@ static void gfs2_ordered_wait(struct gfs2_sbd *sdp)
692 * 692 *
693 */ 693 */
694 694
695void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) 695void __gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
696{ 696{
697 struct gfs2_ail *ai; 697 struct gfs2_ail *ai;
698 698
699 down_write(&sdp->sd_log_flush_lock); 699 down_write(&sdp->sd_log_flush_lock);
700 700
701 if (gl) { 701 /* Log might have been flushed while we waited for the flush lock */
702 gfs2_log_lock(sdp); 702 if (gl && !test_bit(GLF_LFLUSH, &gl->gl_flags)) {
703 if (list_empty(&gl->gl_le.le_list)) { 703 up_write(&sdp->sd_log_flush_lock);
704 gfs2_log_unlock(sdp); 704 return;
705 up_write(&sdp->sd_log_flush_lock);
706 return;
707 }
708 gfs2_log_unlock(sdp);
709 } 705 }
710 706
711 ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL); 707 ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL);
@@ -823,7 +819,6 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp)
823 down_write(&sdp->sd_log_flush_lock); 819 down_write(&sdp->sd_log_flush_lock);
824 820
825 gfs2_assert_withdraw(sdp, !sdp->sd_log_blks_reserved); 821 gfs2_assert_withdraw(sdp, !sdp->sd_log_blks_reserved);
826 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_gl);
827 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_buf); 822 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_buf);
828 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke); 823 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke);
829 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_rg); 824 gfs2_assert_withdraw(sdp, !sdp->sd_log_num_rg);