md: refactor mddev_find_or_alloc
authorChristoph Hellwig <hch@lst.de>
Mon, 12 Apr 2021 08:05:29 +0000 (10:05 +0200)
committerSong Liu <song@kernel.org>
Thu, 15 Apr 2021 18:06:32 +0000 (11:06 -0700)
commitd144fe6ff176d79efd411e520103a99e11874c36
tree9e3b39fbce20c5f69c28cd6fd230847e659ab094
parent85c8c3c1f8d9e31f626c93435dd91c2f85603e07
md: refactor mddev_find_or_alloc

Allocate the new mddev first speculatively, which greatly simplifies
the code flow.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md.c