]> www.infradead.org Git - users/hch/block.git/commitdiff
block: drop the duplicates check in elv_register
authorChristoph Hellwig <hch@lst.de>
Wed, 19 Oct 2022 14:43:07 +0000 (16:43 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 19 Oct 2022 15:57:04 +0000 (17:57 +0200)
We have less than a handful of elevators, and if someone adds a duplicate
one it simply will never be found but other be harmless.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/elevator.c

index bd71f0fc4e4b6725687da123cab3563a7370d18b..e208597238c5fb5bd7ca1d872a78a1ac42a36ae6 100644 (file)
@@ -553,13 +553,7 @@ int elv_register(struct elevator_type *e)
                        return -ENOMEM;
        }
 
-       /* register, don't allow duplicate names */
        spin_lock(&elv_list_lock);
-       if (elevator_find(e->elevator_name, 0)) {
-               spin_unlock(&elv_list_lock);
-               kmem_cache_destroy(e->icq_cache);
-               return -EBUSY;
-       }
        list_add_tail(&e->list, &elv_list);
        spin_unlock(&elv_list_lock);