aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-05-01 00:33:44 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-05-01 00:33:44 -0400
commite2d670523c6c4ccb0fca9f3ab1b8f066d9aa57d6 (patch)
tree648f9a29142831ded24fd92d22d3add5c3190185 /fs/ext4
parentf7c439504ccba0cca43271e651013ab97a221c62 (diff)
ext4: Simplify ext4_commit_super()'s function signature
The ext4_commit_super() function took both a struct super_block * and a struct ext4_super_block *, but the struct ext4_super_block can be derived from the struct super_block. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3e509bc647e..ad4c9be4abd 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -54,8 +54,7 @@ static struct kset *ext4_kset;
54 54
55static int ext4_load_journal(struct super_block *, struct ext4_super_block *, 55static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
56 unsigned long journal_devnum); 56 unsigned long journal_devnum);
57static int ext4_commit_super(struct super_block *sb, 57static int ext4_commit_super(struct super_block *sb, int sync);
58 struct ext4_super_block *es, int sync);
59static void ext4_mark_recovery_complete(struct super_block *sb, 58static void ext4_mark_recovery_complete(struct super_block *sb,
60 struct ext4_super_block *es); 59 struct ext4_super_block *es);
61static void ext4_clear_journal_err(struct super_block *sb, 60static void ext4_clear_journal_err(struct super_block *sb,
@@ -306,7 +305,7 @@ static void ext4_handle_error(struct super_block *sb)
306 printk(KERN_CRIT "Remounting filesystem read-only\n"); 305 printk(KERN_CRIT "Remounting filesystem read-only\n");
307 sb->s_flags |= MS_RDONLY; 306 sb->s_flags |= MS_RDONLY;
308 } 307 }
309 ext4_commit_super(sb, es, 1); 308 ext4_commit_super(sb, 1);
310 if (test_opt(sb, ERRORS_PANIC)) 309 if (test_opt(sb, ERRORS_PANIC))
311 panic("EXT4-fs (device %s): panic forced after error\n", 310 panic("EXT4-fs (device %s): panic forced after error\n",
312 sb->s_id); 311 sb->s_id);
@@ -448,7 +447,7 @@ __acquires(bitlock)
448 if (test_opt(sb, ERRORS_CONT)) { 447 if (test_opt(sb, ERRORS_CONT)) {
449 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; 448 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
450 es->s_state |= cpu_to_le16(EXT4_ERROR_FS); 449 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
451 ext4_commit_super(sb, es, 0); 450 ext4_commit_super(sb, 0);
452 return; 451 return;
453 } 452 }
454 ext4_unlock_group(sb, grp); 453 ext4_unlock_group(sb, grp);
@@ -577,7 +576,7 @@ static void ext4_put_super(struct super_block *sb)
577 if (!(sb->s_flags & MS_RDONLY)) { 576 if (!(sb->s_flags & MS_RDONLY)) {
578 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 577 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
579 es->s_state = cpu_to_le16(sbi->s_mount_state); 578 es->s_state = cpu_to_le16(sbi->s_mount_state);
580 ext4_commit_super(sb, es, 1); 579 ext4_commit_super(sb, 1);
581 } 580 }
582 if (sbi->s_proc) { 581 if (sbi->s_proc) {
583 remove_proc_entry(sb->s_id, ext4_proc_root); 582 remove_proc_entry(sb->s_id, ext4_proc_root);
@@ -1596,7 +1595,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
1596 if (sbi->s_journal) 1595 if (sbi->s_journal)
1597 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 1596 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
1598 1597
1599 ext4_commit_super(sb, es, 1); 1598 ext4_commit_super(sb, 1);
1600 if (test_opt(sb, DEBUG)) 1599 if (test_opt(sb, DEBUG))
1601 printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, " 1600 printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, "
1602 "bpg=%lu, ipg=%lu, mo=%04lx]\n", 1601 "bpg=%lu, ipg=%lu, mo=%04lx]\n",
@@ -2655,7 +2654,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
2655 if (test_opt(sb, ERRORS_PANIC)) { 2654 if (test_opt(sb, ERRORS_PANIC)) {
2656 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; 2655 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
2657 es->s_state |= cpu_to_le16(EXT4_ERROR_FS); 2656 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
2658 ext4_commit_super(sb, es, 1); 2657 ext4_commit_super(sb, 1);
2659 goto failed_mount4; 2658 goto failed_mount4;
2660 } 2659 }
2661 } 2660 }
@@ -3132,15 +3131,15 @@ static int ext4_load_journal(struct super_block *sb,
3132 sb->s_dirt = 1; 3131 sb->s_dirt = 1;
3133 3132
3134 /* Make sure we flush the recovery flag to disk. */ 3133 /* Make sure we flush the recovery flag to disk. */
3135 ext4_commit_super(sb, es, 1); 3134 ext4_commit_super(sb, 1);
3136 } 3135 }
3137 3136
3138 return 0; 3137 return 0;
3139} 3138}
3140 3139
3141static int ext4_commit_super(struct super_block *sb, 3140static int ext4_commit_super(struct super_block *sb, int sync)
3142 struct ext4_super_block *es, int sync)
3143{ 3141{
3142 struct ext4_super_block *es = EXT4_SB(sb)->s_es;
3144 struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; 3143 struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
3145 int error = 0; 3144 int error = 0;
3146 3145
@@ -3212,7 +3211,7 @@ static void ext4_mark_recovery_complete(struct super_block *sb,
3212 sb->s_flags & MS_RDONLY) { 3211 sb->s_flags & MS_RDONLY) {
3213 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 3212 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
3214 sb->s_dirt = 0; 3213 sb->s_dirt = 0;
3215 ext4_commit_super(sb, es, 1); 3214 ext4_commit_super(sb, 1);
3216 } 3215 }
3217 unlock_super(sb); 3216 unlock_super(sb);
3218 3217
@@ -3253,7 +3252,7 @@ static void ext4_clear_journal_err(struct super_block *sb,
3253 3252
3254 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; 3253 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
3255 es->s_state |= cpu_to_le16(EXT4_ERROR_FS); 3254 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
3256 ext4_commit_super(sb, es, 1); 3255 ext4_commit_super(sb, 1);
3257 3256
3258 jbd2_journal_clear_err(journal); 3257 jbd2_journal_clear_err(journal);
3259 } 3258 }
@@ -3293,7 +3292,7 @@ static void ext4_write_super(struct super_block *sb)
3293 BUG(); 3292 BUG();
3294 sb->s_dirt = 0; 3293 sb->s_dirt = 0;
3295 } else { 3294 } else {
3296 ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 3295 ext4_commit_super(sb, 1);
3297 } 3296 }
3298} 3297}
3299 3298
@@ -3312,7 +3311,7 @@ static int ext4_sync_fs(struct super_block *sb, int wait)
3312 target); 3311 target);
3313 } 3312 }
3314 } else { 3313 } else {
3315 ext4_commit_super(sb, EXT4_SB(sb)->s_es, wait); 3314 ext4_commit_super(sb, wait);
3316 } 3315 }
3317 return ret; 3316 return ret;
3318} 3317}
@@ -3345,7 +3344,7 @@ static int ext4_freeze(struct super_block *sb)
3345 3344
3346 /* Journal blocked and flushed, clear needs_recovery flag. */ 3345 /* Journal blocked and flushed, clear needs_recovery flag. */
3347 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 3346 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
3348 error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 3347 error = ext4_commit_super(sb, 1);
3349 if (error) 3348 if (error)
3350 goto out; 3349 goto out;
3351 } 3350 }
@@ -3365,7 +3364,7 @@ static int ext4_unfreeze(struct super_block *sb)
3365 lock_super(sb); 3364 lock_super(sb);
3366 /* Reser the needs_recovery flag before the fs is unlocked. */ 3365 /* Reser the needs_recovery flag before the fs is unlocked. */
3367 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 3366 EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
3368 ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 3367 ext4_commit_super(sb, 1);
3369 unlock_super(sb); 3368 unlock_super(sb);
3370 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 3369 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
3371 } 3370 }
@@ -3520,7 +3519,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
3520 } 3519 }
3521 } 3520 }
3522 if (sbi->s_journal == NULL) 3521 if (sbi->s_journal == NULL)
3523 ext4_commit_super(sb, es, 1); 3522 ext4_commit_super(sb, 1);
3524 3523
3525#ifdef CONFIG_QUOTA 3524#ifdef CONFIG_QUOTA
3526 /* Release old quota file names */ 3525 /* Release old quota file names */