]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nvmet: use req->cmd directly in bdev-ns fast path
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 14 Jun 2021 01:58:46 +0000 (18:58 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jun 2021 13:51:20 +0000 (15:51 +0200)
The function nvmet_bdev_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-bdev.c

index f673679d258a6bc27bf7c4e2b188eb880b8b0525..5d998e5873d3f7f6e98ef90fde2d9d8451217e95 100644 (file)
@@ -429,9 +429,7 @@ static void nvmet_bdev_execute_write_zeroes(struct nvmet_req *req)
 
 u16 nvmet_bdev_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_bdev_execute_rw;