md: factor out the rdev overlaps check from rdev_size_store
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2022 09:18:19 +0000 (11:18 +0200)
committerSong Liu <song@kernel.org>
Wed, 20 Jul 2022 05:39:01 +0000 (22:39 -0700)
commit93c12a1eb34e5faa64c2c60a72efa68dd497c069
tree27d2f4fa9250d641699ed690b087743ddb058ab2
parente7f238227528cae61806ad6ee2326e2db710ed60
md: factor out the rdev overlaps check from rdev_size_store

This splits the code into nicely readable chunks and also avoids
the refcount inc/dec manipulations.

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