From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-block@vger.kernel.org
Cc: axboe@kernel.dk, hch@lst.de,
Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH 1/8] null_blk: add module parameter for REQ_OP_DISCARD
Date: Thu, 11 Jul 2019 10:53:21 -0700 [thread overview]
Message-ID: <20190711175328.16430-2-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20190711175328.16430-1-chaitanya.kulkarni@wdc.com>
This patch adds a module parameter to configure the REQ_OP_DISCARD
handling support when null_blk module is not memory-backed. This support
is useful in the various scenarios such as examining REQ_OP_DISCARD path
tests, blktrace and discard with priorities.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
drivers/block/null_blk_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index 99328ded60d1..20d60b951622 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -3,6 +3,7 @@
* Add configfs and memory store: Kyungchan Koh <kkc6196@fb.com> and
* Shaohua Li <shli@fb.com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/moduleparam.h>
@@ -193,6 +194,10 @@ static unsigned int g_zone_nr_conv;
module_param_named(zone_nr_conv, g_zone_nr_conv, uint, 0444);
MODULE_PARM_DESC(zone_nr_conv, "Number of conventional zones when block device is zoned. Default: 0");
+static bool g_discard;
+module_param_named(discard, g_discard, bool, 0444);
+MODULE_PARM_DESC(discard, "Allow REQ_OP_DISCARD processing. Default: false");
+
static struct nullb_device *null_alloc_dev(void);
static void null_free_dev(struct nullb_device *dev);
static void null_del_dev(struct nullb *nullb);
@@ -529,6 +534,8 @@ static struct nullb_device *null_alloc_dev(void)
dev->zoned = g_zoned;
dev->zone_size = g_zone_size;
dev->zone_nr_conv = g_zone_nr_conv;
+ dev->discard = g_discard;
+ pr_info("discard : %s\n", dev->discard ? "TRUE" : "FALSE");
return dev;
}
--
2.17.0
next prev parent reply other threads:[~2019-07-11 17:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 17:53 [PATCH 0/8] null_blk: add missing write-zeroes and discard support Chaitanya Kulkarni
2019-07-11 17:53 ` Chaitanya Kulkarni [this message]
2019-07-28 6:04 ` [PATCH 1/8] null_blk: add module parameter for REQ_OP_DISCARD Minwoo Im
2019-07-30 4:48 ` Chaitanya Kulkarni
2019-07-11 17:53 ` [PATCH 2/8] null_blk: add REQ_OP_WRITE_ZEROES config property Chaitanya Kulkarni
2019-07-28 6:17 ` Minwoo Im
2019-07-11 17:53 ` [PATCH 3/8] null_blk: add support for write-zeroes Chaitanya Kulkarni
2019-07-28 6:08 ` Minwoo Im
2019-07-11 17:53 ` [PATCH 4/8] null_blk: allow memory-backed write-zeroes-req Chaitanya Kulkarni
2019-07-28 6:11 ` Minwoo Im
2019-07-11 17:53 ` [PATCH 5/8] null_blk: code cleaup Chaitanya Kulkarni
2019-07-28 6:12 ` Minwoo Im
2019-07-11 17:53 ` [PATCH 6/8] null_blk: allow memory-backed write-zeroes-bio Chaitanya Kulkarni
2019-07-28 6:18 ` Minwoo Im
2019-07-11 17:53 ` [PATCH 7/8] null_blk: add support for configfs write_zeroes Chaitanya Kulkarni
2019-07-11 17:53 ` [PATCH 8/8] null_blk: adjusts the code with latest changes Chaitanya Kulkarni
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=20190711175328.16430-2-chaitanya.kulkarni@wdc.com \
--to=chaitanya.kulkarni@wdc.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--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;
as well as URLs for NNTP newsgroup(s).