提交 e522f446 编写于 作者: I Israel Rukshin 提交者: 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: NIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 4d764bb9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册