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 <israelr@mellanox.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
4d764bb9a9
commit
e522f44602
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue