diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-11-08 14:25:12 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 08:07:52 +0000 |
commit | 2bcd610d2fdea608a8fdac32788fc35a32a2327c (patch) | |
tree | 5b3753ff18c1da54bb860dbd67211e6abea78ca7 /fs/gfs2/log.c | |
parent | 8cbc4342478311c2a85260a7ca54d96cb7f71f7b (diff) | |
download | linux-2bcd610d2fdea608a8fdac32788fc35a32a2327c.tar.bz2 |
[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.c | 15 |
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) * */ -void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) +void __gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) { struct gfs2_ail *ai; down_write(&sdp->sd_log_flush_lock); - if (gl) { - gfs2_log_lock(sdp); - if (list_empty(&gl->gl_le.le_list)) { - gfs2_log_unlock(sdp); - up_write(&sdp->sd_log_flush_lock); - return; - } - gfs2_log_unlock(sdp); + /* Log might have been flushed while we waited for the flush lock */ + if (gl && !test_bit(GLF_LFLUSH, &gl->gl_flags)) { + up_write(&sdp->sd_log_flush_lock); + return; } ai = kzalloc(sizeof(struct gfs2_ail), GFP_NOFS | __GFP_NOFAIL); @@ -823,7 +819,6 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp) down_write(&sdp->sd_log_flush_lock); gfs2_assert_withdraw(sdp, !sdp->sd_log_blks_reserved); - gfs2_assert_withdraw(sdp, !sdp->sd_log_num_gl); gfs2_assert_withdraw(sdp, !sdp->sd_log_num_buf); gfs2_assert_withdraw(sdp, !sdp->sd_log_num_revoke); gfs2_assert_withdraw(sdp, !sdp->sd_log_num_rg); |