diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-07-26 16:15:44 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-26 16:15:44 -0400 |
commit | 2b2d6d019724de6e51ac5bcf22b5ef969daefa8b (patch) | |
tree | 71145b61b73b200fd3d4bae520bb988f5f7d21f5 /fs/ext4/super.c | |
parent | ec05e868ac80cc8fc7de6e5cf773b232198e49af (diff) |
ext4: Cleanup whitespace and other miscellaneous style issues
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 283 |
1 files changed, 139 insertions, 144 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e34fc2d6dbf5..09e3c56782a7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -49,20 +49,19 @@ static int ext4_load_journal(struct super_block *, struct ext4_super_block *, | |||
49 | unsigned long journal_devnum); | 49 | unsigned long journal_devnum); |
50 | static int ext4_create_journal(struct super_block *, struct ext4_super_block *, | 50 | static int ext4_create_journal(struct super_block *, struct ext4_super_block *, |
51 | unsigned int); | 51 | unsigned int); |
52 | static void ext4_commit_super (struct super_block * sb, | 52 | static void ext4_commit_super(struct super_block *sb, |
53 | struct ext4_super_block * es, | 53 | struct ext4_super_block *es, int sync); |
54 | int sync); | 54 | static void ext4_mark_recovery_complete(struct super_block *sb, |
55 | static void ext4_mark_recovery_complete(struct super_block * sb, | 55 | struct ext4_super_block *es); |
56 | struct ext4_super_block * es); | 56 | static void ext4_clear_journal_err(struct super_block *sb, |
57 | static void ext4_clear_journal_err(struct super_block * sb, | 57 | struct ext4_super_block *es); |
58 | struct ext4_super_block * es); | ||
59 | static int ext4_sync_fs(struct super_block *sb, int wait); | 58 | static int ext4_sync_fs(struct super_block *sb, int wait); |
60 | static const char *ext4_decode_error(struct super_block * sb, int errno, | 59 | static const char *ext4_decode_error(struct super_block *sb, int errno, |
61 | char nbuf[16]); | 60 | char nbuf[16]); |
62 | static int ext4_remount (struct super_block * sb, int * flags, char * data); | 61 | static int ext4_remount(struct super_block *sb, int *flags, char *data); |
63 | static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf); | 62 | static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf); |
64 | static void ext4_unlockfs(struct super_block *sb); | 63 | static void ext4_unlockfs(struct super_block *sb); |
65 | static void ext4_write_super (struct super_block * sb); | 64 | static void ext4_write_super(struct super_block *sb); |
66 | static void ext4_write_super_lockfs(struct super_block *sb); | 65 | static void ext4_write_super_lockfs(struct super_block *sb); |
67 | 66 | ||
68 | 67 | ||
@@ -211,15 +210,15 @@ static void ext4_handle_error(struct super_block *sb) | |||
211 | if (sb->s_flags & MS_RDONLY) | 210 | if (sb->s_flags & MS_RDONLY) |
212 | return; | 211 | return; |
213 | 212 | ||
214 | if (!test_opt (sb, ERRORS_CONT)) { | 213 | if (!test_opt(sb, ERRORS_CONT)) { |
215 | journal_t *journal = EXT4_SB(sb)->s_journal; | 214 | journal_t *journal = EXT4_SB(sb)->s_journal; |
216 | 215 | ||
217 | EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT; | 216 | EXT4_SB(sb)->s_mount_opt |= EXT4_MOUNT_ABORT; |
218 | if (journal) | 217 | if (journal) |
219 | jbd2_journal_abort(journal, -EIO); | 218 | jbd2_journal_abort(journal, -EIO); |
220 | } | 219 | } |
221 | if (test_opt (sb, ERRORS_RO)) { | 220 | if (test_opt(sb, ERRORS_RO)) { |
222 | printk (KERN_CRIT "Remounting filesystem read-only\n"); | 221 | printk(KERN_CRIT "Remounting filesystem read-only\n"); |
223 | sb->s_flags |= MS_RDONLY; | 222 | sb->s_flags |= MS_RDONLY; |
224 | } | 223 | } |
225 | ext4_commit_super(sb, es, 1); | 224 | ext4_commit_super(sb, es, 1); |
@@ -228,13 +227,13 @@ static void ext4_handle_error(struct super_block *sb) | |||
228 | sb->s_id); | 227 | sb->s_id); |
229 | } | 228 | } |
230 | 229 | ||
231 | void ext4_error (struct super_block * sb, const char * function, | 230 | void ext4_error(struct super_block *sb, const char *function, |
232 | const char * fmt, ...) | 231 | const char *fmt, ...) |
233 | { | 232 | { |
234 | va_list args; | 233 | va_list args; |
235 | 234 | ||
236 | va_start(args, fmt); | 235 | va_start(args, fmt); |
237 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ",sb->s_id, function); | 236 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function); |
238 | vprintk(fmt, args); | 237 | vprintk(fmt, args); |
239 | printk("\n"); | 238 | printk("\n"); |
240 | va_end(args); | 239 | va_end(args); |
@@ -242,7 +241,7 @@ void ext4_error (struct super_block * sb, const char * function, | |||
242 | ext4_handle_error(sb); | 241 | ext4_handle_error(sb); |
243 | } | 242 | } |
244 | 243 | ||
245 | static const char *ext4_decode_error(struct super_block * sb, int errno, | 244 | static const char *ext4_decode_error(struct super_block *sb, int errno, |
246 | char nbuf[16]) | 245 | char nbuf[16]) |
247 | { | 246 | { |
248 | char *errstr = NULL; | 247 | char *errstr = NULL; |
@@ -278,8 +277,7 @@ static const char *ext4_decode_error(struct super_block * sb, int errno, | |||
278 | /* __ext4_std_error decodes expected errors from journaling functions | 277 | /* __ext4_std_error decodes expected errors from journaling functions |
279 | * automatically and invokes the appropriate error response. */ | 278 | * automatically and invokes the appropriate error response. */ |
280 | 279 | ||
281 | void __ext4_std_error (struct super_block * sb, const char * function, | 280 | void __ext4_std_error(struct super_block *sb, const char *function, int errno) |
282 | int errno) | ||
283 | { | 281 | { |
284 | char nbuf[16]; | 282 | char nbuf[16]; |
285 | const char *errstr; | 283 | const char *errstr; |
@@ -292,8 +290,8 @@ void __ext4_std_error (struct super_block * sb, const char * function, | |||
292 | return; | 290 | return; |
293 | 291 | ||
294 | errstr = ext4_decode_error(sb, errno, nbuf); | 292 | errstr = ext4_decode_error(sb, errno, nbuf); |
295 | printk (KERN_CRIT "EXT4-fs error (device %s) in %s: %s\n", | 293 | printk(KERN_CRIT "EXT4-fs error (device %s) in %s: %s\n", |
296 | sb->s_id, function, errstr); | 294 | sb->s_id, function, errstr); |
297 | 295 | ||
298 | ext4_handle_error(sb); | 296 | ext4_handle_error(sb); |
299 | } | 297 | } |
@@ -308,15 +306,15 @@ void __ext4_std_error (struct super_block * sb, const char * function, | |||
308 | * case we take the easy way out and panic immediately. | 306 | * case we take the easy way out and panic immediately. |
309 | */ | 307 | */ |
310 | 308 | ||
311 | void ext4_abort (struct super_block * sb, const char * function, | 309 | void ext4_abort(struct super_block *sb, const char *function, |
312 | const char * fmt, ...) | 310 | const char *fmt, ...) |
313 | { | 311 | { |
314 | va_list args; | 312 | va_list args; |
315 | 313 | ||
316 | printk (KERN_CRIT "ext4_abort called.\n"); | 314 | printk(KERN_CRIT "ext4_abort called.\n"); |
317 | 315 | ||
318 | va_start(args, fmt); | 316 | va_start(args, fmt); |
319 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ",sb->s_id, function); | 317 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function); |
320 | vprintk(fmt, args); | 318 | vprintk(fmt, args); |
321 | printk("\n"); | 319 | printk("\n"); |
322 | va_end(args); | 320 | va_end(args); |
@@ -334,8 +332,8 @@ void ext4_abort (struct super_block * sb, const char * function, | |||
334 | jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); | 332 | jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO); |
335 | } | 333 | } |
336 | 334 | ||
337 | void ext4_warning (struct super_block * sb, const char * function, | 335 | void ext4_warning(struct super_block *sb, const char *function, |
338 | const char * fmt, ...) | 336 | const char *fmt, ...) |
339 | { | 337 | { |
340 | va_list args; | 338 | va_list args; |
341 | 339 | ||
@@ -496,7 +494,7 @@ static void dump_orphan_list(struct super_block *sb, struct ext4_sb_info *sbi) | |||
496 | } | 494 | } |
497 | } | 495 | } |
498 | 496 | ||
499 | static void ext4_put_super (struct super_block * sb) | 497 | static void ext4_put_super(struct super_block *sb) |
500 | { | 498 | { |
501 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 499 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
502 | struct ext4_super_block *es = sbi->s_es; | 500 | struct ext4_super_block *es = sbi->s_es; |
@@ -647,7 +645,8 @@ static void ext4_clear_inode(struct inode *inode) | |||
647 | &EXT4_I(inode)->jinode); | 645 | &EXT4_I(inode)->jinode); |
648 | } | 646 | } |
649 | 647 | ||
650 | static inline void ext4_show_quota_options(struct seq_file *seq, struct super_block *sb) | 648 | static inline void ext4_show_quota_options(struct seq_file *seq, |
649 | struct super_block *sb) | ||
651 | { | 650 | { |
652 | #if defined(CONFIG_QUOTA) | 651 | #if defined(CONFIG_QUOTA) |
653 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 652 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
@@ -822,8 +821,8 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid, | |||
822 | } | 821 | } |
823 | 822 | ||
824 | #ifdef CONFIG_QUOTA | 823 | #ifdef CONFIG_QUOTA |
825 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") | 824 | #define QTYPE2NAME(t) ((t) == USRQUOTA?"user":"group") |
826 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) | 825 | #define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) |
827 | 826 | ||
828 | static int ext4_dquot_initialize(struct inode *inode, int type); | 827 | static int ext4_dquot_initialize(struct inode *inode, int type); |
829 | static int ext4_dquot_drop(struct inode *inode); | 828 | static int ext4_dquot_drop(struct inode *inode); |
@@ -991,12 +990,12 @@ static ext4_fsblk_t get_sb_block(void **data) | |||
991 | return sb_block; | 990 | return sb_block; |
992 | } | 991 | } |
993 | 992 | ||
994 | static int parse_options (char *options, struct super_block *sb, | 993 | static int parse_options(char *options, struct super_block *sb, |
995 | unsigned int *inum, unsigned long *journal_devnum, | 994 | unsigned int *inum, unsigned long *journal_devnum, |
996 | ext4_fsblk_t *n_blocks_count, int is_remount) | 995 | ext4_fsblk_t *n_blocks_count, int is_remount) |
997 | { | 996 | { |
998 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 997 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
999 | char * p; | 998 | char *p; |
1000 | substring_t args[MAX_OPT_ARGS]; | 999 | substring_t args[MAX_OPT_ARGS]; |
1001 | int data_opt = 0; | 1000 | int data_opt = 0; |
1002 | int option; | 1001 | int option; |
@@ -1009,7 +1008,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
1009 | if (!options) | 1008 | if (!options) |
1010 | return 1; | 1009 | return 1; |
1011 | 1010 | ||
1012 | while ((p = strsep (&options, ",")) != NULL) { | 1011 | while ((p = strsep(&options, ",")) != NULL) { |
1013 | int token; | 1012 | int token; |
1014 | if (!*p) | 1013 | if (!*p) |
1015 | continue; | 1014 | continue; |
@@ -1017,16 +1016,16 @@ static int parse_options (char *options, struct super_block *sb, | |||
1017 | token = match_token(p, tokens, args); | 1016 | token = match_token(p, tokens, args); |
1018 | switch (token) { | 1017 | switch (token) { |
1019 | case Opt_bsd_df: | 1018 | case Opt_bsd_df: |
1020 | clear_opt (sbi->s_mount_opt, MINIX_DF); | 1019 | clear_opt(sbi->s_mount_opt, MINIX_DF); |
1021 | break; | 1020 | break; |
1022 | case Opt_minix_df: | 1021 | case Opt_minix_df: |
1023 | set_opt (sbi->s_mount_opt, MINIX_DF); | 1022 | set_opt(sbi->s_mount_opt, MINIX_DF); |
1024 | break; | 1023 | break; |
1025 | case Opt_grpid: | 1024 | case Opt_grpid: |
1026 | set_opt (sbi->s_mount_opt, GRPID); | 1025 | set_opt(sbi->s_mount_opt, GRPID); |
1027 | break; | 1026 | break; |
1028 | case Opt_nogrpid: | 1027 | case Opt_nogrpid: |
1029 | clear_opt (sbi->s_mount_opt, GRPID); | 1028 | clear_opt(sbi->s_mount_opt, GRPID); |
1030 | break; | 1029 | break; |
1031 | case Opt_resuid: | 1030 | case Opt_resuid: |
1032 | if (match_int(&args[0], &option)) | 1031 | if (match_int(&args[0], &option)) |
@@ -1043,41 +1042,41 @@ static int parse_options (char *options, struct super_block *sb, | |||
1043 | /* *sb_block = match_int(&args[0]); */ | 1042 | /* *sb_block = match_int(&args[0]); */ |
1044 | break; | 1043 | break; |
1045 | case Opt_err_panic: | 1044 | case Opt_err_panic: |
1046 | clear_opt (sbi->s_mount_opt, ERRORS_CONT); | 1045 | clear_opt(sbi->s_mount_opt, ERRORS_CONT); |
1047 | clear_opt (sbi->s_mount_opt, ERRORS_RO); | 1046 | clear_opt(sbi->s_mount_opt, ERRORS_RO); |
1048 | set_opt (sbi->s_mount_opt, ERRORS_PANIC); | 1047 | set_opt(sbi->s_mount_opt, ERRORS_PANIC); |
1049 | break; | 1048 | break; |
1050 | case Opt_err_ro: | 1049 | case Opt_err_ro: |
1051 | clear_opt (sbi->s_mount_opt, ERRORS_CONT); | 1050 | clear_opt(sbi->s_mount_opt, ERRORS_CONT); |
1052 | clear_opt (sbi->s_mount_opt, ERRORS_PANIC); | 1051 | clear_opt(sbi->s_mount_opt, ERRORS_PANIC); |
1053 | set_opt (sbi->s_mount_opt, ERRORS_RO); | 1052 | set_opt(sbi->s_mount_opt, ERRORS_RO); |
1054 | break; | 1053 | break; |
1055 | case Opt_err_cont: | 1054 | case Opt_err_cont: |
1056 | clear_opt (sbi->s_mount_opt, ERRORS_RO); | 1055 | clear_opt(sbi->s_mount_opt, ERRORS_RO); |
1057 | clear_opt (sbi->s_mount_opt, ERRORS_PANIC); | 1056 | clear_opt(sbi->s_mount_opt, ERRORS_PANIC); |
1058 | set_opt (sbi->s_mount_opt, ERRORS_CONT); | 1057 | set_opt(sbi->s_mount_opt, ERRORS_CONT); |
1059 | break; | 1058 | break; |
1060 | case Opt_nouid32: | 1059 | case Opt_nouid32: |
1061 | set_opt (sbi->s_mount_opt, NO_UID32); | 1060 | set_opt(sbi->s_mount_opt, NO_UID32); |
1062 | break; | 1061 | break; |
1063 | case Opt_nocheck: | 1062 | case Opt_nocheck: |
1064 | clear_opt (sbi->s_mount_opt, CHECK); | 1063 | clear_opt(sbi->s_mount_opt, CHECK); |
1065 | break; | 1064 | break; |
1066 | case Opt_debug: | 1065 | case Opt_debug: |
1067 | set_opt (sbi->s_mount_opt, DEBUG); | 1066 | set_opt(sbi->s_mount_opt, DEBUG); |
1068 | break; | 1067 | break; |
1069 | case Opt_oldalloc: | 1068 | case Opt_oldalloc: |
1070 | set_opt (sbi->s_mount_opt, OLDALLOC); | 1069 | set_opt(sbi->s_mount_opt, OLDALLOC); |
1071 | break; | 1070 | break; |
1072 | case Opt_orlov: | 1071 | case Opt_orlov: |
1073 | clear_opt (sbi->s_mount_opt, OLDALLOC); | 1072 | clear_opt(sbi->s_mount_opt, OLDALLOC); |
1074 | break; | 1073 | break; |
1075 | #ifdef CONFIG_EXT4DEV_FS_XATTR | 1074 | #ifdef CONFIG_EXT4DEV_FS_XATTR |
1076 | case Opt_user_xattr: | 1075 | case Opt_user_xattr: |
1077 | set_opt (sbi->s_mount_opt, XATTR_USER); | 1076 | set_opt(sbi->s_mount_opt, XATTR_USER); |
1078 | break; | 1077 | break; |
1079 | case Opt_nouser_xattr: | 1078 | case Opt_nouser_xattr: |
1080 | clear_opt (sbi->s_mount_opt, XATTR_USER); | 1079 | clear_opt(sbi->s_mount_opt, XATTR_USER); |
1081 | break; | 1080 | break; |
1082 | #else | 1081 | #else |
1083 | case Opt_user_xattr: | 1082 | case Opt_user_xattr: |
@@ -1115,7 +1114,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
1115 | "journal on remount\n"); | 1114 | "journal on remount\n"); |
1116 | return 0; | 1115 | return 0; |
1117 | } | 1116 | } |
1118 | set_opt (sbi->s_mount_opt, UPDATE_JOURNAL); | 1117 | set_opt(sbi->s_mount_opt, UPDATE_JOURNAL); |
1119 | break; | 1118 | break; |
1120 | case Opt_journal_inum: | 1119 | case Opt_journal_inum: |
1121 | if (is_remount) { | 1120 | if (is_remount) { |
@@ -1145,7 +1144,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
1145 | set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); | 1144 | set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); |
1146 | break; | 1145 | break; |
1147 | case Opt_noload: | 1146 | case Opt_noload: |
1148 | set_opt (sbi->s_mount_opt, NOLOAD); | 1147 | set_opt(sbi->s_mount_opt, NOLOAD); |
1149 | break; | 1148 | break; |
1150 | case Opt_commit: | 1149 | case Opt_commit: |
1151 | if (match_int(&args[0], &option)) | 1150 | if (match_int(&args[0], &option)) |
@@ -1331,7 +1330,7 @@ set_qf_format: | |||
1331 | "on this filesystem, use tune2fs\n"); | 1330 | "on this filesystem, use tune2fs\n"); |
1332 | return 0; | 1331 | return 0; |
1333 | } | 1332 | } |
1334 | set_opt (sbi->s_mount_opt, EXTENTS); | 1333 | set_opt(sbi->s_mount_opt, EXTENTS); |
1335 | break; | 1334 | break; |
1336 | case Opt_noextents: | 1335 | case Opt_noextents: |
1337 | /* | 1336 | /* |
@@ -1348,7 +1347,7 @@ set_qf_format: | |||
1348 | "-o noextents options\n"); | 1347 | "-o noextents options\n"); |
1349 | return 0; | 1348 | return 0; |
1350 | } | 1349 | } |
1351 | clear_opt (sbi->s_mount_opt, EXTENTS); | 1350 | clear_opt(sbi->s_mount_opt, EXTENTS); |
1352 | break; | 1351 | break; |
1353 | case Opt_i_version: | 1352 | case Opt_i_version: |
1354 | set_opt(sbi->s_mount_opt, I_VERSION); | 1353 | set_opt(sbi->s_mount_opt, I_VERSION); |
@@ -1374,9 +1373,9 @@ set_qf_format: | |||
1374 | set_opt(sbi->s_mount_opt, DELALLOC); | 1373 | set_opt(sbi->s_mount_opt, DELALLOC); |
1375 | break; | 1374 | break; |
1376 | default: | 1375 | default: |
1377 | printk (KERN_ERR | 1376 | printk(KERN_ERR |
1378 | "EXT4-fs: Unrecognized mount option \"%s\" " | 1377 | "EXT4-fs: Unrecognized mount option \"%s\" " |
1379 | "or missing value\n", p); | 1378 | "or missing value\n", p); |
1380 | return 0; | 1379 | return 0; |
1381 | } | 1380 | } |
1382 | } | 1381 | } |
@@ -1423,31 +1422,31 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, | |||
1423 | int res = 0; | 1422 | int res = 0; |
1424 | 1423 | ||
1425 | if (le32_to_cpu(es->s_rev_level) > EXT4_MAX_SUPP_REV) { | 1424 | if (le32_to_cpu(es->s_rev_level) > EXT4_MAX_SUPP_REV) { |
1426 | printk (KERN_ERR "EXT4-fs warning: revision level too high, " | 1425 | printk(KERN_ERR "EXT4-fs warning: revision level too high, " |
1427 | "forcing read-only mode\n"); | 1426 | "forcing read-only mode\n"); |
1428 | res = MS_RDONLY; | 1427 | res = MS_RDONLY; |
1429 | } | 1428 | } |
1430 | if (read_only) | 1429 | if (read_only) |
1431 | return res; | 1430 | return res; |
1432 | if (!(sbi->s_mount_state & EXT4_VALID_FS)) | 1431 | if (!(sbi->s_mount_state & EXT4_VALID_FS)) |
1433 | printk (KERN_WARNING "EXT4-fs warning: mounting unchecked fs, " | 1432 | printk(KERN_WARNING "EXT4-fs warning: mounting unchecked fs, " |
1434 | "running e2fsck is recommended\n"); | 1433 | "running e2fsck is recommended\n"); |
1435 | else if ((sbi->s_mount_state & EXT4_ERROR_FS)) | 1434 | else if ((sbi->s_mount_state & EXT4_ERROR_FS)) |
1436 | printk (KERN_WARNING | 1435 | printk(KERN_WARNING |
1437 | "EXT4-fs warning: mounting fs with errors, " | 1436 | "EXT4-fs warning: mounting fs with errors, " |
1438 | "running e2fsck is recommended\n"); | 1437 | "running e2fsck is recommended\n"); |
1439 | else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 && | 1438 | else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 && |
1440 | le16_to_cpu(es->s_mnt_count) >= | 1439 | le16_to_cpu(es->s_mnt_count) >= |
1441 | (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count)) | 1440 | (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count)) |
1442 | printk (KERN_WARNING | 1441 | printk(KERN_WARNING |
1443 | "EXT4-fs warning: maximal mount count reached, " | 1442 | "EXT4-fs warning: maximal mount count reached, " |
1444 | "running e2fsck is recommended\n"); | 1443 | "running e2fsck is recommended\n"); |
1445 | else if (le32_to_cpu(es->s_checkinterval) && | 1444 | else if (le32_to_cpu(es->s_checkinterval) && |
1446 | (le32_to_cpu(es->s_lastcheck) + | 1445 | (le32_to_cpu(es->s_lastcheck) + |
1447 | le32_to_cpu(es->s_checkinterval) <= get_seconds())) | 1446 | le32_to_cpu(es->s_checkinterval) <= get_seconds())) |
1448 | printk (KERN_WARNING | 1447 | printk(KERN_WARNING |
1449 | "EXT4-fs warning: checktime reached, " | 1448 | "EXT4-fs warning: checktime reached, " |
1450 | "running e2fsck is recommended\n"); | 1449 | "running e2fsck is recommended\n"); |
1451 | #if 0 | 1450 | #if 0 |
1452 | /* @@@ We _will_ want to clear the valid bit if we find | 1451 | /* @@@ We _will_ want to clear the valid bit if we find |
1453 | * inconsistencies, to force a fsck at reboot. But for | 1452 | * inconsistencies, to force a fsck at reboot. But for |
@@ -1596,16 +1595,14 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1596 | (EXT4_BLOCKS_PER_GROUP(sb) - 1); | 1595 | (EXT4_BLOCKS_PER_GROUP(sb) - 1); |
1597 | 1596 | ||
1598 | block_bitmap = ext4_block_bitmap(sb, gdp); | 1597 | block_bitmap = ext4_block_bitmap(sb, gdp); |
1599 | if (block_bitmap < first_block || block_bitmap > last_block) | 1598 | if (block_bitmap < first_block || block_bitmap > last_block) { |
1600 | { | ||
1601 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1599 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1602 | "Block bitmap for group %lu not in group " | 1600 | "Block bitmap for group %lu not in group " |
1603 | "(block %llu)!", i, block_bitmap); | 1601 | "(block %llu)!", i, block_bitmap); |
1604 | return 0; | 1602 | return 0; |
1605 | } | 1603 | } |
1606 | inode_bitmap = ext4_inode_bitmap(sb, gdp); | 1604 | inode_bitmap = ext4_inode_bitmap(sb, gdp); |
1607 | if (inode_bitmap < first_block || inode_bitmap > last_block) | 1605 | if (inode_bitmap < first_block || inode_bitmap > last_block) { |
1608 | { | ||
1609 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1606 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1610 | "Inode bitmap for group %lu not in group " | 1607 | "Inode bitmap for group %lu not in group " |
1611 | "(block %llu)!", i, inode_bitmap); | 1608 | "(block %llu)!", i, inode_bitmap); |
@@ -1613,8 +1610,7 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1613 | } | 1610 | } |
1614 | inode_table = ext4_inode_table(sb, gdp); | 1611 | inode_table = ext4_inode_table(sb, gdp); |
1615 | if (inode_table < first_block || | 1612 | if (inode_table < first_block || |
1616 | inode_table + sbi->s_itb_per_group - 1 > last_block) | 1613 | inode_table + sbi->s_itb_per_group - 1 > last_block) { |
1617 | { | ||
1618 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " | 1614 | printk(KERN_ERR "EXT4-fs: ext4_check_descriptors: " |
1619 | "Inode table for group %lu not in group " | 1615 | "Inode table for group %lu not in group " |
1620 | "(block %llu)!", i, inode_table); | 1616 | "(block %llu)!", i, inode_table); |
@@ -1635,7 +1631,7 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1635 | } | 1631 | } |
1636 | 1632 | ||
1637 | ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); | 1633 | ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); |
1638 | sbi->s_es->s_free_inodes_count=cpu_to_le32(ext4_count_free_inodes(sb)); | 1634 | sbi->s_es->s_free_inodes_count = cpu_to_le32(ext4_count_free_inodes(sb)); |
1639 | return 1; | 1635 | return 1; |
1640 | } | 1636 | } |
1641 | 1637 | ||
@@ -1656,8 +1652,8 @@ static int ext4_check_descriptors(struct super_block *sb) | |||
1656 | * e2fsck was run on this filesystem, and it must have already done the orphan | 1652 | * e2fsck was run on this filesystem, and it must have already done the orphan |
1657 | * inode cleanup for us, so we can safely abort without any further action. | 1653 | * inode cleanup for us, so we can safely abort without any further action. |
1658 | */ | 1654 | */ |
1659 | static void ext4_orphan_cleanup (struct super_block * sb, | 1655 | static void ext4_orphan_cleanup(struct super_block *sb, |
1660 | struct ext4_super_block * es) | 1656 | struct ext4_super_block *es) |
1661 | { | 1657 | { |
1662 | unsigned int s_flags = sb->s_flags; | 1658 | unsigned int s_flags = sb->s_flags; |
1663 | int nr_orphans = 0, nr_truncates = 0; | 1659 | int nr_orphans = 0, nr_truncates = 0; |
@@ -1734,7 +1730,7 @@ static void ext4_orphan_cleanup (struct super_block * sb, | |||
1734 | iput(inode); /* The delete magic happens here! */ | 1730 | iput(inode); /* The delete magic happens here! */ |
1735 | } | 1731 | } |
1736 | 1732 | ||
1737 | #define PLURAL(x) (x), ((x)==1) ? "" : "s" | 1733 | #define PLURAL(x) (x), ((x) == 1) ? "" : "s" |
1738 | 1734 | ||
1739 | if (nr_orphans) | 1735 | if (nr_orphans) |
1740 | printk(KERN_INFO "EXT4-fs: %s: %d orphan inode%s deleted\n", | 1736 | printk(KERN_INFO "EXT4-fs: %s: %d orphan inode%s deleted\n", |
@@ -1901,12 +1897,12 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi) | |||
1901 | return 0; | 1897 | return 0; |
1902 | } | 1898 | } |
1903 | 1899 | ||
1904 | static int ext4_fill_super (struct super_block *sb, void *data, int silent) | 1900 | static int ext4_fill_super(struct super_block *sb, void *data, int silent) |
1905 | __releases(kernel_lock) | 1901 | __releases(kernel_lock) |
1906 | __acquires(kernel_lock) | 1902 | __acquires(kernel_lock) |
1907 | 1903 | ||
1908 | { | 1904 | { |
1909 | struct buffer_head * bh; | 1905 | struct buffer_head *bh; |
1910 | struct ext4_super_block *es = NULL; | 1906 | struct ext4_super_block *es = NULL; |
1911 | struct ext4_sb_info *sbi; | 1907 | struct ext4_sb_info *sbi; |
1912 | ext4_fsblk_t block; | 1908 | ext4_fsblk_t block; |
@@ -1955,7 +1951,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1955 | } | 1951 | } |
1956 | 1952 | ||
1957 | if (!(bh = sb_bread(sb, logical_sb_block))) { | 1953 | if (!(bh = sb_bread(sb, logical_sb_block))) { |
1958 | printk (KERN_ERR "EXT4-fs: unable to read superblock\n"); | 1954 | printk(KERN_ERR "EXT4-fs: unable to read superblock\n"); |
1959 | goto out_fail; | 1955 | goto out_fail; |
1960 | } | 1956 | } |
1961 | /* | 1957 | /* |
@@ -2028,8 +2024,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2028 | set_opt(sbi->s_mount_opt, DELALLOC); | 2024 | set_opt(sbi->s_mount_opt, DELALLOC); |
2029 | 2025 | ||
2030 | 2026 | ||
2031 | if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum, | 2027 | if (!parse_options((char *) data, sb, &journal_inum, &journal_devnum, |
2032 | NULL, 0)) | 2028 | NULL, 0)) |
2033 | goto failed_mount; | 2029 | goto failed_mount; |
2034 | 2030 | ||
2035 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 2031 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
@@ -2104,7 +2100,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2104 | goto failed_mount; | 2100 | goto failed_mount; |
2105 | } | 2101 | } |
2106 | 2102 | ||
2107 | brelse (bh); | 2103 | brelse(bh); |
2108 | logical_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; | 2104 | logical_sb_block = sb_block * EXT4_MIN_BLOCK_SIZE; |
2109 | offset = do_div(logical_sb_block, blocksize); | 2105 | offset = do_div(logical_sb_block, blocksize); |
2110 | bh = sb_bread(sb, logical_sb_block); | 2106 | bh = sb_bread(sb, logical_sb_block); |
@@ -2116,8 +2112,8 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2116 | es = (struct ext4_super_block *)(((char *)bh->b_data) + offset); | 2112 | es = (struct ext4_super_block *)(((char *)bh->b_data) + offset); |
2117 | sbi->s_es = es; | 2113 | sbi->s_es = es; |
2118 | if (es->s_magic != cpu_to_le16(EXT4_SUPER_MAGIC)) { | 2114 | if (es->s_magic != cpu_to_le16(EXT4_SUPER_MAGIC)) { |
2119 | printk (KERN_ERR | 2115 | printk(KERN_ERR |
2120 | "EXT4-fs: Magic mismatch, very weird !\n"); | 2116 | "EXT4-fs: Magic mismatch, very weird !\n"); |
2121 | goto failed_mount; | 2117 | goto failed_mount; |
2122 | } | 2118 | } |
2123 | } | 2119 | } |
@@ -2134,9 +2130,9 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2134 | if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || | 2130 | if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || |
2135 | (!is_power_of_2(sbi->s_inode_size)) || | 2131 | (!is_power_of_2(sbi->s_inode_size)) || |
2136 | (sbi->s_inode_size > blocksize)) { | 2132 | (sbi->s_inode_size > blocksize)) { |
2137 | printk (KERN_ERR | 2133 | printk(KERN_ERR |
2138 | "EXT4-fs: unsupported inode size: %d\n", | 2134 | "EXT4-fs: unsupported inode size: %d\n", |
2139 | sbi->s_inode_size); | 2135 | sbi->s_inode_size); |
2140 | goto failed_mount; | 2136 | goto failed_mount; |
2141 | } | 2137 | } |
2142 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) | 2138 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) |
@@ -2168,20 +2164,20 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2168 | sbi->s_mount_state = le16_to_cpu(es->s_state); | 2164 | sbi->s_mount_state = le16_to_cpu(es->s_state); |
2169 | sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); | 2165 | sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); |
2170 | sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); | 2166 | sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); |
2171 | for (i=0; i < 4; i++) | 2167 | for (i = 0; i < 4; i++) |
2172 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); | 2168 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); |
2173 | sbi->s_def_hash_version = es->s_def_hash_version; | 2169 | sbi->s_def_hash_version = es->s_def_hash_version; |
2174 | 2170 | ||
2175 | if (sbi->s_blocks_per_group > blocksize * 8) { | 2171 | if (sbi->s_blocks_per_group > blocksize * 8) { |
2176 | printk (KERN_ERR | 2172 | printk(KERN_ERR |
2177 | "EXT4-fs: #blocks per group too big: %lu\n", | 2173 | "EXT4-fs: #blocks per group too big: %lu\n", |
2178 | sbi->s_blocks_per_group); | 2174 | sbi->s_blocks_per_group); |
2179 | goto failed_mount; | 2175 | goto failed_mount; |
2180 | } | 2176 | } |
2181 | if (sbi->s_inodes_per_group > blocksize * 8) { | 2177 | if (sbi->s_inodes_per_group > blocksize * 8) { |
2182 | printk (KERN_ERR | 2178 | printk(KERN_ERR |
2183 | "EXT4-fs: #inodes per group too big: %lu\n", | 2179 | "EXT4-fs: #inodes per group too big: %lu\n", |
2184 | sbi->s_inodes_per_group); | 2180 | sbi->s_inodes_per_group); |
2185 | goto failed_mount; | 2181 | goto failed_mount; |
2186 | } | 2182 | } |
2187 | 2183 | ||
@@ -2215,10 +2211,10 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2215 | sbi->s_groups_count = blocks_count; | 2211 | sbi->s_groups_count = blocks_count; |
2216 | db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) / | 2212 | db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) / |
2217 | EXT4_DESC_PER_BLOCK(sb); | 2213 | EXT4_DESC_PER_BLOCK(sb); |
2218 | sbi->s_group_desc = kmalloc(db_count * sizeof (struct buffer_head *), | 2214 | sbi->s_group_desc = kmalloc(db_count * sizeof(struct buffer_head *), |
2219 | GFP_KERNEL); | 2215 | GFP_KERNEL); |
2220 | if (sbi->s_group_desc == NULL) { | 2216 | if (sbi->s_group_desc == NULL) { |
2221 | printk (KERN_ERR "EXT4-fs: not enough memory\n"); | 2217 | printk(KERN_ERR "EXT4-fs: not enough memory\n"); |
2222 | goto failed_mount; | 2218 | goto failed_mount; |
2223 | } | 2219 | } |
2224 | 2220 | ||
@@ -2228,13 +2224,13 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2228 | block = descriptor_loc(sb, logical_sb_block, i); | 2224 | block = descriptor_loc(sb, logical_sb_block, i); |
2229 | sbi->s_group_desc[i] = sb_bread(sb, block); | 2225 | sbi->s_group_desc[i] = sb_bread(sb, block); |
2230 | if (!sbi->s_group_desc[i]) { | 2226 | if (!sbi->s_group_desc[i]) { |
2231 | printk (KERN_ERR "EXT4-fs: " | 2227 | printk(KERN_ERR "EXT4-fs: " |
2232 | "can't read group descriptor %d\n", i); | 2228 | "can't read group descriptor %d\n", i); |
2233 | db_count = i; | 2229 | db_count = i; |
2234 | goto failed_mount2; | 2230 | goto failed_mount2; |
2235 | } | 2231 | } |
2236 | } | 2232 | } |
2237 | if (!ext4_check_descriptors (sb)) { | 2233 | if (!ext4_check_descriptors(sb)) { |
2238 | printk(KERN_ERR "EXT4-fs: group descriptors corrupted!\n"); | 2234 | printk(KERN_ERR "EXT4-fs: group descriptors corrupted!\n"); |
2239 | goto failed_mount2; | 2235 | goto failed_mount2; |
2240 | } | 2236 | } |
@@ -2310,11 +2306,11 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2310 | EXT4_SB(sb)->s_journal->j_failed_commit) { | 2306 | EXT4_SB(sb)->s_journal->j_failed_commit) { |
2311 | printk(KERN_CRIT "EXT4-fs error (device %s): " | 2307 | printk(KERN_CRIT "EXT4-fs error (device %s): " |
2312 | "ext4_fill_super: Journal transaction " | 2308 | "ext4_fill_super: Journal transaction " |
2313 | "%u is corrupt\n", sb->s_id, | 2309 | "%u is corrupt\n", sb->s_id, |
2314 | EXT4_SB(sb)->s_journal->j_failed_commit); | 2310 | EXT4_SB(sb)->s_journal->j_failed_commit); |
2315 | if (test_opt (sb, ERRORS_RO)) { | 2311 | if (test_opt(sb, ERRORS_RO)) { |
2316 | printk (KERN_CRIT | 2312 | printk(KERN_CRIT |
2317 | "Mounting filesystem read-only\n"); | 2313 | "Mounting filesystem read-only\n"); |
2318 | sb->s_flags |= MS_RDONLY; | 2314 | sb->s_flags |= MS_RDONLY; |
2319 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; | 2315 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; |
2320 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); | 2316 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); |
@@ -2334,9 +2330,9 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2334 | goto failed_mount3; | 2330 | goto failed_mount3; |
2335 | } else { | 2331 | } else { |
2336 | if (!silent) | 2332 | if (!silent) |
2337 | printk (KERN_ERR | 2333 | printk(KERN_ERR |
2338 | "ext4: No journal on filesystem on %s\n", | 2334 | "ext4: No journal on filesystem on %s\n", |
2339 | sb->s_id); | 2335 | sb->s_id); |
2340 | goto failed_mount3; | 2336 | goto failed_mount3; |
2341 | } | 2337 | } |
2342 | 2338 | ||
@@ -2420,7 +2416,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2420 | goto failed_mount4; | 2416 | goto failed_mount4; |
2421 | } | 2417 | } |
2422 | 2418 | ||
2423 | ext4_setup_super (sb, es, sb->s_flags & MS_RDONLY); | 2419 | ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY); |
2424 | 2420 | ||
2425 | /* determine the minimum size of new large inodes, if present */ | 2421 | /* determine the minimum size of new large inodes, if present */ |
2426 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { | 2422 | if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) { |
@@ -2459,12 +2455,12 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2459 | ext4_orphan_cleanup(sb, es); | 2455 | ext4_orphan_cleanup(sb, es); |
2460 | EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS; | 2456 | EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS; |
2461 | if (needs_recovery) | 2457 | if (needs_recovery) |
2462 | printk (KERN_INFO "EXT4-fs: recovery complete.\n"); | 2458 | printk(KERN_INFO "EXT4-fs: recovery complete.\n"); |
2463 | ext4_mark_recovery_complete(sb, es); | 2459 | ext4_mark_recovery_complete(sb, es); |
2464 | printk (KERN_INFO "EXT4-fs: mounted filesystem with %s data mode.\n", | 2460 | printk(KERN_INFO "EXT4-fs: mounted filesystem with %s data mode.\n", |
2465 | test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ? "journal": | 2461 | test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ? "journal": |
2466 | test_opt(sb,DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered": | 2462 | test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered": |
2467 | "writeback"); | 2463 | "writeback"); |
2468 | 2464 | ||
2469 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { | 2465 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { |
2470 | printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - " | 2466 | printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - " |
@@ -2577,14 +2573,14 @@ static journal_t *ext4_get_journal(struct super_block *sb, | |||
2577 | static journal_t *ext4_get_dev_journal(struct super_block *sb, | 2573 | static journal_t *ext4_get_dev_journal(struct super_block *sb, |
2578 | dev_t j_dev) | 2574 | dev_t j_dev) |
2579 | { | 2575 | { |
2580 | struct buffer_head * bh; | 2576 | struct buffer_head *bh; |
2581 | journal_t *journal; | 2577 | journal_t *journal; |
2582 | ext4_fsblk_t start; | 2578 | ext4_fsblk_t start; |
2583 | ext4_fsblk_t len; | 2579 | ext4_fsblk_t len; |
2584 | int hblock, blocksize; | 2580 | int hblock, blocksize; |
2585 | ext4_fsblk_t sb_block; | 2581 | ext4_fsblk_t sb_block; |
2586 | unsigned long offset; | 2582 | unsigned long offset; |
2587 | struct ext4_super_block * es; | 2583 | struct ext4_super_block *es; |
2588 | struct block_device *bdev; | 2584 | struct block_device *bdev; |
2589 | 2585 | ||
2590 | bdev = ext4_blkdev_get(j_dev); | 2586 | bdev = ext4_blkdev_get(j_dev); |
@@ -2699,8 +2695,8 @@ static int ext4_load_journal(struct super_block *sb, | |||
2699 | "unavailable, cannot proceed.\n"); | 2695 | "unavailable, cannot proceed.\n"); |
2700 | return -EROFS; | 2696 | return -EROFS; |
2701 | } | 2697 | } |
2702 | printk (KERN_INFO "EXT4-fs: write access will " | 2698 | printk(KERN_INFO "EXT4-fs: write access will " |
2703 | "be enabled during recovery.\n"); | 2699 | "be enabled during recovery.\n"); |
2704 | } | 2700 | } |
2705 | } | 2701 | } |
2706 | 2702 | ||
@@ -2753,8 +2749,8 @@ static int ext4_load_journal(struct super_block *sb, | |||
2753 | return 0; | 2749 | return 0; |
2754 | } | 2750 | } |
2755 | 2751 | ||
2756 | static int ext4_create_journal(struct super_block * sb, | 2752 | static int ext4_create_journal(struct super_block *sb, |
2757 | struct ext4_super_block * es, | 2753 | struct ext4_super_block *es, |
2758 | unsigned int journal_inum) | 2754 | unsigned int journal_inum) |
2759 | { | 2755 | { |
2760 | journal_t *journal; | 2756 | journal_t *journal; |
@@ -2795,9 +2791,8 @@ static int ext4_create_journal(struct super_block * sb, | |||
2795 | return 0; | 2791 | return 0; |
2796 | } | 2792 | } |
2797 | 2793 | ||
2798 | static void ext4_commit_super (struct super_block * sb, | 2794 | static void ext4_commit_super(struct super_block *sb, |
2799 | struct ext4_super_block * es, | 2795 | struct ext4_super_block *es, int sync) |
2800 | int sync) | ||
2801 | { | 2796 | { |
2802 | struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; | 2797 | struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; |
2803 | 2798 | ||
@@ -2818,8 +2813,8 @@ static void ext4_commit_super (struct super_block * sb, | |||
2818 | * remounting) the filesystem readonly, then we will end up with a | 2813 | * remounting) the filesystem readonly, then we will end up with a |
2819 | * consistent fs on disk. Record that fact. | 2814 | * consistent fs on disk. Record that fact. |
2820 | */ | 2815 | */ |
2821 | static void ext4_mark_recovery_complete(struct super_block * sb, | 2816 | static void ext4_mark_recovery_complete(struct super_block *sb, |
2822 | struct ext4_super_block * es) | 2817 | struct ext4_super_block *es) |
2823 | { | 2818 | { |
2824 | journal_t *journal = EXT4_SB(sb)->s_journal; | 2819 | journal_t *journal = EXT4_SB(sb)->s_journal; |
2825 | 2820 | ||
@@ -2841,8 +2836,8 @@ static void ext4_mark_recovery_complete(struct super_block * sb, | |||
2841 | * has recorded an error from a previous lifetime, move that error to the | 2836 | * has recorded an error from a previous lifetime, move that error to the |
2842 | * main filesystem now. | 2837 | * main filesystem now. |
2843 | */ | 2838 | */ |
2844 | static void ext4_clear_journal_err(struct super_block * sb, | 2839 | static void ext4_clear_journal_err(struct super_block *sb, |
2845 | struct ext4_super_block * es) | 2840 | struct ext4_super_block *es) |
2846 | { | 2841 | { |
2847 | journal_t *journal; | 2842 | journal_t *journal; |
2848 | int j_errno; | 2843 | int j_errno; |
@@ -2867,7 +2862,7 @@ static void ext4_clear_journal_err(struct super_block * sb, | |||
2867 | 2862 | ||
2868 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; | 2863 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; |
2869 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); | 2864 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); |
2870 | ext4_commit_super (sb, es, 1); | 2865 | ext4_commit_super(sb, es, 1); |
2871 | 2866 | ||
2872 | jbd2_journal_clear_err(journal); | 2867 | jbd2_journal_clear_err(journal); |
2873 | } | 2868 | } |
@@ -2900,7 +2895,7 @@ int ext4_force_commit(struct super_block *sb) | |||
2900 | * This implicitly triggers the writebehind on sync(). | 2895 | * This implicitly triggers the writebehind on sync(). |
2901 | */ | 2896 | */ |
2902 | 2897 | ||
2903 | static void ext4_write_super (struct super_block * sb) | 2898 | static void ext4_write_super(struct super_block *sb) |
2904 | { | 2899 | { |
2905 | if (mutex_trylock(&sb->s_lock) != 0) | 2900 | if (mutex_trylock(&sb->s_lock) != 0) |
2906 | BUG(); | 2901 | BUG(); |
@@ -2956,9 +2951,9 @@ static void ext4_unlockfs(struct super_block *sb) | |||
2956 | } | 2951 | } |
2957 | } | 2952 | } |
2958 | 2953 | ||
2959 | static int ext4_remount (struct super_block * sb, int * flags, char * data) | 2954 | static int ext4_remount(struct super_block *sb, int *flags, char *data) |
2960 | { | 2955 | { |
2961 | struct ext4_super_block * es; | 2956 | struct ext4_super_block *es; |
2962 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 2957 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
2963 | ext4_fsblk_t n_blocks_count = 0; | 2958 | ext4_fsblk_t n_blocks_count = 0; |
2964 | unsigned long old_sb_flags; | 2959 | unsigned long old_sb_flags; |
@@ -3086,7 +3081,7 @@ static int ext4_remount (struct super_block * sb, int * flags, char * data) | |||
3086 | sbi->s_mount_state = le16_to_cpu(es->s_state); | 3081 | sbi->s_mount_state = le16_to_cpu(es->s_state); |
3087 | if ((err = ext4_group_extend(sb, es, n_blocks_count))) | 3082 | if ((err = ext4_group_extend(sb, es, n_blocks_count))) |
3088 | goto restore_opts; | 3083 | goto restore_opts; |
3089 | if (!ext4_setup_super (sb, es, 0)) | 3084 | if (!ext4_setup_super(sb, es, 0)) |
3090 | sb->s_flags &= ~MS_RDONLY; | 3085 | sb->s_flags &= ~MS_RDONLY; |
3091 | } | 3086 | } |
3092 | } | 3087 | } |
@@ -3116,7 +3111,7 @@ restore_opts: | |||
3116 | return err; | 3111 | return err; |
3117 | } | 3112 | } |
3118 | 3113 | ||
3119 | static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf) | 3114 | static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) |
3120 | { | 3115 | { |
3121 | struct super_block *sb = dentry->d_sb; | 3116 | struct super_block *sb = dentry->d_sb; |
3122 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 3117 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
@@ -3354,12 +3349,12 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3354 | } | 3349 | } |
3355 | /* Journaling quota? */ | 3350 | /* Journaling quota? */ |
3356 | if (EXT4_SB(sb)->s_qf_names[type]) { | 3351 | if (EXT4_SB(sb)->s_qf_names[type]) { |
3357 | /* Quotafile not of fs root? */ | 3352 | /* Quotafile not in fs root? */ |
3358 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 3353 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) |
3359 | printk(KERN_WARNING | 3354 | printk(KERN_WARNING |
3360 | "EXT4-fs: Quota file not on filesystem root. " | 3355 | "EXT4-fs: Quota file not on filesystem root. " |
3361 | "Journaled quota will not work.\n"); | 3356 | "Journaled quota will not work.\n"); |
3362 | } | 3357 | } |
3363 | 3358 | ||
3364 | /* | 3359 | /* |
3365 | * When we journal data on quota file, we have to flush journal to see | 3360 | * When we journal data on quota file, we have to flush journal to see |