Commit 14cad666 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] register_disk() unexported

... now it can be done.  We also drop almost all arguments - there is only
one caller and everything is determined by the first argument.
parent 09d9ea9b
......@@ -85,8 +85,7 @@ static void add_gendisk(struct gendisk *gp)
void add_disk(struct gendisk *disk)
{
add_gendisk(disk);
register_disk(disk, mk_kdev(disk->major, disk->first_minor),
1<<disk->minor_shift, disk->fops, get_capacity(disk));
register_disk(disk);
}
EXPORT_SYMBOL(add_disk);
......
......@@ -393,26 +393,10 @@ static void devfs_remove_partitions(struct gendisk *dev)
#endif
}
/*
* This function will re-read the partition tables for a given device,
* and set things back up again. There are some important caveats,
* however. You must ensure that no one is using the device, and no one
* can start using the device while this function is being executed.
*
* Much of the cleanup from the old partition tables should have already been
* done
*/
void register_disk(struct gendisk *disk, kdev_t dev, unsigned minors,
struct block_device_operations *ops, long size)
/* Not exported, helper to add_disk(). */
void register_disk(struct gendisk *disk)
{
struct block_device *bdev;
if (!disk)
return;
set_capacity(disk, size);
if (disk->flags & GENHD_FL_CD)
devfs_create_cdrom(disk);
......@@ -421,10 +405,10 @@ void register_disk(struct gendisk *disk, kdev_t dev, unsigned minors,
return;
/* No such device (e.g., media were just removed) */
if (!size)
if (!get_capacity(disk))
return;
bdev = bdget(kdev_t_to_nr(dev));
bdev = bdget(MKDEV(disk->major, disk->first_minor));
if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0)
return;
check_partition(disk, bdev);
......
......@@ -286,7 +286,7 @@ struct sec_size {
extern struct sec_size * blk_sec[MAX_BLKDEV];
extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size);
extern void register_disk(struct gendisk *dev);
extern void generic_make_request(struct bio *bio);
extern inline request_queue_t *bdev_get_queue(struct block_device *bdev);
extern void blk_put_request(struct request *);
......
......@@ -343,7 +343,6 @@ EXPORT_SYMBOL(blkdev_open);
EXPORT_SYMBOL(blkdev_get);
EXPORT_SYMBOL(blkdev_put);
EXPORT_SYMBOL(ioctl_by_bdev);
EXPORT_SYMBOL(register_disk);
EXPORT_SYMBOL(read_dev_sector);
EXPORT_SYMBOL(init_buffer);
EXPORT_SYMBOL_GPL(generic_file_direct_IO);
......
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