File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -2508,18 +2508,10 @@ static DEFINE_IDA(nvme_instance_ida);
2508
2508
2509
2509
static int nvme_set_instance (struct nvme_dev * dev )
2510
2510
{
2511
- int instance , error ;
2511
+ int instance ;
2512
2512
2513
- do {
2514
- if (!ida_pre_get (& nvme_instance_ida , GFP_KERNEL ))
2515
- return - ENODEV ;
2516
-
2517
- spin_lock (& dev_list_lock );
2518
- error = ida_get_new (& nvme_instance_ida , & instance );
2519
- spin_unlock (& dev_list_lock );
2520
- } while (error == - EAGAIN );
2521
-
2522
- if (error )
2513
+ instance = ida_simple_get (& nvme_instance_ida , 0 , 0 , GFP_KERNEL );
2514
+ if (instance < 0 )
2523
2515
return - ENODEV ;
2524
2516
2525
2517
dev -> instance = instance ;
@@ -2528,9 +2520,7 @@ static int nvme_set_instance(struct nvme_dev *dev)
2528
2520
2529
2521
static void nvme_release_instance (struct nvme_dev * dev )
2530
2522
{
2531
- spin_lock (& dev_list_lock );
2532
- ida_remove (& nvme_instance_ida , dev -> instance );
2533
- spin_unlock (& dev_list_lock );
2523
+ ida_simple_remove (& nvme_instance_ida , dev -> instance );
2534
2524
}
2535
2525
2536
2526
static void nvme_free_namespaces (struct nvme_dev * dev )
You can’t perform that action at this time.
0 commit comments