aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r--fs/gfs2/log.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 0cace3da9dbb..6456fc39aace 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -261,6 +261,12 @@ static void ail2_empty(struct gfs2_sbd *sdp, unsigned int new_tail)
261 * @sdp: The GFS2 superblock 261 * @sdp: The GFS2 superblock
262 * @blks: The number of blocks to reserve 262 * @blks: The number of blocks to reserve
263 * 263 *
264 * Note that we never give out the last 6 blocks of the journal. Thats
265 * due to the fact that there is are a small number of header blocks
266 * associated with each log flush. The exact number can't be known until
267 * flush time, so we ensure that we have just enough free blocks at all
268 * times to avoid running out during a log flush.
269 *
264 * Returns: errno 270 * Returns: errno
265 */ 271 */
266 272
@@ -274,7 +280,7 @@ int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks)
274 280
275 mutex_lock(&sdp->sd_log_reserve_mutex); 281 mutex_lock(&sdp->sd_log_reserve_mutex);
276 gfs2_log_lock(sdp); 282 gfs2_log_lock(sdp);
277 while(sdp->sd_log_blks_free <= blks) { 283 while(sdp->sd_log_blks_free <= (blks + 6)) {
278 gfs2_log_unlock(sdp); 284 gfs2_log_unlock(sdp);
279 gfs2_ail1_empty(sdp, 0); 285 gfs2_ail1_empty(sdp, 0);
280 gfs2_log_flush(sdp, NULL); 286 gfs2_log_flush(sdp, NULL);
@@ -643,12 +649,9 @@ void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr)
643 up_read(&sdp->sd_log_flush_lock); 649 up_read(&sdp->sd_log_flush_lock);
644 650
645 gfs2_log_lock(sdp); 651 gfs2_log_lock(sdp);
646 if (sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks)) { 652 if (sdp->sd_log_num_buf > gfs2_tune_get(sdp, gt_incore_log_blocks))
647 gfs2_log_unlock(sdp); 653 wake_up_process(sdp->sd_logd_process);
648 gfs2_log_flush(sdp, NULL); 654 gfs2_log_unlock(sdp);
649 } else {
650 gfs2_log_unlock(sdp);
651 }
652} 655}
653 656
654/** 657/**