diff options
author | Israel Rukshin <israelr@mellanox.com> | 2019-10-13 19:57:33 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-04 10:56:40 -0700 |
commit | e522f446027845e3c8b563d021f37e8f3d30c9d9 (patch) | |
tree | b57f8130a283df55e0a775d49dccb0eee7f56c23 /drivers | |
parent | 4d764bb9a92bc63afc3befe36a0bedfddff1398a (diff) | |
download | linux-e522f446027845e3c8b563d021f37e8f3d30c9d9.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/target/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 3a67e244e568..6b39cfc6ade1 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; |