[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190828215429.4572-14-logang@deltatee.com>
Date: Wed, 28 Aug 2019 15:54:29 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc: Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...com>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>,
Max Gurtovoy <maxg@...lanox.com>,
Stephen Bates <sbates@...thlin.com>,
Logan Gunthorpe <logang@...tatee.com>
Subject: [PATCH v8 13/13] nvmet-passthru: support block accounting
Support block disk accounting by setting the RQF_IO_STAT flag
and gendisk in the request.
After this change, IO counts will be reflected correctly in
/proc/diskstats for drives being used by passthru.
Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
---
drivers/nvme/target/io-cmd-passthru.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/target/io-cmd-passthru.c b/drivers/nvme/target/io-cmd-passthru.c
index 7557927a3451..63f12750a80d 100644
--- a/drivers/nvme/target/io-cmd-passthru.c
+++ b/drivers/nvme/target/io-cmd-passthru.c
@@ -410,6 +410,9 @@ static struct request *nvmet_passthru_blk_make_request(struct nvmet_req *req,
if (unlikely(IS_ERR(rq)))
return rq;
+ if (blk_queue_io_stat(q) && cmd->common.opcode != nvme_cmd_flush)
+ rq->rq_flags |= RQF_IO_STAT;
+
if (req->sg_cnt) {
ret = nvmet_passthru_map_sg(req, rq);
if (unlikely(ret)) {
@@ -474,7 +477,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
rq->end_io_data = req;
if (req->sq->qid != 0) {
- blk_execute_rq_nowait(rq->q, NULL, rq, 0,
+ blk_execute_rq_nowait(rq->q, ns->disk, rq, 0,
nvmet_passthru_req_done);
} else {
req->p.rq = rq;
--
2.20.1
Powered by blists - more mailing lists