aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/gc.c
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-03-04 15:36:19 -0500
committerJoern Engel <joern@logfs.org>2010-03-04 15:36:19 -0500
commitc6d3830140f1d56b07d8ab56a6e14ca3c492a39a (patch)
tree8dd9923b4217f6f7dc2735356d112fdcfa277852 /fs/logfs/gc.c
parent9421502b4fc894cc477be8fc49776830e37ca157 (diff)
[LogFS] Only write journal if dirty
This prevents unnecessary journal writes. More importantly it prevents an oops due to a journal write on failed mount.
Diffstat (limited to 'fs/logfs/gc.c')
-rw-r--r--fs/logfs/gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/logfs/gc.c b/fs/logfs/gc.c
index b3656c44190e..92949f95a901 100644
--- a/fs/logfs/gc.c
+++ b/fs/logfs/gc.c
@@ -469,7 +469,7 @@ static void __logfs_gc_pass(struct super_block *sb, int target)
469 469
470 /* Sync in-memory state with on-medium state in case they 470 /* Sync in-memory state with on-medium state in case they
471 * diverged */ 471 * diverged */
472 logfs_write_anchor(super->s_master_inode); 472 logfs_write_anchor(sb);
473 round += logfs_scan_some(sb); 473 round += logfs_scan_some(sb);
474 if (no_free_segments(sb) >= target) 474 if (no_free_segments(sb) >= target)
475 goto write_alias; 475 goto write_alias;
@@ -613,8 +613,8 @@ void logfs_gc_pass(struct super_block *sb)
613 */ 613 */
614 if (super->s_dirty_used_bytes + super->s_dirty_free_bytes 614 if (super->s_dirty_used_bytes + super->s_dirty_free_bytes
615 + LOGFS_MAX_OBJECTSIZE >= super->s_free_bytes) 615 + LOGFS_MAX_OBJECTSIZE >= super->s_free_bytes)
616 logfs_write_anchor(super->s_master_inode); 616 logfs_write_anchor(sb);
617 __logfs_gc_pass(sb, logfs_super(sb)->s_total_levels); 617 __logfs_gc_pass(sb, super->s_total_levels);
618 logfs_wl_pass(sb); 618 logfs_wl_pass(sb);
619 logfs_journal_wl_pass(sb); 619 logfs_journal_wl_pass(sb);
620} 620}