OSDN Git Service

nvme: reduce checks for zero command effects
authorKanchan Joshi <joshi.k@samsung.com>
Mon, 8 Mar 2021 19:18:04 +0000 (00:48 +0530)
committerChristoph Hellwig <hch@lst.de>
Fri, 2 Apr 2021 16:48:26 +0000 (18:48 +0200)
For passthrough I/O commands, effects are usually to be zero.
nvme_passthrough_end() does three checks in futility for this case.
Bail out of function-call/checks.

Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c

index a565389..3bbaf48 100644 (file)
@@ -1137,7 +1137,8 @@ void nvme_execute_passthru_rq(struct request *rq)
 
        effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
        blk_execute_rq(disk, rq, 0);
-       nvme_passthru_end(ctrl, effects);
+       if (effects) /* nothing to be done for zero cmd effects */
+               nvme_passthru_end(ctrl, effects);
 }
 EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);