OpenCloudOS-Kernel/drivers/nvme/target
Chaitanya Kulkarni 3a1f7c79ae nvmet: make nvmet_find_namespace() req based
The six callers of nvmet_find_namespace() duplicate the error log page
update and status setting code for each call on failure.

All callers are nvmet requests based functions, so we can pass req
to the nvmet_find_namesapce() & derive ctrl from req, that'll allow us
to update the error log page in nvmet_find_namespace(). Now that we
pass the request we can also get rid of the local variable in
nvmet_find_namespace() and use the req->ns and return the error code.

Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(),
centralize the error log page update for non allocated namesapces, and
return uniform error for non-allocated namespace.

The nvmet_find_namespace() takes nsid parameter which is from NVMe
commands structures such as get_log_page, identify, rw and common. All
these commands have same offset for the nsid field.

Derive nsid from req->cmd->common.nsid) & remove the extra parameter
from the nvmet_find_namespace().

Lastly now we associate the ns to the req parameter that we pass to the
nvmet_find_namespace(), rename nvmet_find_namespace() to
nvmet_req_find_ns().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-02-10 16:38:04 +01:00
..
Kconfig nvmet: fix a spelling mistake "incuding" -> "including" in Kconfig 2020-12-01 20:36:37 +01:00
Makefile nvmet: add passthru code to process commands 2020-07-29 07:45:21 +02:00
admin-cmd.c nvmet: make nvmet_find_namespace() req based 2021-02-10 16:38:04 +01:00
configfs.c nvmet: Fix nvmet_is_port_enabled indentation 2021-02-02 10:26:10 +01:00
core.c nvmet: make nvmet_find_namespace() req based 2021-02-10 16:38:04 +01:00
discovery.c nvmet: make sure discovery change log event is protected 2020-12-01 20:36:37 +01:00
fabrics-cmd.c nvmet: add metadata/T10-PI support 2020-05-27 07:12:40 +02:00
fc.c nvmet-fc: add a missing __rcu annotation to nvmet_fc_tgt_assoc.queues 2021-02-10 16:38:04 +01:00
fcloop.c nvme: constify static attribute_group structs 2021-02-02 10:26:10 +01:00
io-cmd-bdev.c nvmet: add lba to sect conversion helpers 2021-02-02 10:26:11 +01:00
io-cmd-file.c nvmet: rename nvmet_check_data_len to nvmet_check_transfer_len 2020-05-27 07:12:39 +02:00
loop.c for-5.11/drivers-2020-12-14 2020-12-16 13:09:32 -08:00
nvmet.h nvmet: make nvmet_find_namespace() req based 2021-02-10 16:38:04 +01:00
passthru.c block: remove unnecessary argument from blk_execute_rq_nowait 2021-01-24 21:52:39 -07:00
rdma.c nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY 2021-01-14 20:27:34 +01:00
tcp.c nvmet-tcp: fix potential race of tcp socket closing accept_work 2021-02-10 16:38:03 +01:00
trace.c nvmet: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvmet: fix a NULL pointer dereference when tracing the flush command 2020-10-27 10:02:50 +01:00