lkml.org 
[lkml]   [2019]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH v9 12/12] 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@deltatee.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 c482e55f0fb8..37d06ebcbd0f 100644
    --- a/drivers/nvme/target/io-cmd-passthru.c
    +++ b/drivers/nvme/target/io-cmd-passthru.c
    @@ -413,6 +413,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))
    + rq->rq_flags |= RQF_IO_STAT;
    +
    if (req->sg_cnt) {
    ret = nvmet_passthru_map_sg(req, rq);
    if (unlikely(ret)) {
    @@ -477,7 +480,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
    \
     
     \ /
      Last update: 2019-10-09 21:51    [W:4.710 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site