[PATCH] nvmet-passthru: Cleanup nvmet_passthru_map_sg()
Chaitanya Kulkarni
Chaitanya.Kulkarni at wdc.com
Tue Oct 13 20:25:58 EDT 2020
On 10/13/20 17:20, Logan Gunthorpe wrote:
>
> On 2020-10-13 6:16 p.m., Chaitanya Kulkarni wrote:
>> On 10/9/20 16:18, Logan Gunthorpe wrote:
>>> Clean up some confusing elements of nvmet_passthru_map_sg() by returning
>>> early if the request is greater than the maximum bio size. This allows
>>> us to drop the sg_cnt variable.
>>>
>>> This should not result in any functional change but makes the code
>>> clearer and more understandable. The original code allocated a truncated
>>> bio then would return EINVAL when bio_add_pc_page() filled that bio. The
>>> new code just returns EINVAL early if this would happen.
>>>
>>> Fixes: c1fef73f793b ("nvmet: add passthru code to process commands")
>>> Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
>>> Suggested-by: Douglas Gilbert <dgilbert at interlog.com>
>>> Cc: Christoph Hellwig <hch at lst.de>
>>> Cc: Sagi Grimberg <sagi at grimberg.me>
>>> Cc: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
>> why the prefix is nvmet-passthru ?
> Well that's the prefix I used in the first patch, which follows other
> similar conventions like nvmet-tcp, nvmet-fc, nvmet-rdma, nvmet-loop, etc.
>
> Logan
>
>
Those are transport types and passthru is a target backend.
I found this [1] in the git log, only one patch has that prefix.
The convention is to not add backend prefixes for target patches (see
bdev/file),
I'm not sure we want to start adding prefixes unless there is a specific
reason.
# git log --oneline drivers/nvme/target/passthru.c
dc1890b99602 nvmet: add passthru ZNS support
df8dd70a9db8 nvme: lift the file open code from nvme_ctrl_get_by_path
3a6b076168e2 (tag: nvme-5.9-2020-09-17) nvmet: get transport reference
for passthru ctrl
7ee51cf60a90 nvmet: call blk_mq_free_request() directly
a2138fd49467 nvmet: fix oops in pt cmd execution
4db69a3d7cfe nvmet: add ns tear down label for pt-cmd handling
0ceeab96ba59 nvmet-passthru: Reject commands with non-sgl flags set
ba76af676cd0 nvmet: Add passthru enable/disable helpers
c1fef73f793b nvmet: add passthru code to process commands
More information about the Linux-nvme
mailing list