nvme: don't copy fill bio_vec if we don't have to
authorJens Axboe <axboe@kernel.dk>
Mon, 12 Dec 2022 23:53:18 +0000 (16:53 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 18 Dec 2022 18:20:05 +0000 (11:20 -0700)
commitc5c5ca0e1df1a40fc6a8caf91d9a22edb9486226
treec32ea0fe2ea71c58bd510a880b3d27d8ad007d0b
parenteed468ab1ce95e97ab1a707c6a309a8f16ce69d1
nvme: don't copy fill bio_vec if we don't have to

For the fast case, we haven't done any IO on the bio yet. Hence just check
and return a pointer to the inlined bio_vec, rather than copying it. In
profiles, this results in a nice reduction in overhead for
nvme_queue_rq():

     5.41%     -2.48%  [nvme]            [k] nvme_queue_rq

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c