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);
}
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,
extern void del_gendisk(struct gendisk *gp);
extern struct gendisk *get_gendisk(dev_t dev, int *partno);
extern struct block_device *bdget_disk(struct gendisk *disk, int partno);
-int disk_alloc_badblocks(struct gendisk *disk);
-extern int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors,
- sector_t *first_bad, int *bad_sectors);
-extern int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors);
-extern int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors);
extern void set_device_ro(struct block_device *bdev, int flag);
extern void set_disk_ro(struct gendisk *disk, int flag);