nvmet: move ka_work initialization to nvmet_alloc_ctrl
Subsystems (2)
PATCH 1/1 nvmet: move ka_work initialization to nvmet_alloc_ctrl
From: Amit Engel <[email protected]>
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 <[email protected]>
--- drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/core.c +1 -1
@@ -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 ); }
@@ -1341,6 +1340,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 );
Signature · 7 lines
2.18.2 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 7 lines · On Thu, Apr 22, 2021 at 8:33 PM <[email protected]> wrote:
From: Amit Engel <[email protected]>
Initialize keep-alive work only once, as part of
alloc_ctrland not each time thatnvmet_start_keep_alive_timeris being calledSigned-off-by Amit Engel <[email protected]>
Looks good to me.
Reviewed-by Hou Pu <[email protected]>
Thanks,
Hou
Quoted 25 lines
--- drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nvme/target/core.c +1
-2@@ -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 ); }@@ -1341,6 +1340,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 ); --
Quoted 2 lines
2.18.2
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
AppliedThanks,
applied to nvme-5.14.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme