nvmet: use req->cmd directly in file-ns fast path
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 14 Jun 2021 01:58:47 +0000 (18:58 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jun 2021 13:51:20 +0000 (15:51 +0200)
The function nvmet_file_parse_io_cmd() is called from the fast path. The
local variable to that function cmd is only used once.

Remove the local variable and use req->cmd directly.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/io-cmd-file.c

index 7fdbdc496597d5304eb7f6938b5cc12f1d890507..1dd1a0fe2e819dbe6a1d4b5d071972bd35fda314 100644 (file)
@@ -385,9 +385,7 @@ static void nvmet_file_execute_write_zeroes(struct nvmet_req *req)
 
 u16 nvmet_file_parse_io_cmd(struct nvmet_req *req)
 {
-       struct nvme_command *cmd = req->cmd;
-
-       switch (cmd->common.opcode) {
+       switch (req->cmd->common.opcode) {
        case nvme_cmd_read:
        case nvme_cmd_write:
                req->execute = nvmet_file_execute_rw;