diff options
author | Christoph Hellwig <hch@lst.de> | 2022-11-29 16:32:55 +0300 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2022-12-02 22:21:01 +0300 |
commit | b5c1acf012a7a73e3d0c5c3605ececcca6797267 (patch) | |
tree | 4686f13932ba3a6712d20ea4a7f69c05ceaae7af /drivers/md | |
parent | d57d9d6965502fd0ca95f17180d655f6dc196002 (diff) | |
download | linux-b5c1acf012a7a73e3d0c5c3605ececcca6797267.tar.xz |
md: fold unbind_rdev_from_array into md_kick_rdev_from_array
unbind_rdev_from_array is only called from md_kick_rdev_from_array, so
merge it into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 94adb4039465..775f1dde190a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2468,7 +2468,22 @@ static void rdev_delayed_delete(struct work_struct *ws) kobject_put(&rdev->kobj); } -static void unbind_rdev_from_array(struct md_rdev *rdev) +void md_autodetect_dev(dev_t dev); + +static void export_rdev(struct md_rdev *rdev) +{ + pr_debug("md: export_rdev(%pg)\n", rdev->bdev); + md_rdev_clear(rdev); +#ifndef MODULE + if (test_bit(AutoDetected, &rdev->flags)) + md_autodetect_dev(rdev->bdev->bd_dev); +#endif + blkdev_put(rdev->bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); + rdev->bdev = NULL; + kobject_put(&rdev->kobj); +} + +static void md_kick_rdev_from_array(struct md_rdev *rdev) { bd_unlink_disk_holder(rdev->bdev, rdev->mddev->gendisk); list_del_rcu(&rdev->same_set); @@ -2491,26 +2506,6 @@ static void unbind_rdev_from_array(struct md_rdev *rdev) INIT_WORK(&rdev->del_work, rdev_delayed_delete); kobject_get(&rdev->kobj); queue_work(md_rdev_misc_wq, &rdev->del_work); -} - -void md_autodetect_dev(dev_t dev); - -static void export_rdev(struct md_rdev *rdev) -{ - pr_debug("md: export_rdev(%pg)\n", rdev->bdev); - md_rdev_clear(rdev); -#ifndef MODULE - if (test_bit(AutoDetected, &rdev->flags)) - md_autodetect_dev(rdev->bdev->bd_dev); -#endif - blkdev_put(rdev->bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); - rdev->bdev = NULL; - kobject_put(&rdev->kobj); -} - -static void md_kick_rdev_from_array(struct md_rdev *rdev) -{ - unbind_rdev_from_array(rdev); export_rdev(rdev); } |