aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/balloc.c29
-rw-r--r--fs/ext4/dir.c3
-rw-r--r--fs/ext4/extents.c9
-rw-r--r--fs/ext4/ialloc.c16
-rw-r--r--fs/ext4/mballoc.c9
-rw-r--r--fs/ext4/namei.c34
-rw-r--r--fs/ext4/super.c25
7 files changed, 71 insertions, 54 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 00a94d5866c2..7aac2025ba9c 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -379,26 +379,28 @@ restart:
379 bad = 0; 379 bad = 0;
380 prev = NULL; 380 prev = NULL;
381 381
382 printk("Block Allocation Reservation Windows Map (%s):\n", fn); 382 printk(KERN_DEBUG "Block Allocation Reservation "
383 "Windows Map (%s):\n", fn);
383 while (n) { 384 while (n) {
384 rsv = rb_entry(n, struct ext4_reserve_window_node, rsv_node); 385 rsv = rb_entry(n, struct ext4_reserve_window_node, rsv_node);
385 if (verbose) 386 if (verbose)
386 printk("reservation window 0x%p " 387 printk(KERN_DEBUG "reservation window 0x%p "
387 "start: %llu, end: %llu\n", 388 "start: %llu, end: %llu\n",
388 rsv, rsv->rsv_start, rsv->rsv_end); 389 rsv, rsv->rsv_start, rsv->rsv_end);
389 if (rsv->rsv_start && rsv->rsv_start >= rsv->rsv_end) { 390 if (rsv->rsv_start && rsv->rsv_start >= rsv->rsv_end) {
390 printk("Bad reservation %p (start >= end)\n", 391 printk(KERN_DEBUG "Bad reservation %p (start >= end)\n",
391 rsv); 392 rsv);
392 bad = 1; 393 bad = 1;
393 } 394 }
394 if (prev && prev->rsv_end >= rsv->rsv_start) { 395 if (prev && prev->rsv_end >= rsv->rsv_start) {
395 printk("Bad reservation %p (prev->end >= start)\n", 396 printk(KERN_DEBUG "Bad reservation %p "
396 rsv); 397 "(prev->end >= start)\n", rsv);
397 bad = 1; 398 bad = 1;
398 } 399 }
399 if (bad) { 400 if (bad) {
400 if (!verbose) { 401 if (!verbose) {
401 printk("Restarting reservation walk in verbose mode\n"); 402 printk(KERN_DEBUG "Restarting reservation "
403 "walk in verbose mode\n");
402 verbose = 1; 404 verbose = 1;
403 goto restart; 405 goto restart;
404 } 406 }
@@ -406,7 +408,7 @@ restart:
406 n = rb_next(n); 408 n = rb_next(n);
407 prev = rsv; 409 prev = rsv;
408 } 410 }
409 printk("Window map complete.\n"); 411 printk(KERN_DEBUG "Window map complete.\n");
410 BUG_ON(bad); 412 BUG_ON(bad);
411} 413}
412#define rsv_window_dump(root, verbose) \ 414#define rsv_window_dump(root, verbose) \
@@ -1702,7 +1704,7 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
1702 sb = inode->i_sb; 1704 sb = inode->i_sb;
1703 if (!sb) { 1705 if (!sb) {
1704 *errp = -ENODEV; 1706 *errp = -ENODEV;
1705 printk("ext4_new_block: nonexistent device"); 1707 printk(KERN_ERR "ext4_new_block: nonexistent superblock");
1706 return 0; 1708 return 0;
1707 } 1709 }
1708 1710
@@ -1884,8 +1886,8 @@ allocated:
1884 for (i = 0; i < num; i++) { 1886 for (i = 0; i < num; i++) {
1885 if (ext4_test_bit(grp_alloc_blk+i, 1887 if (ext4_test_bit(grp_alloc_blk+i,
1886 bh2jh(bitmap_bh)->b_committed_data)) { 1888 bh2jh(bitmap_bh)->b_committed_data)) {
1887 printk("%s: block was unexpectedly set in " 1889 printk(KERN_ERR "%s: block was unexpectedly "
1888 "b_committed_data\n", __func__); 1890 "set in b_committed_data\n", __func__);
1889 } 1891 }
1890 } 1892 }
1891 } 1893 }
@@ -2093,10 +2095,9 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
2093 bitmap_count += x; 2095 bitmap_count += x;
2094 } 2096 }
2095 brelse(bitmap_bh); 2097 brelse(bitmap_bh);
2096 printk("ext4_count_free_blocks: stored = %llu" 2098 printk(KERN_DEBUG "ext4_count_free_blocks: stored = %llu"
2097 ", computed = %llu, %llu\n", 2099 ", computed = %llu, %llu\n", ext4_free_blocks_count(es),
2098 ext4_free_blocks_count(es), 2100 desc_count, bitmap_count);
2099 desc_count, bitmap_count);
2100 return bitmap_count; 2101 return bitmap_count;
2101#else 2102#else
2102 desc_count = 0; 2103 desc_count = 0;
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ec8e33b45219..ac873dbf0dd0 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -400,7 +400,8 @@ static int call_filldir(struct file * filp, void * dirent,
400 sb = inode->i_sb; 400 sb = inode->i_sb;
401 401
402 if (!fname) { 402 if (!fname) {
403 printk("call_filldir: called with null fname?!?\n"); 403 printk(KERN_ERR "ext4: call_filldir: called with "
404 "null fname?!?\n");
404 return 0; 405 return 0;
405 } 406 }
406 curr_pos = hash2pos(fname->hash, fname->minor_hash); 407 curr_pos = hash2pos(fname->hash, fname->minor_hash);
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b24d3c53f20c..a8db7fdf9cb7 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -440,9 +440,10 @@ ext4_ext_binsearch_idx(struct inode *inode,
440 for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ix++) { 440 for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ix++) {
441 if (k != 0 && 441 if (k != 0 &&
442 le32_to_cpu(ix->ei_block) <= le32_to_cpu(ix[-1].ei_block)) { 442 le32_to_cpu(ix->ei_block) <= le32_to_cpu(ix[-1].ei_block)) {
443 printk("k=%d, ix=0x%p, first=0x%p\n", k, 443 printk(KERN_DEBUG "k=%d, ix=0x%p, "
444 ix, EXT_FIRST_INDEX(eh)); 444 "first=0x%p\n", k,
445 printk("%u <= %u\n", 445 ix, EXT_FIRST_INDEX(eh));
446 printk(KERN_DEBUG "%u <= %u\n",
446 le32_to_cpu(ix->ei_block), 447 le32_to_cpu(ix->ei_block),
447 le32_to_cpu(ix[-1].ei_block)); 448 le32_to_cpu(ix[-1].ei_block));
448 } 449 }
@@ -2142,7 +2143,7 @@ void ext4_ext_init(struct super_block *sb)
2142 */ 2143 */
2143 2144
2144 if (test_opt(sb, EXTENTS)) { 2145 if (test_opt(sb, EXTENTS)) {
2145 printk("EXT4-fs: file extents enabled"); 2146 printk(KERN_INFO "EXT4-fs: file extents enabled");
2146#ifdef AGGRESSIVE_TEST 2147#ifdef AGGRESSIVE_TEST
2147 printk(", aggressive tests"); 2148 printk(", aggressive tests");
2148#endif 2149#endif
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index f344834bbf58..45c66a03f182 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -170,17 +170,18 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
170 ext4_group_t flex_group; 170 ext4_group_t flex_group;
171 171
172 if (atomic_read(&inode->i_count) > 1) { 172 if (atomic_read(&inode->i_count) > 1) {
173 printk ("ext4_free_inode: inode has count=%d\n", 173 printk(KERN_ERR "ext4_free_inode: inode has count=%d\n",
174 atomic_read(&inode->i_count)); 174 atomic_read(&inode->i_count));
175 return; 175 return;
176 } 176 }
177 if (inode->i_nlink) { 177 if (inode->i_nlink) {
178 printk ("ext4_free_inode: inode has nlink=%d\n", 178 printk(KERN_ERR "ext4_free_inode: inode has nlink=%d\n",
179 inode->i_nlink); 179 inode->i_nlink);
180 return; 180 return;
181 } 181 }
182 if (!sb) { 182 if (!sb) {
183 printk("ext4_free_inode: inode on nonexistent device\n"); 183 printk(KERN_ERR "ext4_free_inode: inode on "
184 "nonexistent device\n");
184 return; 185 return;
185 } 186 }
186 sbi = EXT4_SB(sb); 187 sbi = EXT4_SB(sb);
@@ -989,8 +990,9 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
989 bitmap_count += x; 990 bitmap_count += x;
990 } 991 }
991 brelse(bitmap_bh); 992 brelse(bitmap_bh);
992 printk("ext4_count_free_inodes: stored = %u, computed = %lu, %lu\n", 993 printk(KERN_DEBUG "ext4_count_free_inodes: "
993 le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count); 994 "stored = %u, computed = %lu, %lu\n",
995 le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count);
994 return desc_count; 996 return desc_count;
995#else 997#else
996 desc_count = 0; 998 desc_count = 0;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index e0e3a5eb1ddb..0db2ccfa0dad 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -477,9 +477,10 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap)
477 b2 = (unsigned char *) bitmap; 477 b2 = (unsigned char *) bitmap;
478 for (i = 0; i < e4b->bd_sb->s_blocksize; i++) { 478 for (i = 0; i < e4b->bd_sb->s_blocksize; i++) {
479 if (b1[i] != b2[i]) { 479 if (b1[i] != b2[i]) {
480 printk("corruption in group %lu at byte %u(%u):" 480 printk(KERN_ERR "corruption in group %lu "
481 " %x in copy != %x on disk/prealloc\n", 481 "at byte %u(%u): %x in copy != %x "
482 e4b->bd_group, i, i * 8, b1[i], b2[i]); 482 "on disk/prealloc\n",
483 e4b->bd_group, i, i * 8, b1[i], b2[i]);
483 BUG(); 484 BUG();
484 } 485 }
485 } 486 }
@@ -2560,7 +2561,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
2560 ext4_mb_init_per_dev_proc(sb); 2561 ext4_mb_init_per_dev_proc(sb);
2561 ext4_mb_history_init(sb); 2562 ext4_mb_history_init(sb);
2562 2563
2563 printk("EXT4-fs: mballoc enabled\n"); 2564 printk(KERN_INFO "EXT4-fs: mballoc enabled\n");
2564 return 0; 2565 return 0;
2565} 2566}
2566 2567
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 387ad98350c3..978b57f8630d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -254,12 +254,12 @@ static inline unsigned dx_node_limit (struct inode *dir)
254 * Debug 254 * Debug
255 */ 255 */
256#ifdef DX_DEBUG 256#ifdef DX_DEBUG
257static void dx_show_index (char * label, struct dx_entry *entries) 257static void dx_show_index(char * label, struct dx_entry *entries)
258{ 258{
259 int i, n = dx_get_count (entries); 259 int i, n = dx_get_count (entries);
260 printk("%s index ", label); 260 printk(KERN_DEBUG "%s index ", label);
261 for (i = 0; i < n; i++) { 261 for (i = 0; i < n; i++) {
262 printk("%x->%lu ", i? dx_get_hash(entries + i) : 262 printk("%x->%lu ", i ? dx_get_hash(entries + i) :
263 0, (unsigned long)dx_get_block(entries + i)); 263 0, (unsigned long)dx_get_block(entries + i));
264 } 264 }
265 printk("\n"); 265 printk("\n");
@@ -328,8 +328,9 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir,
328 brelse (bh); 328 brelse (bh);
329 } 329 }
330 if (bcount) 330 if (bcount)
331 printk("%snames %u, fullness %u (%u%%)\n", levels?"":" ", 331 printk(KERN_DEBUG "%snames %u, fullness %u (%u%%)\n",
332 names, space/bcount,(space/bcount)*100/blocksize); 332 levels ? "" : " ", names, space/bcount,
333 (space/bcount)*100/blocksize);
333 return (struct stats) { names, space, bcount}; 334 return (struct stats) { names, space, bcount};
334} 335}
335#endif /* DX_DEBUG */ 336#endif /* DX_DEBUG */
@@ -635,8 +636,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
635 int ret, err; 636 int ret, err;
636 __u32 hashval; 637 __u32 hashval;
637 638
638 dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, 639 dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n",
639 start_minor_hash)); 640 start_hash, start_minor_hash));
640 dir = dir_file->f_path.dentry->d_inode; 641 dir = dir_file->f_path.dentry->d_inode;
641 if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) { 642 if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) {
642 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; 643 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
@@ -694,8 +695,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
694 break; 695 break;
695 } 696 }
696 dx_release(frames); 697 dx_release(frames);
697 dxtrace(printk("Fill tree: returned %d entries, next hash: %x\n", 698 dxtrace(printk(KERN_DEBUG "Fill tree: returned %d entries, "
698 count, *next_hash)); 699 "next hash: %x\n", count, *next_hash));
699 return count; 700 return count;
700errout: 701errout:
701 dx_release(frames); 702 dx_release(frames);
@@ -882,7 +883,8 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
882 */ 883 */
883 if (bh || (err != ERR_BAD_DX_DIR)) 884 if (bh || (err != ERR_BAD_DX_DIR))
884 return bh; 885 return bh;
885 dxtrace(printk("ext4_find_entry: dx failed, falling back\n")); 886 dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
887 "falling back\n"));
886 } 888 }
887 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); 889 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
888 start = EXT4_I(dir)->i_dir_start_lookup; 890 start = EXT4_I(dir)->i_dir_start_lookup;
@@ -1025,7 +1027,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
1025 1027
1026 *err = -ENOENT; 1028 *err = -ENOENT;
1027errout: 1029errout:
1028 dxtrace(printk("%s not found\n", name)); 1030 dxtrace(printk(KERN_DEBUG "%s not found\n", name));
1029 dx_release (frames); 1031 dx_release (frames);
1030 return NULL; 1032 return NULL;
1031} 1033}
@@ -1377,7 +1379,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1377 struct fake_dirent *fde; 1379 struct fake_dirent *fde;
1378 1380
1379 blocksize = dir->i_sb->s_blocksize; 1381 blocksize = dir->i_sb->s_blocksize;
1380 dxtrace(printk("Creating index\n")); 1382 dxtrace(printk(KERN_DEBUG "Creating index\n"));
1381 retval = ext4_journal_get_write_access(handle, bh); 1383 retval = ext4_journal_get_write_access(handle, bh);
1382 if (retval) { 1384 if (retval) {
1383 ext4_std_error(dir->i_sb, retval); 1385 ext4_std_error(dir->i_sb, retval);
@@ -1527,7 +1529,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1527 } 1529 }
1528 1530
1529 /* Block full, should compress but for now just split */ 1531 /* Block full, should compress but for now just split */
1530 dxtrace(printk("using %u of %u node entries\n", 1532 dxtrace(printk(KERN_DEBUG "using %u of %u node entries\n",
1531 dx_get_count(entries), dx_get_limit(entries))); 1533 dx_get_count(entries), dx_get_limit(entries)));
1532 /* Need to split index? */ 1534 /* Need to split index? */
1533 if (dx_get_count(entries) == dx_get_limit(entries)) { 1535 if (dx_get_count(entries) == dx_get_limit(entries)) {
@@ -1559,7 +1561,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1559 if (levels) { 1561 if (levels) {
1560 unsigned icount1 = icount/2, icount2 = icount - icount1; 1562 unsigned icount1 = icount/2, icount2 = icount - icount1;
1561 unsigned hash2 = dx_get_hash(entries + icount1); 1563 unsigned hash2 = dx_get_hash(entries + icount1);
1562 dxtrace(printk("Split index %i/%i\n", icount1, icount2)); 1564 dxtrace(printk(KERN_DEBUG "Split index %i/%i\n",
1565 icount1, icount2));
1563 1566
1564 BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */ 1567 BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */
1565 err = ext4_journal_get_write_access(handle, 1568 err = ext4_journal_get_write_access(handle,
@@ -1588,7 +1591,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1588 goto journal_error; 1591 goto journal_error;
1589 brelse (bh2); 1592 brelse (bh2);
1590 } else { 1593 } else {
1591 dxtrace(printk("Creating second level index...\n")); 1594 dxtrace(printk(KERN_DEBUG
1595 "Creating second level index...\n"));
1592 memcpy((char *) entries2, (char *) entries, 1596 memcpy((char *) entries2, (char *) entries,
1593 icount * sizeof(struct dx_entry)); 1597 icount * sizeof(struct dx_entry));
1594 dx_set_limit(entries2, dx_node_limit(dir)); 1598 dx_set_limit(entries2, dx_node_limit(dir));
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 566344b926b7..ee8695464957 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -981,7 +981,7 @@ static ext4_fsblk_t get_sb_block(void **data)
981 /*todo: use simple_strtoll with >32bit ext4 */ 981 /*todo: use simple_strtoll with >32bit ext4 */
982 sb_block = simple_strtoul(options, &options, 0); 982 sb_block = simple_strtoul(options, &options, 0);
983 if (*options && *options != ',') { 983 if (*options && *options != ',') {
984 printk("EXT4-fs: Invalid sb specification: %s\n", 984 printk(KERN_ERR "EXT4-fs: Invalid sb specification: %s\n",
985 (char *) *data); 985 (char *) *data);
986 return 1; 986 return 1;
987 } 987 }
@@ -1082,7 +1082,8 @@ static int parse_options(char *options, struct super_block *sb,
1082#else 1082#else
1083 case Opt_user_xattr: 1083 case Opt_user_xattr:
1084 case Opt_nouser_xattr: 1084 case Opt_nouser_xattr:
1085 printk("EXT4 (no)user_xattr options not supported\n"); 1085 printk(KERN_ERR "EXT4 (no)user_xattr options "
1086 "not supported\n");
1086 break; 1087 break;
1087#endif 1088#endif
1088#ifdef CONFIG_EXT4DEV_FS_POSIX_ACL 1089#ifdef CONFIG_EXT4DEV_FS_POSIX_ACL
@@ -1095,7 +1096,8 @@ static int parse_options(char *options, struct super_block *sb,
1095#else 1096#else
1096 case Opt_acl: 1097 case Opt_acl:
1097 case Opt_noacl: 1098 case Opt_noacl:
1098 printk("EXT4 (no)acl options not supported\n"); 1099 printk(KERN_ERR "EXT4 (no)acl options "
1100 "not supported\n");
1099 break; 1101 break;
1100#endif 1102#endif
1101 case Opt_reservation: 1103 case Opt_reservation:
@@ -1189,8 +1191,8 @@ set_qf_name:
1189 sb_any_quota_suspended(sb)) && 1191 sb_any_quota_suspended(sb)) &&
1190 !sbi->s_qf_names[qtype]) { 1192 !sbi->s_qf_names[qtype]) {
1191 printk(KERN_ERR 1193 printk(KERN_ERR
1192 "EXT4-fs: Cannot change journaled " 1194 "EXT4-fs: Cannot change journaled "
1193 "quota options when quota turned on.\n"); 1195 "quota options when quota turned on.\n");
1194 return 0; 1196 return 0;
1195 } 1197 }
1196 qname = match_strdup(&args[0]); 1198 qname = match_strdup(&args[0]);
@@ -1473,14 +1475,14 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
1473 EXT4_INODES_PER_GROUP(sb), 1475 EXT4_INODES_PER_GROUP(sb),
1474 sbi->s_mount_opt); 1476 sbi->s_mount_opt);
1475 1477
1476 printk(KERN_INFO "EXT4 FS on %s, ", sb->s_id);
1477 if (EXT4_SB(sb)->s_journal->j_inode == NULL) { 1478 if (EXT4_SB(sb)->s_journal->j_inode == NULL) {
1478 char b[BDEVNAME_SIZE]; 1479 char b[BDEVNAME_SIZE];
1479 1480
1480 printk("external journal on %s\n", 1481 printk(KERN_INFO "EXT4 FS on %s, external journal on %s\n",
1481 bdevname(EXT4_SB(sb)->s_journal->j_dev, b)); 1482 sb->s_id, bdevname(EXT4_SB(sb)->s_journal->j_dev, b));
1482 } else { 1483 } else {
1483 printk("internal journal\n"); 1484 printk(KERN_INFO "EXT4 FS on %s, internal journal\n",
1485 sb->s_id);
1484 } 1486 }
1485 return res; 1487 return res;
1486} 1488}
@@ -2715,6 +2717,11 @@ static int ext4_load_journal(struct super_block *sb,
2715 return -EINVAL; 2717 return -EINVAL;
2716 } 2718 }
2717 2719
2720 if (journal->j_flags & JBD2_BARRIER)
2721 printk(KERN_INFO "EXT4-fs: barriers enabled\n");
2722 else
2723 printk(KERN_INFO "EXT4-fs: barriers disabled\n");
2724
2718 if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) { 2725 if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) {
2719 err = jbd2_journal_update_format(journal); 2726 err = jbd2_journal_update_format(journal);
2720 if (err) { 2727 if (err) {