diff options
-rw-r--r-- | fs/super.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/super.c b/fs/super.c index dd23bf927fbc..f31ef824d069 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -682,7 +682,7 @@ void emergency_remount(void) | |||
682 | * filesystems which don't use real block-devices. -- jrs | 682 | * filesystems which don't use real block-devices. -- jrs |
683 | */ | 683 | */ |
684 | 684 | ||
685 | static DEFINE_IDR(unnamed_dev_idr); | 685 | static DEFINE_IDA(unnamed_dev_ida); |
686 | static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */ | 686 | static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */ |
687 | 687 | ||
688 | int set_anon_super(struct super_block *s, void *data) | 688 | int set_anon_super(struct super_block *s, void *data) |
@@ -691,10 +691,10 @@ int set_anon_super(struct super_block *s, void *data) | |||
691 | int error; | 691 | int error; |
692 | 692 | ||
693 | retry: | 693 | retry: |
694 | if (idr_pre_get(&unnamed_dev_idr, GFP_ATOMIC) == 0) | 694 | if (ida_pre_get(&unnamed_dev_ida, GFP_ATOMIC) == 0) |
695 | return -ENOMEM; | 695 | return -ENOMEM; |
696 | spin_lock(&unnamed_dev_lock); | 696 | spin_lock(&unnamed_dev_lock); |
697 | error = idr_get_new(&unnamed_dev_idr, NULL, &dev); | 697 | error = ida_get_new(&unnamed_dev_ida, &dev); |
698 | spin_unlock(&unnamed_dev_lock); | 698 | spin_unlock(&unnamed_dev_lock); |
699 | if (error == -EAGAIN) | 699 | if (error == -EAGAIN) |
700 | /* We raced and lost with another CPU. */ | 700 | /* We raced and lost with another CPU. */ |
@@ -704,7 +704,7 @@ int set_anon_super(struct super_block *s, void *data) | |||
704 | 704 | ||
705 | if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) { | 705 | if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) { |
706 | spin_lock(&unnamed_dev_lock); | 706 | spin_lock(&unnamed_dev_lock); |
707 | idr_remove(&unnamed_dev_idr, dev); | 707 | ida_remove(&unnamed_dev_ida, dev); |
708 | spin_unlock(&unnamed_dev_lock); | 708 | spin_unlock(&unnamed_dev_lock); |
709 | return -EMFILE; | 709 | return -EMFILE; |
710 | } | 710 | } |
@@ -720,7 +720,7 @@ void kill_anon_super(struct super_block *sb) | |||
720 | 720 | ||
721 | generic_shutdown_super(sb); | 721 | generic_shutdown_super(sb); |
722 | spin_lock(&unnamed_dev_lock); | 722 | spin_lock(&unnamed_dev_lock); |
723 | idr_remove(&unnamed_dev_idr, slot); | 723 | ida_remove(&unnamed_dev_ida, slot); |
724 | spin_unlock(&unnamed_dev_lock); | 724 | spin_unlock(&unnamed_dev_lock); |
725 | } | 725 | } |
726 | 726 | ||