summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorAmit Engel <amit.engel@dell.com>2021-04-22 15:33:16 +0300
committerChristoph Hellwig <hch@lst.de>2021-06-03 10:29:26 +0300
commitf6e8bd59c4e84820fc5f6c404730ef872439548a (patch)
tree6c44155d41a8005adc62f4210acc883c62e97d3b /drivers/nvme
parentf1cf35e17ec308c0e76f55c6bccf84fff1a2d71a (diff)
downloadlinux-f6e8bd59c4e84820fc5f6c404730ef872439548a.tar.bz2
nvmet: move ka_work initialization to nvmet_alloc_ctrl
Initialize keep-alive work only once, as part of alloc_ctrl and not each time that nvmet_start_keep_alive_timer is being called Signed-off-by: Amit Engel <amit.engel@dell.com> Reviewed-by: Hou Pu <houpu.main@gmail.com>
Diffstat (limited to 'drivers/nvme')
-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 1853db38b682..4ae4bea6625d 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -412,7 +412,6 @@ void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl)
pr_debug("ctrl %d start keep-alive timer for %d secs\n",
ctrl->cntlid, ctrl->kato);
- INIT_DELAYED_WORK(&ctrl->ka_work, nvmet_keep_alive_timer);
schedule_delayed_work(&ctrl->ka_work, ctrl->kato * HZ);
}
@@ -1352,6 +1351,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
INIT_LIST_HEAD(&ctrl->async_events);
INIT_RADIX_TREE(&ctrl->p2p_ns_map, GFP_KERNEL);
INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler);
+ INIT_DELAYED_WORK(&ctrl->ka_work, nvmet_keep_alive_timer);
memcpy(ctrl->subsysnqn, subsysnqn, NVMF_NQN_SIZE);
memcpy(ctrl->hostnqn, hostnqn, NVMF_NQN_SIZE);