Skip to content

Commit 62e8557

Browse files
jeffmahoneykdave
authored andcommitted
btrfs: convert printk(KERN_* to use pr_* calls
This patch converts printk(KERN_* style messages to use the pr_* versions. One side effect is that anything that was KERN_DEBUG is now automatically a dynamic debug message. Signed-off-by: Jeff Mahoney <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 5d163e0 commit 62e8557

File tree

16 files changed

+205
-275
lines changed

16 files changed

+205
-275
lines changed

fs/btrfs/check-integrity.c

Lines changed: 106 additions & 166 deletions
Large diffs are not rendered by default.

fs/btrfs/compression.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,7 @@ void __init btrfs_init_compress(void)
783783
*/
784784
workspace = btrfs_compress_op[i]->alloc_workspace();
785785
if (IS_ERR(workspace)) {
786-
printk(KERN_WARNING
787-
"BTRFS: cannot preallocate compression workspace, will try later");
786+
pr_warn("BTRFS: cannot preallocate compression workspace, will try later\n");
788787
} else {
789788
atomic_set(&btrfs_comp_ws[i].total_ws, 1);
790789
btrfs_comp_ws[i].free_ws = 1;
@@ -854,8 +853,7 @@ static struct list_head *find_workspace(int type)
854853
/* no burst */ 1);
855854

856855
if (__ratelimit(&_rs)) {
857-
printk(KERN_WARNING
858-
"no compression workspaces, low memory, retrying");
856+
pr_warn("no compression workspaces, low memory, retrying\n");
859857
}
860858
}
861859
goto again;

fs/btrfs/ctree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4791,7 +4791,7 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
47914791
for (i = slot; i < nritems; i++) {
47924792
u32 ioff;
47934793

4794-
item = btrfs_item_nr( i);
4794+
item = btrfs_item_nr(i);
47954795
ioff = btrfs_token_item_offset(leaf, item, &token);
47964796
btrfs_set_token_item_offset(leaf, item,
47974797
ioff - total_data, &token);

fs/btrfs/ctree.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,13 +1435,13 @@ static inline void btrfs_init_map_token (struct btrfs_map_token *token)
14351435
#define cpu_to_le8(v) (v)
14361436
#define __le8 u8
14371437

1438-
#define read_eb_member(eb, ptr, type, member, result) ( \
1438+
#define read_eb_member(eb, ptr, type, member, result) (\
14391439
read_extent_buffer(eb, (char *)(result), \
14401440
((unsigned long)(ptr)) + \
14411441
offsetof(type, member), \
14421442
sizeof(((type *)0)->member)))
14431443

1444-
#define write_eb_member(eb, ptr, type, member, result) ( \
1444+
#define write_eb_member(eb, ptr, type, member, result) (\
14451445
write_extent_buffer(eb, (char *)(result), \
14461446
((unsigned long)(ptr)) + \
14471447
offsetof(type, member), \
@@ -3358,7 +3358,7 @@ do { \
33583358
btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
33593359
#else
33603360
#define btrfs_debug(fs_info, fmt, args...) \
3361-
no_printk(KERN_DEBUG fmt, ##args)
3361+
no_printk(KERN_DEBUG fmt, ##args)
33623362
#define btrfs_debug_in_rcu(fs_info, fmt, args...) \
33633363
no_printk(KERN_DEBUG fmt, ##args)
33643364
#define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \

fs/btrfs/disk-io.c

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static int btrfs_check_super_csum(char *raw_disk_sb)
427427
}
428428

429429
if (csum_type >= ARRAY_SIZE(btrfs_csum_sizes)) {
430-
printk(KERN_ERR "BTRFS: unsupported checksum algorithm %u\n",
430+
pr_err("BTRFS: unsupported checksum algorithm %u\n",
431431
csum_type);
432432
ret = 1;
433433
}
@@ -4114,24 +4114,24 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
41144114
int ret = 0;
41154115

41164116
if (btrfs_super_magic(sb) != BTRFS_MAGIC) {
4117-
printk(KERN_ERR "BTRFS: no valid FS found\n");
4117+
pr_err("BTRFS: no valid FS found\n");
41184118
ret = -EINVAL;
41194119
}
41204120
if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP)
4121-
printk(KERN_WARNING "BTRFS: unrecognized super flag: %llu\n",
4121+
pr_warn("BTRFS: unrecognized super flag: %llu\n",
41224122
btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP);
41234123
if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) {
4124-
printk(KERN_ERR "BTRFS: tree_root level too big: %d >= %d\n",
4124+
pr_err("BTRFS: tree_root level too big: %d >= %d\n",
41254125
btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);
41264126
ret = -EINVAL;
41274127
}
41284128
if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) {
4129-
printk(KERN_ERR "BTRFS: chunk_root level too big: %d >= %d\n",
4129+
pr_err("BTRFS: chunk_root level too big: %d >= %d\n",
41304130
btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL);
41314131
ret = -EINVAL;
41324132
}
41334133
if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) {
4134-
printk(KERN_ERR "BTRFS: log_root level too big: %d >= %d\n",
4134+
pr_err("BTRFS: log_root level too big: %d >= %d\n",
41354135
btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL);
41364136
ret = -EINVAL;
41374137
}
@@ -4142,46 +4142,46 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
41424142
*/
41434143
if (!is_power_of_2(sectorsize) || sectorsize < 4096 ||
41444144
sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) {
4145-
printk(KERN_ERR "BTRFS: invalid sectorsize %llu\n", sectorsize);
4145+
pr_err("BTRFS: invalid sectorsize %llu\n", sectorsize);
41464146
ret = -EINVAL;
41474147
}
41484148
/* Only PAGE SIZE is supported yet */
41494149
if (sectorsize != PAGE_SIZE) {
4150-
printk(KERN_ERR "BTRFS: sectorsize %llu not supported yet, only support %lu\n",
4150+
pr_err("BTRFS: sectorsize %llu not supported yet, only support %lu\n",
41514151
sectorsize, PAGE_SIZE);
41524152
ret = -EINVAL;
41534153
}
41544154
if (!is_power_of_2(nodesize) || nodesize < sectorsize ||
41554155
nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) {
4156-
printk(KERN_ERR "BTRFS: invalid nodesize %llu\n", nodesize);
4156+
pr_err("BTRFS: invalid nodesize %llu\n", nodesize);
41574157
ret = -EINVAL;
41584158
}
41594159
if (nodesize != le32_to_cpu(sb->__unused_leafsize)) {
4160-
printk(KERN_ERR "BTRFS: invalid leafsize %u, should be %llu\n",
4160+
pr_err("BTRFS: invalid leafsize %u, should be %llu\n",
41614161
le32_to_cpu(sb->__unused_leafsize),
41624162
nodesize);
41634163
ret = -EINVAL;
41644164
}
41654165

41664166
/* Root alignment check */
41674167
if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) {
4168-
printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n",
4168+
pr_warn("BTRFS: tree_root block unaligned: %llu\n",
41694169
btrfs_super_root(sb));
41704170
ret = -EINVAL;
41714171
}
41724172
if (!IS_ALIGNED(btrfs_super_chunk_root(sb), sectorsize)) {
4173-
printk(KERN_WARNING "BTRFS: chunk_root block unaligned: %llu\n",
4173+
pr_warn("BTRFS: chunk_root block unaligned: %llu\n",
41744174
btrfs_super_chunk_root(sb));
41754175
ret = -EINVAL;
41764176
}
41774177
if (!IS_ALIGNED(btrfs_super_log_root(sb), sectorsize)) {
4178-
printk(KERN_WARNING "BTRFS: log_root block unaligned: %llu\n",
4178+
pr_warn("BTRFS: log_root block unaligned: %llu\n",
41794179
btrfs_super_log_root(sb));
41804180
ret = -EINVAL;
41814181
}
41824182

41834183
if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) {
4184-
printk(KERN_ERR "BTRFS: dev_item UUID does not match fsid: %pU != %pU\n",
4184+
pr_err("BTRFS: dev_item UUID does not match fsid: %pU != %pU\n",
41854185
fs_info->fsid, sb->dev_item.fsid);
41864186
ret = -EINVAL;
41874187
}
@@ -4201,15 +4201,15 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
42014201
ret = -EINVAL;
42024202
}
42034203
if (btrfs_super_num_devices(sb) > (1UL << 31))
4204-
printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n",
4204+
pr_warn("BTRFS: suspicious number of devices: %llu\n",
42054205
btrfs_super_num_devices(sb));
42064206
if (btrfs_super_num_devices(sb) == 0) {
4207-
printk(KERN_ERR "BTRFS: number of devices is 0\n");
4207+
pr_err("BTRFS: number of devices is 0\n");
42084208
ret = -EINVAL;
42094209
}
42104210

42114211
if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) {
4212-
printk(KERN_ERR "BTRFS: super offset mismatch %llu != %u\n",
4212+
pr_err("BTRFS: super offset mismatch %llu != %u\n",
42134213
btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET);
42144214
ret = -EINVAL;
42154215
}
@@ -4219,14 +4219,14 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
42194219
* and one chunk
42204220
*/
42214221
if (btrfs_super_sys_array_size(sb) > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
4222-
printk(KERN_ERR "BTRFS: system chunk array too big %u > %u\n",
4222+
pr_err("BTRFS: system chunk array too big %u > %u\n",
42234223
btrfs_super_sys_array_size(sb),
42244224
BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
42254225
ret = -EINVAL;
42264226
}
42274227
if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key)
42284228
+ sizeof(struct btrfs_chunk)) {
4229-
printk(KERN_ERR "BTRFS: system chunk array too small %u < %zu\n",
4229+
pr_err("BTRFS: system chunk array too small %u < %zu\n",
42304230
btrfs_super_sys_array_size(sb),
42314231
sizeof(struct btrfs_disk_key)
42324232
+ sizeof(struct btrfs_chunk));
@@ -4238,13 +4238,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
42384238
* but it's still possible that it's the one that's wrong.
42394239
*/
42404240
if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb))
4241-
printk(KERN_WARNING
4242-
"BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
4241+
pr_warn("BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n",
42434242
btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb));
42444243
if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb)
42454244
&& btrfs_super_cache_generation(sb) != (u64)-1)
4246-
printk(KERN_WARNING
4247-
"BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
4245+
pr_warn("BTRFS: suspicious: generation < cache_generation: %llu < %llu\n",
42484246
btrfs_super_generation(sb), btrfs_super_cache_generation(sb));
42494247

42504248
return ret;

fs/btrfs/extent-tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7914,12 +7914,12 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
79147914
int index = 0;
79157915

79167916
spin_lock(&info->lock);
7917-
printk(KERN_INFO "BTRFS: space_info %llu has %llu free, is %sfull\n",
7917+
pr_info("BTRFS: space_info %llu has %llu free, is %sfull\n",
79187918
info->flags,
79197919
info->total_bytes - info->bytes_used - info->bytes_pinned -
79207920
info->bytes_reserved - info->bytes_readonly -
79217921
info->bytes_may_use, (info->full) ? "" : "not ");
7922-
printk(KERN_INFO "BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n",
7922+
pr_info("BTRFS: space_info total=%llu, used=%llu, pinned=%llu, reserved=%llu, may_use=%llu, readonly=%llu\n",
79237923
info->total_bytes, info->bytes_used, info->bytes_pinned,
79247924
info->bytes_reserved, info->bytes_may_use,
79257925
info->bytes_readonly);
@@ -7932,7 +7932,7 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
79327932
again:
79337933
list_for_each_entry(cache, &info->block_groups[index], list) {
79347934
spin_lock(&cache->lock);
7935-
printk(KERN_INFO "BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
7935+
pr_info("BTRFS: block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
79367936
cache->key.objectid, cache->key.offset,
79377937
btrfs_block_group_used(&cache->item), cache->pinned,
79387938
cache->reserved, cache->ro ? "[readonly]" : "");

fs/btrfs/extent_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void btrfs_leak_debug_check(void)
7575

7676
while (!list_empty(&buffers)) {
7777
eb = list_entry(buffers.next, struct extent_buffer, leak_list);
78-
printk(KERN_ERR "BTRFS: buffer leak start %llu len %lu refs %d\n",
78+
pr_err("BTRFS: buffer leak start %llu len %lu refs %d\n",
7979
eb->start, eb->len, atomic_read(&eb->refs));
8080
list_del(&eb->leak_list);
8181
kmem_cache_free(extent_buffer_cache, eb);
@@ -460,7 +460,7 @@ static int insert_state(struct extent_io_tree *tree,
460460
if (node) {
461461
struct extent_state *found;
462462
found = rb_entry(node, struct extent_state, rb_node);
463-
printk(KERN_ERR "BTRFS: found node %llu %llu on insert of %llu %llu\n",
463+
pr_err("BTRFS: found node %llu %llu on insert of %llu %llu\n",
464464
found->start, found->end, start, end);
465465
return -EEXIST;
466466
}

fs/btrfs/free-space-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ int __btrfs_add_free_space(struct btrfs_free_space_ctl *ctl,
23462346
spin_unlock(&ctl->tree_lock);
23472347

23482348
if (ret) {
2349-
printk(KERN_CRIT "BTRFS: unable to add free space :%d\n", ret);
2349+
pr_crit("BTRFS: unable to add free space :%d\n", ret);
23502350
ASSERT(ret != -EEXIST);
23512351
}
23522352

fs/btrfs/lzo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int lzo_compress_pages(struct list_head *ws,
141141
ret = lzo1x_1_compress(data_in, in_len, workspace->cbuf,
142142
&out_len, workspace->mem);
143143
if (ret != LZO_E_OK) {
144-
printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n",
144+
pr_debug("BTRFS: deflate in loop returned %d\n",
145145
ret);
146146
ret = -EIO;
147147
goto out;
@@ -356,7 +356,7 @@ static int lzo_decompress_biovec(struct list_head *ws,
356356
if (need_unmap)
357357
kunmap(pages_in[page_in_index - 1]);
358358
if (ret != LZO_E_OK) {
359-
printk(KERN_WARNING "BTRFS: decompress failed\n");
359+
pr_warn("BTRFS: decompress failed\n");
360360
ret = -EIO;
361361
break;
362362
}
@@ -402,7 +402,7 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
402402
out_len = PAGE_SIZE;
403403
ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
404404
if (ret != LZO_E_OK) {
405-
printk(KERN_WARNING "BTRFS: decompress failed!\n");
405+
pr_warn("BTRFS: decompress failed!\n");
406406
ret = -EIO;
407407
goto out;
408408
}

0 commit comments

Comments
 (0)