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

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
...@@ -966,7 +966,7 @@ int nvmet_req_alloc_sgl(struct nvmet_req *req) ...@@ -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); req->sg = sgl_alloc(req->transfer_len, GFP_KERNEL, &req->sg_cnt);
if (!req->sg) if (unlikely(!req->sg))
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment