summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/core.c
diff options
context:
space:
mode:
authorChaitanya Kulkarni2018-11-19 22:35:30 +0100
committerJens Axboe2018-12-08 06:26:58 +0100
commitcb019da3dabf60d792f76a913540815f06abb1d7 (patch)
tree2af71cc0ebc72240ab30466e3437a0ba18b582d1 /drivers/nvme/target/core.c
parentnvmet-rdma: Add unlikely for response allocated check (diff)
downloadkernel-qcow2-linux-cb019da3dabf60d792f76a913540815f06abb1d7.tar.gz
kernel-qcow2-linux-cb019da3dabf60d792f76a913540815f06abb1d7.tar.xz
kernel-qcow2-linux-cb019da3dabf60d792f76a913540815f06abb1d7.zip
nvmet: use unlikely for req status check
This patch adds unlikely in the nvmet request completion path for the status check in the low level function __nvmet_req_complete. This is helpful in the scenario where host and target connection is working smoothly. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/core.c')
-rw-r--r--drivers/nvme/target/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 2df70010e9f2..e468100b9211 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -617,7 +617,7 @@ static void __nvmet_req_complete(struct nvmet_req *req, u16 status)
nvmet_update_sq_head(req);
req->rsp->sq_id = cpu_to_le16(req->sq->qid);
req->rsp->command_id = req->cmd->common.command_id;
- if (status)
+ if (unlikely(status))
nvmet_set_status(req, status);
if (req->ns)
nvmet_put_namespace(req->ns);