From: Israel Rukshin Date: Sun, 13 Oct 2019 16:57:33 +0000 (+0300) Subject: nvmet: add unlikely check at nvmet_req_alloc_sgl X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e522f446027845e3c8b563d021f37e8f3d30c9d9;p=linux.git 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: Israel Rukshin Reviewed-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 3a67e244e5685..6b39cfc6ade19 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -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;