md: simplify md_open
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2022 09:18:24 +0000 (11:18 +0200)
committerSong Liu <song@kernel.org>
Wed, 20 Jul 2022 06:03:35 +0000 (23:03 -0700)
commit4500d5c1791058398698437d55dd6c24912e6067
tree67a1c6d05e65d316d64b9500d981ff9b0063d9de
parentd9406f31a96407754a05e1b6510b02684f622922
md: simplify md_open

Now that devices are on the all_mddevs list until the gendisk is freed,
there can't be any duplicates.  Remove the global list lookup and just
grab a reference.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md.c