Skip to content

Commit d74f3d2

Browse files
JoePerchestytso
authored andcommitted
ext4: add missing KERN_CONT to a few more debugging uses
Recent commits require line continuing printks to always use pr_cont or KERN_CONT. Add these markings to a few more printks. Miscellaneaous: o Integrate the ea_idebug and ea_bdebug macros to use a single call to printk(KERN_DEBUG instead of 3 separate printks o Use the more common varargs macro style Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
1 parent 8906a82 commit d74f3d2

4 files changed

Lines changed: 26 additions & 31 deletions

File tree

fs/ext4/block_validity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ static void debug_print_tree(struct ext4_sb_info *sbi)
128128
node = rb_first(&sbi->system_blks);
129129
while (node) {
130130
entry = rb_entry(node, struct ext4_system_zone, node);
131-
printk("%s%llu-%llu", first ? "" : ", ",
131+
printk(KERN_CONT "%s%llu-%llu", first ? "" : ", ",
132132
entry->start_blk, entry->start_blk + entry->count - 1);
133133
first = 0;
134134
node = rb_next(node);
135135
}
136-
printk("\n");
136+
printk(KERN_CONT "\n");
137137
}
138138

139139
int ext4_setup_system_zone(struct super_block *sb)

fs/ext4/mballoc.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@
2727
#ifdef CONFIG_EXT4_DEBUG
2828
extern ushort ext4_mballoc_debug;
2929

30-
#define mb_debug(n, fmt, a...) \
31-
do { \
32-
if ((n) <= ext4_mballoc_debug) { \
33-
printk(KERN_DEBUG "(%s, %d): %s: ", \
34-
__FILE__, __LINE__, __func__); \
35-
printk(fmt, ## a); \
36-
} \
37-
} while (0)
30+
#define mb_debug(n, fmt, ...) \
31+
do { \
32+
if ((n) <= ext4_mballoc_debug) { \
33+
printk(KERN_DEBUG "(%s, %d): %s: " fmt, \
34+
__FILE__, __LINE__, __func__, ##__VA_ARGS__); \
35+
} \
36+
} while (0)
3837
#else
39-
#define mb_debug(n, fmt, a...) no_printk(fmt, ## a)
38+
#define mb_debug(n, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
4039
#endif
4140

4241
#define EXT4_MB_HISTORY_ALLOC 1 /* allocation */

fs/ext4/namei.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,13 @@ static inline unsigned dx_node_limit(struct inode *dir)
577577
static void dx_show_index(char * label, struct dx_entry *entries)
578578
{
579579
int i, n = dx_get_count (entries);
580-
printk(KERN_DEBUG "%s index ", label);
580+
printk(KERN_DEBUG "%s index", label);
581581
for (i = 0; i < n; i++) {
582-
printk("%x->%lu ", i ? dx_get_hash(entries + i) :
583-
0, (unsigned long)dx_get_block(entries + i));
582+
printk(KERN_CONT " %x->%lu",
583+
i ? dx_get_hash(entries + i) : 0,
584+
(unsigned long)dx_get_block(entries + i));
584585
}
585-
printk("\n");
586+
printk(KERN_CONT "\n");
586587
}
587588

588589
struct stats
@@ -679,7 +680,7 @@ static struct stats dx_show_leaf(struct inode *dir,
679680
}
680681
de = ext4_next_entry(de, size);
681682
}
682-
printk("(%i)\n", names);
683+
printk(KERN_CONT "(%i)\n", names);
683684
return (struct stats) { names, space, 1 };
684685
}
685686

@@ -798,7 +799,7 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
798799
q = entries + count - 1;
799800
while (p <= q) {
800801
m = p + (q - p) / 2;
801-
dxtrace(printk("."));
802+
dxtrace(printk(KERN_CONT "."));
802803
if (dx_get_hash(m) > hash)
803804
q = m - 1;
804805
else
@@ -810,7 +811,7 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
810811
at = entries;
811812
while (n--)
812813
{
813-
dxtrace(printk(","));
814+
dxtrace(printk(KERN_CONT ","));
814815
if (dx_get_hash(++at) > hash)
815816
{
816817
at--;
@@ -821,7 +822,8 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
821822
}
822823

823824
at = p - 1;
824-
dxtrace(printk(" %x->%u\n", at == entries ? 0 : dx_get_hash(at),
825+
dxtrace(printk(KERN_CONT " %x->%u\n",
826+
at == entries ? 0 : dx_get_hash(at),
825827
dx_get_block(at)));
826828
frame->entries = entries;
827829
frame->at = at;

fs/ext4/xattr.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,12 @@
6161
#include "acl.h"
6262

6363
#ifdef EXT4_XATTR_DEBUG
64-
# define ea_idebug(inode, f...) do { \
65-
printk(KERN_DEBUG "inode %s:%lu: ", \
66-
inode->i_sb->s_id, inode->i_ino); \
67-
printk(f); \
68-
printk("\n"); \
69-
} while (0)
70-
# define ea_bdebug(bh, f...) do { \
71-
printk(KERN_DEBUG "block %pg:%lu: ", \
72-
bh->b_bdev, (unsigned long) bh->b_blocknr); \
73-
printk(f); \
74-
printk("\n"); \
75-
} while (0)
64+
# define ea_idebug(inode, fmt, ...) \
65+
printk(KERN_DEBUG "inode %s:%lu: " fmt "\n", \
66+
inode->i_sb->s_id, inode->i_ino, ##__VA_ARGS__)
67+
# define ea_bdebug(bh, fmt, ...) \
68+
printk(KERN_DEBUG "block %pg:%lu: " fmt "\n", \
69+
bh->b_bdev, (unsigned long)bh->b_blocknr, ##__VA_ARGS__)
7670
#else
7771
# define ea_idebug(inode, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
7872
# define ea_bdebug(bh, fmt, ...) no_printk(fmt, ##__VA_ARGS__)

0 commit comments

Comments
 (0)