Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: null_blk: Cleanup messages

Use the pr_fmt() macro to prefix all null_blk pr_xxx() messages with
"null_blk:" to clarify which module is printing the messages. Also add
a pr_info() message in null_add_dev() to print the name of a newly
created disk.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220420005718.3780004-4-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
db060f54 b3a0a73e

+10 -2
+5
drivers/block/null_blk/main.c
··· 11 11 #include <linux/init.h> 12 12 #include "null_blk.h" 13 13 14 + #undef pr_fmt 15 + #define pr_fmt(fmt) "null_blk: " fmt 16 + 14 17 #define FREE_BATCH 16 15 18 16 19 #define TICKS_PER_SEC 50ULL ··· 2071 2068 mutex_lock(&lock); 2072 2069 list_add_tail(&nullb->list, &nullb_list); 2073 2070 mutex_unlock(&lock); 2071 + 2072 + pr_info("disk %s created\n", nullb->disk_name); 2074 2073 2075 2074 return 0; 2076 2075 out_cleanup_zone:
+5 -2
drivers/block/null_blk/zoned.c
··· 6 6 #define CREATE_TRACE_POINTS 7 7 #include "trace.h" 8 8 9 + #undef pr_fmt 10 + #define pr_fmt(fmt) "null_blk: " fmt 11 + 9 12 static inline sector_t mb_to_sects(unsigned long mb) 10 13 { 11 14 return ((sector_t)mb * SZ_1M) >> SECTOR_SHIFT; ··· 78 75 dev->zone_capacity = dev->zone_size; 79 76 80 77 if (dev->zone_capacity > dev->zone_size) { 81 - pr_err("null_blk: zone capacity (%lu MB) larger than zone size (%lu MB)\n", 82 - dev->zone_capacity, dev->zone_size); 78 + pr_err("zone capacity (%lu MB) larger than zone size (%lu MB)\n", 79 + dev->zone_capacity, dev->zone_size); 83 80 return -EINVAL; 84 81 } 85 82