[PATCH 0/5] nvme: rework __nvme_submit_sync_cmd()
Hannes Reinecke
hare at suse.de
Thu Feb 9 06:38:15 PST 2023
Hi all,
as Jens and hch complained about the argument list to __nvme_submit_sync_cmd()
getting too long, here's now a patchset to clean things up.
The first patch is to split off nvme_alloc_request() from
__nvme_submit_sync_cmd(), which serves to reduce the number of arguments;
it's also a nice cleanup as this function can be utilized to replace some
open-coded versions.
Then a patch to allow blk_rq_map_kern() to accept a NULL pointer; that's
really trivial and simplifies caller handling.
The third one again is pretty simple, and moves the 'result' handling into
nvme_execute_rq(), rather than leave it with the caller.
And with that we can open-code __nvme_submit_sync_cmd() in the callers,
and drop the function altogether.
The last patch to allow for retries of the authentication commands is
then pretty simple.
As usual, comments and reviews are welcome.
Hannes Reinecke (5):
nvme: split __nvme_submit_sync_cmd()
block: make blk_rq_map_kern() to accept a NULL buffer
nvme: move result handling into nvme_execute_rq()
nvme: open-code __nvme_submit_sync_cmd()
nvme: retry authentication commands if DNR status bit is not set
block/blk-map.c | 2 +-
drivers/block/pktcdvd.c | 10 ++--
drivers/nvme/host/auth.c | 31 ++++++++---
drivers/nvme/host/core.c | 96 +++++++++++++++++++++-------------
drivers/nvme/host/fabrics.c | 62 +++++++++++++++++-----
drivers/nvme/host/ioctl.c | 5 +-
drivers/nvme/host/nvme.h | 9 ++--
drivers/nvme/host/pci.c | 8 ++-
drivers/nvme/target/passthru.c | 6 +--
drivers/scsi/scsi_ioctl.c | 8 ++-
drivers/scsi/scsi_lib.c | 11 ++--
11 files changed, 155 insertions(+), 93 deletions(-)
--
2.35.3
More information about the Linux-nvme
mailing list