Skip to content

Commit

Permalink
nvmet: call blk_mq_free_request() directly
Browse files Browse the repository at this point in the history
Instead of calling blk_put_request() which calls blk_mq_free_request(),
call blk_mq_free_request() directly for NVMeOF passthru. This is to
mainly avoid an extra function call in the completion path
nvmet_passthru_req_done().

Signed-off-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
ChaitanayaKulkarni authored and axboe committed Aug 21, 2020
1 parent a2138fd commit 7ee51cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/nvme/target/passthru.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static void nvmet_passthru_execute_cmd_work(struct work_struct *w)

req->cqe->result = nvme_req(rq)->result;
nvmet_req_complete(req, status);
blk_put_request(rq);
blk_mq_free_request(rq);
}

static void nvmet_passthru_req_done(struct request *rq,
Expand All @@ -175,7 +175,7 @@ static void nvmet_passthru_req_done(struct request *rq,

req->cqe->result = nvme_req(rq)->result;
nvmet_req_complete(req, nvme_req(rq)->status);
blk_put_request(rq);
blk_mq_free_request(rq);
}

static int nvmet_passthru_map_sg(struct nvmet_req *req, struct request *rq)
Expand Down Expand Up @@ -274,7 +274,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
return;

out_put_req:
blk_put_request(rq);
blk_mq_free_request(rq);
out_put_ns:
if (ns)
nvme_put_ns(ns);
Expand Down

0 comments on commit 7ee51cf

Please sign in to comment.