diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2020-10-16 16:19:05 -0600 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-10-22 15:28:02 +0200 |
commit | 5e063101ffacf7c14797f5185c58a967ca83c79f (patch) | |
tree | 9dd5d8300c7ec5af92fe15492027363d6ed7f370 /lib/test_meminit.c | |
parent | df06047d54276f73782c9d97882b305fca745d3f (diff) | |
download | lwn-5e063101ffacf7c14797f5185c58a967ca83c79f.tar.gz lwn-5e063101ffacf7c14797f5185c58a967ca83c79f.zip |
nvmet: cleanup nvmet_passthru_map_sg()
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@deltatee.com>
Suggested-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'lib/test_meminit.c')
0 files changed, 0 insertions, 0 deletions