diff options
| author | Christoph Hellwig <[email protected]> | 2023-06-01 09:44:47 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2023-06-05 16:53:04 +0000 |
| commit | 66fddc25fe182fd7d28b35f4173113f3eefc7fb5 (patch) | |
| tree | 0387d23284b30543a0bc40810a06bd0c9680d12e /fs/btrfs/dev-replace.c | |
| parent | block: turn bdev_lock into a mutex (diff) | |
| download | kernel-66fddc25fe182fd7d28b35f4173113f3eefc7fb5.tar.gz kernel-66fddc25fe182fd7d28b35f4173113f3eefc7fb5.zip | |
block: consolidate the shutdown logic in blk_mark_disk_dead and del_gendisk
blk_mark_disk_dead does very similar work a a section of del_gendisk:
- set the GD_DEAD flag
- set the capacity to zero
- start a queue drain
but del_gendisk also sets QUEUE_FLAG_DYING on the queue if it is owned by
the disk, sets the capacity to zero before starting the drain, and both
with sending a uevent and kernel message for this fake capacity change.
Move the exact logic from the more heavily used del_gendisk into
blk_mark_disk_dead and then call blk_mark_disk_dead from del_gendisk.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Acked-by: Dave Chinner <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
