Skip to content

Commit

Permalink
dasd: use bdev_disk_changed instead of blk_drop_partitions
Browse files Browse the repository at this point in the history
Use the more general interface - the behavior is the same except
that now a change uevent is sent, which is the right thing to do
when the device becomes unusable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20210406062303.811835-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Apr 8, 2021
1 parent 540ad3f commit b896fa8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions block/partitions/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,6 @@ int blk_drop_partitions(struct block_device *bdev)

return 0;
}
#ifdef CONFIG_S390
/* for historic reasons in the DASD driver */
EXPORT_SYMBOL_GPL(blk_drop_partitions);
#endif

static bool blk_add_partition(struct gendisk *disk, struct block_device *bdev,
struct parsed_partitions *state, int p)
Expand Down
3 changes: 1 addition & 2 deletions drivers/s390/block/dasd_genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ void dasd_destroy_partitions(struct dasd_block *block)
block->bdev = NULL;

mutex_lock(&bdev->bd_mutex);
blk_drop_partitions(bdev);
bdev_disk_changed(bdev, true);
mutex_unlock(&bdev->bd_mutex);

/* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */
blkdev_put(bdev, FMODE_READ);
set_capacity(block->gdp, 0);
}

int dasd_gendisk_init(void)
Expand Down

0 comments on commit b896fa8

Please sign in to comment.