From: Chaitanya Kulkarni Date: Mon, 19 Nov 2018 21:35:30 +0000 (-0800) Subject: nvmet: use unlikely for req status check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cb019da3dabf60d792f76a913540815f06abb1d7;p=linux.git 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 Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 2df70010e9f29..e468100b9211f 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);