diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-01-05 09:28:18 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-01-10 07:42:31 +0100 |
commit | 55f5560d8c18fe33fc169f8d244a9247dcac7612 (patch) | |
tree | 041dc3780f1ced418067373914e71c2f18b62b8d /block | |
parent | libnvdimm, pmem: nvdimm_read_bytes() badblocks support (diff) | |
download | linux-55f5560d8c18fe33fc169f8d244a9247dcac7612.tar.xz linux-55f5560d8c18fe33fc169f8d244a9247dcac7612.zip |
block: kill disk_{check|set|clear|alloc}_badblocks
These actions are completely managed by a block driver or can use the
badblocks api directly.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/genhd.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/block/genhd.c b/block/genhd.c index aa38cd0a66c7..5aaeb2ad0fd3 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -506,16 +506,6 @@ static int exact_lock(dev_t devt, void *data) return 0; } -int disk_alloc_badblocks(struct gendisk *disk) -{ - disk->bb = kzalloc(sizeof(*(disk->bb)), GFP_KERNEL); - if (!disk->bb) - return -ENOMEM; - - return badblocks_init(disk->bb, 1); -} -EXPORT_SYMBOL(disk_alloc_badblocks); - static void register_disk(struct gendisk *disk) { struct device *ddev = disk_to_dev(disk); @@ -682,38 +672,6 @@ void del_gendisk(struct gendisk *disk) } EXPORT_SYMBOL(del_gendisk); -/* - * The gendisk usage of badblocks does not track acknowledgements for - * badblocks. We always assume they are acknowledged. - */ -int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors, - sector_t *first_bad, int *bad_sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_check(disk->bb, s, sectors, first_bad, bad_sectors); -} -EXPORT_SYMBOL(disk_check_badblocks); - -int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_set(disk->bb, s, sectors, 1); -} -EXPORT_SYMBOL(disk_set_badblocks); - -int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_clear(disk->bb, s, sectors); -} -EXPORT_SYMBOL(disk_clear_badblocks); - /* sysfs access to bad-blocks list. */ static ssize_t disk_badblocks_show(struct device *dev, struct device_attribute *attr, |