All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org,
	"Bart Van Assche" <bart.vanassche@sandisk.com>,
	"Christoph Hellwig" <hch@lst.de>,
	"Matias Bjørling" <m@bjorling.me>,
	"Adam Manzanares" <adam.manzanares@wdc.com>
Subject: [PATCH 2/5] null_blk: Use blk_init_request_from_bio() instead of open-coding it
Date: Tue, 18 Apr 2017 16:10:34 -0700	[thread overview]
Message-ID: <20170418231037.3968-3-bart.vanassche@sandisk.com> (raw)
In-Reply-To: <20170418231037.3968-1-bart.vanassche@sandisk.com>

This patch changes the behavior of the null_blk driver for the
LightNVM mode as follows:
* REQ_FAILFAST_MASK is set for read-ahead requests.
* If no I/O priority has been set in the bio, the I/O priority is
  copied from the I/O context.
* The rq_disk member is initialized if bio->bi_bdev != NULL.
* req->errors is initialized to zero.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matias Bjørling <m@bjorling.me>
Cc: Adam Manzanares <adam.manzanares@wdc.com>
---
 drivers/block/null_blk.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index f93906ff31e8..e79e3d24e229 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -443,14 +443,7 @@ static int null_lnvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
 	if (IS_ERR(rq))
 		return -ENOMEM;
 
-	rq->__sector = bio->bi_iter.bi_sector;
-	rq->ioprio = bio_prio(bio);
-
-	if (bio_has_data(bio))
-		rq->nr_phys_segments = bio_phys_segments(q, bio);
-
-	rq->__data_len = bio->bi_iter.bi_size;
-	rq->bio = rq->biotail = bio;
+	blk_init_request_from_bio(rq, bio);
 
 	rq->end_io_data = rqd;
 
-- 
2.12.2

  parent reply	other threads:[~2017-04-18 23:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 23:10 [PATCH 0/5] Reduce code duplication Bart Van Assche
2017-04-18 23:10 ` [PATCH 1/5] block: Export blk_init_request_from_bio() Bart Van Assche
2017-04-19  6:16   ` Christoph Hellwig
2017-04-18 23:10 ` Bart Van Assche [this message]
2017-04-19  6:18   ` [PATCH 2/5] null_blk: Use blk_init_request_from_bio() instead of open-coding it Christoph Hellwig
2017-04-18 23:10 ` [PATCH 3/5] lightnvm: " Bart Van Assche
2017-04-19  6:19   ` Christoph Hellwig
2017-04-18 23:10 ` [PATCH 4/5] block: Inline blk_rq_set_prio() Bart Van Assche
2017-04-19  6:20   ` Christoph Hellwig
2017-04-19 14:38     ` Jens Axboe
2017-04-19 15:54       ` Bart Van Assche
2017-04-18 23:10 ` [PATCH 5/5] block: Optimize ioprio_best() Bart Van Assche
2017-04-19  6:21   ` Christoph Hellwig

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=20170418231037.3968-3-bart.vanassche@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=adam.manzanares@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=m@bjorling.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.