X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=fs%2Fgfs2%2Fdaemon.c;h=683cb5bda870fc372e79500c105ddf16c9ab93b9;hb=fdc30b3d448bf86dd45f9df3e8ac0d36a3bdd9b2;hp=cab1f68d468518ad9ed37f56b378c170bbab3710;hpb=363e065c02b1273364d5356711a83e7f548fc0c8;p=linux-2.6-omap-h63xx.git diff --git a/fs/gfs2/daemon.c b/fs/gfs2/daemon.c index cab1f68d468..683cb5bda87 100644 --- a/fs/gfs2/daemon.c +++ b/fs/gfs2/daemon.c @@ -112,6 +112,7 @@ int gfs2_logd(void *data) struct gfs2_sbd *sdp = data; struct gfs2_holder ji_gh; unsigned long t; + int need_flush; while (!kthread_should_stop()) { /* Advance the log tail */ @@ -120,8 +121,10 @@ int gfs2_logd(void *data) gfs2_tune_get(sdp, gt_log_flush_secs) * HZ; gfs2_ail1_empty(sdp, DIO_ALL); - - if (time_after_eq(jiffies, t)) { + gfs2_log_lock(sdp); + need_flush = sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks); + gfs2_log_unlock(sdp); + if (need_flush || time_after_eq(jiffies, t)) { gfs2_log_flush(sdp, NULL); sdp->sd_log_flush_time = jiffies; }