Commit b3152267 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (1/25) Unexporting helper functions

	wipe_partitions() and driverfs_register_partitions(..., 1) (i.e.
unregistering them) pulled into del_gendisk() and removed from callers.
grok_partitions() merged with register_disk().  devfs_register_partitions(),
grok_partitions() and wipe_partitions() not exported anymore.
parent 10162063
......@@ -742,7 +742,6 @@ static int revalidate_allvol(kdev_t dev)
for(i=0; i< NWD; i++) {
struct gendisk *disk = &hba[ctlr]->gendisk[i];
if (disk->major_name) {
wipe_partitions(mk_kdev(disk->major, disk->first_minor));
del_gendisk(disk);
disk->major_name = NULL;
}
......@@ -802,7 +801,6 @@ static int deregister_disk(int ctlr, int logvol)
/* invalidate the devices and deregister the disk */
if (disk->major_name) {
wipe_partitions(mk_kdev(disk->major, disk->first_minor));
del_gendisk(disk);
disk->major_name = NULL;
}
......
......@@ -1461,7 +1461,6 @@ static int revalidate_allvol(kdev_t dev)
struct gendisk *disk = ida_gendisk + ctlr*NWD + i;
if (!disk->major_name)
continue;
wipe_partitions(mk_kdev(disk->major, disk->first_minor));
del_gendisk(disk);
disk->major_name = NULL;
}
......
......@@ -77,17 +77,19 @@ EXPORT_SYMBOL(add_gendisk);
* with the kernel.
*/
void
del_gendisk(struct gendisk *gp)
del_gendisk(struct gendisk *disk)
{
struct gendisk **gpp;
struct gendisk **p;
wipe_partitions(mk_kdev(disk->major, disk->first_minor));
write_lock(&gendisk_lock);
for (gpp = &gendisk_head; *gpp; gpp = &((*gpp)->next))
if (*gpp == gp)
for (p = &gendisk_head; *p; p = &((*p)->next))
if (*p == disk)
break;
if (*gpp)
*gpp = (*gpp)->next;
if (*p)
*p = (*p)->next;
write_unlock(&gendisk_lock);
devfs_register_partitions(disk, disk->first_minor, 1);
}
EXPORT_SYMBOL(del_gendisk);
......
......@@ -1222,10 +1222,8 @@ void __exit mm_cleanup(void)
del_battery_timer();
for (i=0; i < num_cards ; i++) {
devfs_register_partitions(mm_gendisk + i, i<<MM_SHIFT, 1);
for (i=0; i < num_cards ; i++)
del_gendisk(mm_gendisk + i);
}
if (devfs_handle)
devfs_unregister(devfs_handle);
devfs_handle = NULL;
......
......@@ -737,7 +737,6 @@ static int i2ob_evt(void *dummy)
case I2O_EVT_IND_BSA_VOLUME_UNLOAD:
{
struct gendisk *p = &i2o_disk[unit>>4];
wipe_partitions(mk_kdev(MAJOR_NR, unit));
del_gendisk(p);
for(i = unit; i <= unit+15; i++)
blk_queue_max_sectors(i2ob_dev[i].req_queue, 0);
......@@ -1616,7 +1615,6 @@ void i2ob_del_device(struct i2o_controller *c, struct i2o_device *d)
* This will force errors when i2ob_get_queue() is called
* by the kenrel.
*/
wipe_partitions(mk_kdev(MAJOR_NR, unit));
del_gendisk(&i2o_disk[unit>>4]);
i2ob_dev[unit].req_queue = NULL;
for(i = unit; i <= unit+15; i++)
......
......@@ -1298,7 +1298,6 @@ static void ftl_notify_remove(struct mtd_info *mtd)
ftl_freepart(myparts[i]);
myparts[i]->state = 0;
wipe_partitions(mk_kdev(MAJOR_NR, i<<4));
del_gendisk(myparts[i]->disk);
kfree(myparts[i]->disk->name);
kfree(myparts[i]->disk);
......
......@@ -284,14 +284,6 @@ dasd_destroy_partitions(dasd_device_t * device)
if (disk == NULL)
return;
wipe_partitions(device->kdev);
/*
* This is confusing. The funcions is devfs_register_partitions
* but the 1 as third parameter makes it do an unregister...
* FIXME: there must be a better way to get rid of the devfs entries
*/
devfs_register_partitions(disk, minor(device->kdev), 1);
del_gendisk(disk);
}
......
......@@ -1426,9 +1426,6 @@ static void sd_detach(Scsi_Device * sdp)
sdkp->has_been_registered = 0;
dev = MKDEV_SD(dsk_nr);
driverfs_remove_partitions(sd_disks[dsk_nr], minor(dev));
wipe_partitions(dev);
devfs_register_partitions (sd_disks[dsk_nr], minor(dev), 1);
/* unregister_disk() */
del_gendisk(sd_disks[dsk_nr]);
}
sdp->attached--;
......
......@@ -414,18 +414,10 @@ void devfs_register_partitions (struct gendisk *dev, int minor, int unregister)
* done
*/
void register_disk(struct gendisk *gdev, kdev_t dev, unsigned minors,
void register_disk(struct gendisk *g, kdev_t dev, unsigned minors,
struct block_device_operations *ops, long size)
{
if (!gdev)
return;
grok_partitions(dev, size);
}
void grok_partitions(kdev_t dev, long size)
{
struct block_device *bdev;
struct gendisk *g = get_gendisk(dev);
struct hd_struct *p;
if (!g)
......
......@@ -281,7 +281,6 @@ struct sec_size {
extern struct sec_size * blk_sec[MAX_BLKDEV];
extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
extern void grok_partitions(kdev_t dev, long size);
extern int wipe_partitions(kdev_t dev);
extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size);
extern void check_partition(struct gendisk *disk, struct block_device *bdev);
......
......@@ -335,17 +335,14 @@ EXPORT_SYMBOL(blk_dev);
EXPORT_SYMBOL(bdev_read_only);
EXPORT_SYMBOL(set_device_ro);
EXPORT_SYMBOL(bmap);
EXPORT_SYMBOL(devfs_register_partitions);
EXPORT_SYMBOL(driverfs_remove_partitions);
EXPORT_SYMBOL(blkdev_open);
EXPORT_SYMBOL(blkdev_get);
EXPORT_SYMBOL(blkdev_put);
EXPORT_SYMBOL(ioctl_by_bdev);
EXPORT_SYMBOL(grok_partitions);
EXPORT_SYMBOL(register_disk);
EXPORT_SYMBOL(read_dev_sector);
EXPORT_SYMBOL(init_buffer);
EXPORT_SYMBOL(wipe_partitions);
EXPORT_SYMBOL_GPL(generic_file_direct_IO);
/* tty routines */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment