Skip to content

Commit

Permalink
nvmet: replace ida_simple[get|remove] with the simler ida_[alloc|free]
Browse files Browse the repository at this point in the history
ida_simple_[get|remove] are wrappers anyways.

Signed-off-by: Sagi Grimberg <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
sagigrimberg authored and Christoph Hellwig committed Feb 28, 2022
1 parent 3dd83f4 commit 22027a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvme/target/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
if (subsys->cntlid_min > subsys->cntlid_max)
goto out_free_sqs;

ret = ida_simple_get(&cntlid_ida,
ret = ida_alloc_range(&cntlid_ida,
subsys->cntlid_min, subsys->cntlid_max,
GFP_KERNEL);
if (ret < 0) {
Expand Down Expand Up @@ -1459,7 +1459,7 @@ static void nvmet_ctrl_free(struct kref *ref)
flush_work(&ctrl->async_event_work);
cancel_work_sync(&ctrl->fatal_err_work);

ida_simple_remove(&cntlid_ida, ctrl->cntlid);
ida_free(&cntlid_ida, ctrl->cntlid);

nvmet_async_events_free(ctrl);
kfree(ctrl->sqs);
Expand Down

0 comments on commit 22027a9

Please sign in to comment.