diff options
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r-- | fs/gfs2/log.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 0b26d6a74118..b0dd0b9ad79b 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -412,11 +412,13 @@ static void log_flush_commit(struct gfs2_sbd *sdp) | |||
412 | struct list_head *head = &sdp->sd_log_flush_list; | 412 | struct list_head *head = &sdp->sd_log_flush_list; |
413 | struct gfs2_log_buf *lb; | 413 | struct gfs2_log_buf *lb; |
414 | struct buffer_head *bh; | 414 | struct buffer_head *bh; |
415 | #if 0 | ||
415 | unsigned int d; | 416 | unsigned int d; |
416 | 417 | ||
417 | d = log_distance(sdp, sdp->sd_log_flush_head, sdp->sd_log_head); | 418 | d = log_distance(sdp, sdp->sd_log_flush_head, sdp->sd_log_head); |
418 | 419 | ||
419 | gfs2_assert_withdraw(sdp, d + 1 == sdp->sd_log_blks_reserved); | 420 | gfs2_assert_withdraw(sdp, d + 1 == sdp->sd_log_blks_reserved); |
421 | #endif | ||
420 | 422 | ||
421 | while (!list_empty(head)) { | 423 | while (!list_empty(head)) { |
422 | lb = list_entry(head->next, struct gfs2_log_buf, lb_list); | 424 | lb = list_entry(head->next, struct gfs2_log_buf, lb_list); |
@@ -483,6 +485,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) | |||
483 | sdp->sd_log_head = sdp->sd_log_flush_head; | 485 | sdp->sd_log_head = sdp->sd_log_flush_head; |
484 | 486 | ||
485 | /* printk(KERN_INFO "sd_log_num_hdrs %u\n", sdp->sd_log_num_hdrs); */ | 487 | /* printk(KERN_INFO "sd_log_num_hdrs %u\n", sdp->sd_log_num_hdrs); */ |
488 | sdp->sd_log_blks_free -= sdp->sd_log_num_hdrs; | ||
486 | 489 | ||
487 | sdp->sd_log_blks_reserved = | 490 | sdp->sd_log_blks_reserved = |
488 | sdp->sd_log_commited_buf = | 491 | sdp->sd_log_commited_buf = |
@@ -515,8 +518,7 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) | |||
515 | gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0); | 518 | gfs2_assert_withdraw(sdp, ((int)sdp->sd_log_commited_revoke) >= 0); |
516 | 519 | ||
517 | if (sdp->sd_log_commited_buf) | 520 | if (sdp->sd_log_commited_buf) |
518 | reserved += 1 + sdp->sd_log_commited_buf + | 521 | reserved += sdp->sd_log_commited_buf; |
519 | sdp->sd_log_commited_buf/503; | ||
520 | if (sdp->sd_log_commited_revoke) | 522 | if (sdp->sd_log_commited_revoke) |
521 | reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke, | 523 | reserved += gfs2_struct2blk(sdp, sdp->sd_log_commited_revoke, |
522 | sizeof(uint64_t)); | 524 | sizeof(uint64_t)); |
@@ -527,7 +529,8 @@ static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) | |||
527 | 529 | ||
528 | gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free >= old); | 530 | gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free >= old); |
529 | gfs2_assert_withdraw(sdp, | 531 | gfs2_assert_withdraw(sdp, |
530 | sdp->sd_log_blks_free <= sdp->sd_jdesc->jd_blocks); | 532 | sdp->sd_log_blks_free <= sdp->sd_jdesc->jd_blocks + |
533 | sdp->sd_log_num_hdrs); | ||
531 | 534 | ||
532 | sdp->sd_log_blks_reserved = reserved; | 535 | sdp->sd_log_blks_reserved = reserved; |
533 | 536 | ||
@@ -582,6 +585,7 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp) | |||
582 | 585 | ||
583 | log_write_header(sdp, GFS2_LOG_HEAD_UNMOUNT, 0); | 586 | log_write_header(sdp, GFS2_LOG_HEAD_UNMOUNT, 0); |
584 | 587 | ||
588 | /* printk(KERN_INFO "sd_log_blks_free %u, sd_jdesc->jd_blocks %u\n", sdp->sd_log_blks_free, sdp->sd_jdesc->jd_blocks); */ | ||
585 | gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free == | 589 | gfs2_assert_withdraw(sdp, sdp->sd_log_blks_free == |
586 | sdp->sd_jdesc->jd_blocks); | 590 | sdp->sd_jdesc->jd_blocks); |
587 | gfs2_assert_withdraw(sdp, sdp->sd_log_head == sdp->sd_log_tail); | 591 | gfs2_assert_withdraw(sdp, sdp->sd_log_head == sdp->sd_log_tail); |