* [PATCH] nvme: refactor ns->ctrl by request
@ 2021-01-13 14:36 Minwoo Im
2021-01-13 22:13 ` Sagi Grimberg
2021-01-18 18:09 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Minwoo Im @ 2021-01-13 14:36 UTC (permalink / raw)
To: linux-nvme
Cc: Keith Busch, Jens Axboe, Minwoo Im, Christoph Hellwig,
Sagi Grimberg
Just for current code in nvme_cleanup_cmd(), we don't have to get
namespace instance, but we need controller instance.
Controller instance can be retrieved by namespace instance, but it can
be directly accessed by nvme_request instance from request.
ctrl = nvme_req(req)->ctrl;
We don't have to go around namespace instance from request instance
through gendisk.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
---
drivers/nvme/host/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index fff49e544fdf..c8da271a77d7 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -841,11 +841,11 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
void nvme_cleanup_cmd(struct request *req)
{
if (req->rq_flags & RQF_SPECIAL_PAYLOAD) {
- struct nvme_ns *ns = req->rq_disk->private_data;
+ struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
struct page *page = req->special_vec.bv_page;
- if (page == ns->ctrl->discard_page)
- clear_bit_unlock(0, &ns->ctrl->discard_page_busy);
+ if (page == ctrl->discard_page)
+ clear_bit_unlock(0, &ctrl->discard_page_busy);
else
kfree(page_address(page) + req->special_vec.bv_offset);
}
--
2.17.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] nvme: refactor ns->ctrl by request
2021-01-13 14:36 [PATCH] nvme: refactor ns->ctrl by request Minwoo Im
@ 2021-01-13 22:13 ` Sagi Grimberg
2021-01-18 18:09 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2021-01-13 22:13 UTC (permalink / raw)
To: Minwoo Im, linux-nvme; +Cc: Keith Busch, Jens Axboe, Christoph Hellwig
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: refactor ns->ctrl by request
2021-01-13 14:36 [PATCH] nvme: refactor ns->ctrl by request Minwoo Im
2021-01-13 22:13 ` Sagi Grimberg
@ 2021-01-18 18:09 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-01-18 18:09 UTC (permalink / raw)
To: Minwoo Im
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, linux-nvme,
Sagi Grimberg
Applied to nvme-5.12, thanks.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-18 18:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 14:36 [PATCH] nvme: refactor ns->ctrl by request Minwoo Im
2021-01-13 22:13 ` Sagi Grimberg
2021-01-18 18:09 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox