Commit e522f446 authored by Israel Rukshin's avatar Israel Rukshin Committed by Jens Axboe
Browse files

nvmet: add unlikely check at nvmet_req_alloc_sgl



The call to sgl_alloc shouldn't fail so add this simple optimization to
the fast path.

Signed-off-by: default avatarIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4d764bb9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -966,7 +966,7 @@ int nvmet_req_alloc_sgl(struct nvmet_req *req)
	}

	req->sg = sgl_alloc(req->transfer_len, GFP_KERNEL, &req->sg_cnt);
	if (!req->sg)
	if (unlikely(!req->sg))
		return -ENOMEM;

	return 0;