Commit 4776004f authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: Add printk priority levels to clean up checkpatch warnings

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 1f7c14c6
...@@ -379,26 +379,28 @@ restart: ...@@ -379,26 +379,28 @@ restart:
bad = 0; bad = 0;
prev = NULL; prev = NULL;
printk("Block Allocation Reservation Windows Map (%s):\n", fn); printk(KERN_DEBUG "Block Allocation Reservation "
"Windows Map (%s):\n", fn);
while (n) { while (n) {
rsv = rb_entry(n, struct ext4_reserve_window_node, rsv_node); rsv = rb_entry(n, struct ext4_reserve_window_node, rsv_node);
if (verbose) if (verbose)
printk("reservation window 0x%p " printk(KERN_DEBUG "reservation window 0x%p "
"start: %llu, end: %llu\n", "start: %llu, end: %llu\n",
rsv, rsv->rsv_start, rsv->rsv_end); rsv, rsv->rsv_start, rsv->rsv_end);
if (rsv->rsv_start && rsv->rsv_start >= rsv->rsv_end) { if (rsv->rsv_start && rsv->rsv_start >= rsv->rsv_end) {
printk("Bad reservation %p (start >= end)\n", printk(KERN_DEBUG "Bad reservation %p (start >= end)\n",
rsv); rsv);
bad = 1; bad = 1;
} }
if (prev && prev->rsv_end >= rsv->rsv_start) { if (prev && prev->rsv_end >= rsv->rsv_start) {
printk("Bad reservation %p (prev->end >= start)\n", printk(KERN_DEBUG "Bad reservation %p "
rsv); "(prev->end >= start)\n", rsv);
bad = 1; bad = 1;
} }
if (bad) { if (bad) {
if (!verbose) { if (!verbose) {
printk("Restarting reservation walk in verbose mode\n"); printk(KERN_DEBUG "Restarting reservation "
"walk in verbose mode\n");
verbose = 1; verbose = 1;
goto restart; goto restart;
} }
...@@ -406,7 +408,7 @@ restart: ...@@ -406,7 +408,7 @@ restart:
n = rb_next(n); n = rb_next(n);
prev = rsv; prev = rsv;
} }
printk("Window map complete.\n"); printk(KERN_DEBUG "Window map complete.\n");
BUG_ON(bad); BUG_ON(bad);
} }
#define rsv_window_dump(root, verbose) \ #define rsv_window_dump(root, verbose) \
...@@ -1702,7 +1704,7 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode, ...@@ -1702,7 +1704,7 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
sb = inode->i_sb; sb = inode->i_sb;
if (!sb) { if (!sb) {
*errp = -ENODEV; *errp = -ENODEV;
printk("ext4_new_block: nonexistent device"); printk(KERN_ERR "ext4_new_block: nonexistent superblock");
return 0; return 0;
} }
...@@ -1884,8 +1886,8 @@ allocated: ...@@ -1884,8 +1886,8 @@ allocated:
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (ext4_test_bit(grp_alloc_blk+i, if (ext4_test_bit(grp_alloc_blk+i,
bh2jh(bitmap_bh)->b_committed_data)) { bh2jh(bitmap_bh)->b_committed_data)) {
printk("%s: block was unexpectedly set in " printk(KERN_ERR "%s: block was unexpectedly "
"b_committed_data\n", __func__); "set in b_committed_data\n", __func__);
} }
} }
} }
...@@ -2093,9 +2095,8 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb) ...@@ -2093,9 +2095,8 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
bitmap_count += x; bitmap_count += x;
} }
brelse(bitmap_bh); brelse(bitmap_bh);
printk("ext4_count_free_blocks: stored = %llu" printk(KERN_DEBUG "ext4_count_free_blocks: stored = %llu"
", computed = %llu, %llu\n", ", computed = %llu, %llu\n", ext4_free_blocks_count(es),
ext4_free_blocks_count(es),
desc_count, bitmap_count); desc_count, bitmap_count);
return bitmap_count; return bitmap_count;
#else #else
......
...@@ -400,7 +400,8 @@ static int call_filldir(struct file * filp, void * dirent, ...@@ -400,7 +400,8 @@ static int call_filldir(struct file * filp, void * dirent,
sb = inode->i_sb; sb = inode->i_sb;
if (!fname) { if (!fname) {
printk("call_filldir: called with null fname?!?\n"); printk(KERN_ERR "ext4: call_filldir: called with "
"null fname?!?\n");
return 0; return 0;
} }
curr_pos = hash2pos(fname->hash, fname->minor_hash); curr_pos = hash2pos(fname->hash, fname->minor_hash);
......
...@@ -440,9 +440,10 @@ ext4_ext_binsearch_idx(struct inode *inode, ...@@ -440,9 +440,10 @@ ext4_ext_binsearch_idx(struct inode *inode,
for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ix++) { for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ix++) {
if (k != 0 && if (k != 0 &&
le32_to_cpu(ix->ei_block) <= le32_to_cpu(ix[-1].ei_block)) { le32_to_cpu(ix->ei_block) <= le32_to_cpu(ix[-1].ei_block)) {
printk("k=%d, ix=0x%p, first=0x%p\n", k, printk(KERN_DEBUG "k=%d, ix=0x%p, "
"first=0x%p\n", k,
ix, EXT_FIRST_INDEX(eh)); ix, EXT_FIRST_INDEX(eh));
printk("%u <= %u\n", printk(KERN_DEBUG "%u <= %u\n",
le32_to_cpu(ix->ei_block), le32_to_cpu(ix->ei_block),
le32_to_cpu(ix[-1].ei_block)); le32_to_cpu(ix[-1].ei_block));
} }
...@@ -2142,7 +2143,7 @@ void ext4_ext_init(struct super_block *sb) ...@@ -2142,7 +2143,7 @@ void ext4_ext_init(struct super_block *sb)
*/ */
if (test_opt(sb, EXTENTS)) { if (test_opt(sb, EXTENTS)) {
printk("EXT4-fs: file extents enabled"); printk(KERN_INFO "EXT4-fs: file extents enabled");
#ifdef AGGRESSIVE_TEST #ifdef AGGRESSIVE_TEST
printk(", aggressive tests"); printk(", aggressive tests");
#endif #endif
......
...@@ -170,17 +170,18 @@ void ext4_free_inode (handle_t *handle, struct inode * inode) ...@@ -170,17 +170,18 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
ext4_group_t flex_group; ext4_group_t flex_group;
if (atomic_read(&inode->i_count) > 1) { if (atomic_read(&inode->i_count) > 1) {
printk ("ext4_free_inode: inode has count=%d\n", printk(KERN_ERR "ext4_free_inode: inode has count=%d\n",
atomic_read(&inode->i_count)); atomic_read(&inode->i_count));
return; return;
} }
if (inode->i_nlink) { if (inode->i_nlink) {
printk ("ext4_free_inode: inode has nlink=%d\n", printk(KERN_ERR "ext4_free_inode: inode has nlink=%d\n",
inode->i_nlink); inode->i_nlink);
return; return;
} }
if (!sb) { if (!sb) {
printk("ext4_free_inode: inode on nonexistent device\n"); printk(KERN_ERR "ext4_free_inode: inode on "
"nonexistent device\n");
return; return;
} }
sbi = EXT4_SB(sb); sbi = EXT4_SB(sb);
...@@ -989,7 +990,8 @@ unsigned long ext4_count_free_inodes (struct super_block * sb) ...@@ -989,7 +990,8 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
bitmap_count += x; bitmap_count += x;
} }
brelse(bitmap_bh); brelse(bitmap_bh);
printk("ext4_count_free_inodes: stored = %u, computed = %lu, %lu\n", printk(KERN_DEBUG "ext4_count_free_inodes: "
"stored = %u, computed = %lu, %lu\n",
le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count); le32_to_cpu(es->s_free_inodes_count), desc_count, bitmap_count);
return desc_count; return desc_count;
#else #else
......
...@@ -477,8 +477,9 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap) ...@@ -477,8 +477,9 @@ static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap)
b2 = (unsigned char *) bitmap; b2 = (unsigned char *) bitmap;
for (i = 0; i < e4b->bd_sb->s_blocksize; i++) { for (i = 0; i < e4b->bd_sb->s_blocksize; i++) {
if (b1[i] != b2[i]) { if (b1[i] != b2[i]) {
printk("corruption in group %lu at byte %u(%u):" printk(KERN_ERR "corruption in group %lu "
" %x in copy != %x on disk/prealloc\n", "at byte %u(%u): %x in copy != %x "
"on disk/prealloc\n",
e4b->bd_group, i, i * 8, b1[i], b2[i]); e4b->bd_group, i, i * 8, b1[i], b2[i]);
BUG(); BUG();
} }
...@@ -2560,7 +2561,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery) ...@@ -2560,7 +2561,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
ext4_mb_init_per_dev_proc(sb); ext4_mb_init_per_dev_proc(sb);
ext4_mb_history_init(sb); ext4_mb_history_init(sb);
printk("EXT4-fs: mballoc enabled\n"); printk(KERN_INFO "EXT4-fs: mballoc enabled\n");
return 0; return 0;
} }
......
...@@ -254,12 +254,12 @@ static inline unsigned dx_node_limit (struct inode *dir) ...@@ -254,12 +254,12 @@ static inline unsigned dx_node_limit (struct inode *dir)
* Debug * Debug
*/ */
#ifdef DX_DEBUG #ifdef DX_DEBUG
static void dx_show_index (char * label, struct dx_entry *entries) static void dx_show_index(char * label, struct dx_entry *entries)
{ {
int i, n = dx_get_count (entries); int i, n = dx_get_count (entries);
printk("%s index ", label); printk(KERN_DEBUG "%s index ", label);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
printk("%x->%lu ", i? dx_get_hash(entries + i) : printk("%x->%lu ", i ? dx_get_hash(entries + i) :
0, (unsigned long)dx_get_block(entries + i)); 0, (unsigned long)dx_get_block(entries + i));
} }
printk("\n"); printk("\n");
...@@ -328,8 +328,9 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir, ...@@ -328,8 +328,9 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir,
brelse (bh); brelse (bh);
} }
if (bcount) if (bcount)
printk("%snames %u, fullness %u (%u%%)\n", levels?"":" ", printk(KERN_DEBUG "%snames %u, fullness %u (%u%%)\n",
names, space/bcount,(space/bcount)*100/blocksize); levels ? "" : " ", names, space/bcount,
(space/bcount)*100/blocksize);
return (struct stats) { names, space, bcount}; return (struct stats) { names, space, bcount};
} }
#endif /* DX_DEBUG */ #endif /* DX_DEBUG */
...@@ -635,8 +636,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash, ...@@ -635,8 +636,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
int ret, err; int ret, err;
__u32 hashval; __u32 hashval;
dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n",
start_minor_hash)); start_hash, start_minor_hash));
dir = dir_file->f_path.dentry->d_inode; dir = dir_file->f_path.dentry->d_inode;
if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) { if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) {
hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; 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,8 +695,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
break; break;
} }
dx_release(frames); dx_release(frames);
dxtrace(printk("Fill tree: returned %d entries, next hash: %x\n", dxtrace(printk(KERN_DEBUG "Fill tree: returned %d entries, "
count, *next_hash)); "next hash: %x\n", count, *next_hash));
return count; return count;
errout: errout:
dx_release(frames); dx_release(frames);
...@@ -882,7 +883,8 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry, ...@@ -882,7 +883,8 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
*/ */
if (bh || (err != ERR_BAD_DX_DIR)) if (bh || (err != ERR_BAD_DX_DIR))
return bh; return bh;
dxtrace(printk("ext4_find_entry: dx failed, falling back\n")); dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
"falling back\n"));
} }
nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
start = EXT4_I(dir)->i_dir_start_lookup; start = EXT4_I(dir)->i_dir_start_lookup;
...@@ -1025,7 +1027,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry, ...@@ -1025,7 +1027,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
*err = -ENOENT; *err = -ENOENT;
errout: errout:
dxtrace(printk("%s not found\n", name)); dxtrace(printk(KERN_DEBUG "%s not found\n", name));
dx_release (frames); dx_release (frames);
return NULL; return NULL;
} }
...@@ -1377,7 +1379,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, ...@@ -1377,7 +1379,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
struct fake_dirent *fde; struct fake_dirent *fde;
blocksize = dir->i_sb->s_blocksize; blocksize = dir->i_sb->s_blocksize;
dxtrace(printk("Creating index\n")); dxtrace(printk(KERN_DEBUG "Creating index\n"));
retval = ext4_journal_get_write_access(handle, bh); retval = ext4_journal_get_write_access(handle, bh);
if (retval) { if (retval) {
ext4_std_error(dir->i_sb, retval); ext4_std_error(dir->i_sb, retval);
...@@ -1527,7 +1529,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, ...@@ -1527,7 +1529,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
} }
/* Block full, should compress but for now just split */ /* Block full, should compress but for now just split */
dxtrace(printk("using %u of %u node entries\n", dxtrace(printk(KERN_DEBUG "using %u of %u node entries\n",
dx_get_count(entries), dx_get_limit(entries))); dx_get_count(entries), dx_get_limit(entries)));
/* Need to split index? */ /* Need to split index? */
if (dx_get_count(entries) == dx_get_limit(entries)) { 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,7 +1561,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
if (levels) { if (levels) {
unsigned icount1 = icount/2, icount2 = icount - icount1; unsigned icount1 = icount/2, icount2 = icount - icount1;
unsigned hash2 = dx_get_hash(entries + icount1); unsigned hash2 = dx_get_hash(entries + icount1);
dxtrace(printk("Split index %i/%i\n", icount1, icount2)); dxtrace(printk(KERN_DEBUG "Split index %i/%i\n",
icount1, icount2));
BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */ BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */
err = ext4_journal_get_write_access(handle, err = ext4_journal_get_write_access(handle,
...@@ -1588,7 +1591,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, ...@@ -1588,7 +1591,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
goto journal_error; goto journal_error;
brelse (bh2); brelse (bh2);
} else { } else {
dxtrace(printk("Creating second level index...\n")); dxtrace(printk(KERN_DEBUG
"Creating second level index...\n"));
memcpy((char *) entries2, (char *) entries, memcpy((char *) entries2, (char *) entries,
icount * sizeof(struct dx_entry)); icount * sizeof(struct dx_entry));
dx_set_limit(entries2, dx_node_limit(dir)); dx_set_limit(entries2, dx_node_limit(dir));
......
...@@ -981,7 +981,7 @@ static ext4_fsblk_t get_sb_block(void **data) ...@@ -981,7 +981,7 @@ static ext4_fsblk_t get_sb_block(void **data)
/*todo: use simple_strtoll with >32bit ext4 */ /*todo: use simple_strtoll with >32bit ext4 */
sb_block = simple_strtoul(options, &options, 0); sb_block = simple_strtoul(options, &options, 0);
if (*options && *options != ',') { if (*options && *options != ',') {
printk("EXT4-fs: Invalid sb specification: %s\n", printk(KERN_ERR "EXT4-fs: Invalid sb specification: %s\n",
(char *) *data); (char *) *data);
return 1; return 1;
} }
...@@ -1082,7 +1082,8 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1082,7 +1082,8 @@ static int parse_options(char *options, struct super_block *sb,
#else #else
case Opt_user_xattr: case Opt_user_xattr:
case Opt_nouser_xattr: case Opt_nouser_xattr:
printk("EXT4 (no)user_xattr options not supported\n"); printk(KERN_ERR "EXT4 (no)user_xattr options "
"not supported\n");
break; break;
#endif #endif
#ifdef CONFIG_EXT4DEV_FS_POSIX_ACL #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL
...@@ -1095,7 +1096,8 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1095,7 +1096,8 @@ static int parse_options(char *options, struct super_block *sb,
#else #else
case Opt_acl: case Opt_acl:
case Opt_noacl: case Opt_noacl:
printk("EXT4 (no)acl options not supported\n"); printk(KERN_ERR "EXT4 (no)acl options "
"not supported\n");
break; break;
#endif #endif
case Opt_reservation: case Opt_reservation:
...@@ -1473,14 +1475,14 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, ...@@ -1473,14 +1475,14 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
EXT4_INODES_PER_GROUP(sb), EXT4_INODES_PER_GROUP(sb),
sbi->s_mount_opt); sbi->s_mount_opt);
printk(KERN_INFO "EXT4 FS on %s, ", sb->s_id);
if (EXT4_SB(sb)->s_journal->j_inode == NULL) { if (EXT4_SB(sb)->s_journal->j_inode == NULL) {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
printk("external journal on %s\n", printk(KERN_INFO "EXT4 FS on %s, external journal on %s\n",
bdevname(EXT4_SB(sb)->s_journal->j_dev, b)); sb->s_id, bdevname(EXT4_SB(sb)->s_journal->j_dev, b));
} else { } else {
printk("internal journal\n"); printk(KERN_INFO "EXT4 FS on %s, internal journal\n",
sb->s_id);
} }
return res; return res;
} }
...@@ -2715,6 +2717,11 @@ static int ext4_load_journal(struct super_block *sb, ...@@ -2715,6 +2717,11 @@ static int ext4_load_journal(struct super_block *sb,
return -EINVAL; return -EINVAL;
} }
if (journal->j_flags & JBD2_BARRIER)
printk(KERN_INFO "EXT4-fs: barriers enabled\n");
else
printk(KERN_INFO "EXT4-fs: barriers disabled\n");
if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) { if (!really_read_only && test_opt(sb, UPDATE_JOURNAL)) {
err = jbd2_journal_update_format(journal); err = jbd2_journal_update_format(journal);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment