From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Josef Bacik <josef@toxicpanda.com>
Subject: [PATCH v2 3/4] block: null_blk: Cleanup messages
Date: Wed, 20 Apr 2022 09:57:17 +0900 [thread overview]
Message-ID: <20220420005718.3780004-4-damien.lemoal@opensource.wdc.com> (raw)
In-Reply-To: <20220420005718.3780004-1-damien.lemoal@opensource.wdc.com>
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>
---
drivers/block/null_blk/main.c | 5 +++++
drivers/block/null_blk/zoned.c | 7 +++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 4d6bc94086da..7bc36d5114a9 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -11,6 +11,9 @@
#include <linux/init.h>
#include "null_blk.h"
+#undef pr_fmt
+#define pr_fmt(fmt) "null_blk: " fmt
+
#define FREE_BATCH 16
#define TICKS_PER_SEC 50ULL
@@ -2071,6 +2074,8 @@ static int null_add_dev(struct nullb_device *dev)
list_add_tail(&nullb->list, &nullb_list);
mutex_unlock(&lock);
+ pr_info("disk %s created\n", nullb->disk_name);
+
return 0;
out_cleanup_zone:
null_free_zoned_dev(dev);
diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index dae54dd1aeac..ed158ea4fdd1 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -6,6 +6,9 @@
#define CREATE_TRACE_POINTS
#include "trace.h"
+#undef pr_fmt
+#define pr_fmt(fmt) "null_blk: " fmt
+
static inline sector_t mb_to_sects(unsigned long mb)
{
return ((sector_t)mb * SZ_1M) >> SECTOR_SHIFT;
@@ -75,8 +78,8 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q)
dev->zone_capacity = dev->zone_size;
if (dev->zone_capacity > dev->zone_size) {
- pr_err("null_blk: zone capacity (%lu MB) larger than zone size (%lu MB)\n",
- dev->zone_capacity, dev->zone_size);
+ pr_err("zone capacity (%lu MB) larger than zone size (%lu MB)\n",
+ dev->zone_capacity, dev->zone_size);
return -EINVAL;
}
--
2.35.1
next prev parent reply other threads:[~2022-04-20 0:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 0:57 [PATCH v2 0/4] null_blk cleanup and device naming improvements Damien Le Moal
2022-04-20 0:57 ` [PATCH v2 1/4] block: null_blk: Fix code style issues Damien Le Moal
2022-04-20 3:51 ` Chaitanya Kulkarni
2022-04-20 7:56 ` Johannes Thumshirn
2022-04-20 0:57 ` [PATCH v2 2/4] block: null_blk: Cleanup device creation and deletion Damien Le Moal
2022-04-20 3:53 ` Chaitanya Kulkarni
2022-04-20 7:57 ` Johannes Thumshirn
2022-04-20 0:57 ` Damien Le Moal [this message]
2022-04-20 3:57 ` [PATCH v2 3/4] block: null_blk: Cleanup messages Chaitanya Kulkarni
2022-04-20 5:05 ` Damien Le Moal
2022-04-20 0:57 ` [PATCH v2 4/4] block: null_blk: Improve device creation with configfs Damien Le Moal
2022-04-20 7:58 ` Johannes Thumshirn
2022-05-03 20:03 ` [PATCH v2 0/4] null_blk cleanup and device naming improvements Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220420005718.3780004-4-damien.lemoal@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox