Commit 1586553b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: restore original behavior of /proc/partition when there's no partition
  remove blk_register_filter and blk_unregister_filter in gendisk
parents 44e7ed39 ddef43a8
...@@ -223,6 +223,7 @@ int blk_register_filter(struct gendisk *disk) ...@@ -223,6 +223,7 @@ int blk_register_filter(struct gendisk *disk)
return 0; return 0;
} }
EXPORT_SYMBOL(blk_register_filter);
void blk_unregister_filter(struct gendisk *disk) void blk_unregister_filter(struct gendisk *disk)
{ {
...@@ -231,4 +232,4 @@ void blk_unregister_filter(struct gendisk *disk) ...@@ -231,4 +232,4 @@ void blk_unregister_filter(struct gendisk *disk)
kobject_put(&filter->kobj); kobject_put(&filter->kobj);
kobject_put(disk->holder_dir->parent); kobject_put(disk->holder_dir->parent);
} }
EXPORT_SYMBOL(blk_unregister_filter);
...@@ -190,7 +190,6 @@ void add_disk(struct gendisk *disk) ...@@ -190,7 +190,6 @@ void add_disk(struct gendisk *disk)
disk->minors, NULL, exact_match, exact_lock, disk); disk->minors, NULL, exact_match, exact_lock, disk);
register_disk(disk); register_disk(disk);
blk_register_queue(disk); blk_register_queue(disk);
blk_register_filter(disk);
bdi = &disk->queue->backing_dev_info; bdi = &disk->queue->backing_dev_info;
bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor)); bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor));
...@@ -203,7 +202,6 @@ EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */ ...@@ -203,7 +202,6 @@ EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */
void unlink_gendisk(struct gendisk *disk) void unlink_gendisk(struct gendisk *disk)
{ {
blk_unregister_filter(disk);
sysfs_remove_link(&disk->dev.kobj, "bdi"); sysfs_remove_link(&disk->dev.kobj, "bdi");
bdi_unregister(&disk->queue->backing_dev_info); bdi_unregister(&disk->queue->backing_dev_info);
blk_unregister_queue(disk); blk_unregister_queue(disk);
...@@ -309,7 +307,7 @@ static void *part_start(struct seq_file *part, loff_t *pos) ...@@ -309,7 +307,7 @@ static void *part_start(struct seq_file *part, loff_t *pos)
loff_t k = *pos; loff_t k = *pos;
if (!k) if (!k)
seq_puts(part, "major minor #blocks name\n\n"); part->private = (void *)1LU; /* tell show to print header */
mutex_lock(&block_class_lock); mutex_lock(&block_class_lock);
dev = class_find_device(&block_class, NULL, &k, find_start); dev = class_find_device(&block_class, NULL, &k, find_start);
...@@ -351,6 +349,17 @@ static int show_partition(struct seq_file *part, void *v) ...@@ -351,6 +349,17 @@ static int show_partition(struct seq_file *part, void *v)
int n; int n;
char buf[BDEVNAME_SIZE]; char buf[BDEVNAME_SIZE];
/*
* Print header if start told us to do. This is to preserve
* the original behavior of not printing header if no
* partition exists. This hackery will be removed later with
* class iteration clean up.
*/
if (part->private) {
seq_puts(part, "major minor #blocks name\n\n");
part->private = NULL;
}
/* Don't show non-partitionable removeable devices or empty devices */ /* Don't show non-partitionable removeable devices or empty devices */
if (!get_capacity(sgp) || if (!get_capacity(sgp) ||
(sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))) (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))
......
...@@ -1933,6 +1933,7 @@ static void ide_cd_remove(ide_drive_t *drive) ...@@ -1933,6 +1933,7 @@ static void ide_cd_remove(ide_drive_t *drive)
ide_proc_unregister_driver(drive, info->driver); ide_proc_unregister_driver(drive, info->driver);
blk_unregister_filter(info->disk);
del_gendisk(info->disk); del_gendisk(info->disk);
ide_cd_put(info); ide_cd_put(info);
...@@ -2158,6 +2159,7 @@ static int ide_cd_probe(ide_drive_t *drive) ...@@ -2158,6 +2159,7 @@ static int ide_cd_probe(ide_drive_t *drive)
g->fops = &idecd_ops; g->fops = &idecd_ops;
g->flags |= GENHD_FL_REMOVABLE; g->flags |= GENHD_FL_REMOVABLE;
add_disk(g); add_disk(g);
blk_register_filter(g);
return 0; return 0;
out_free_cd: out_free_cd:
......
...@@ -1875,6 +1875,7 @@ static int sd_probe(struct device *dev) ...@@ -1875,6 +1875,7 @@ static int sd_probe(struct device *dev)
dev_set_drvdata(dev, sdkp); dev_set_drvdata(dev, sdkp);
add_disk(gd); add_disk(gd);
blk_register_filter(gd);
sd_dif_config_host(sdkp); sd_dif_config_host(sdkp);
sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
...@@ -1908,6 +1909,7 @@ static int sd_remove(struct device *dev) ...@@ -1908,6 +1909,7 @@ static int sd_remove(struct device *dev)
struct scsi_disk *sdkp = dev_get_drvdata(dev); struct scsi_disk *sdkp = dev_get_drvdata(dev);
device_del(&sdkp->dev); device_del(&sdkp->dev);
blk_unregister_filter(sdkp->disk);
del_gendisk(sdkp->disk); del_gendisk(sdkp->disk);
sd_shutdown(dev); sd_shutdown(dev);
......
...@@ -656,6 +656,7 @@ static int sr_probe(struct device *dev) ...@@ -656,6 +656,7 @@ static int sr_probe(struct device *dev)
dev_set_drvdata(dev, cd); dev_set_drvdata(dev, cd);
disk->flags |= GENHD_FL_REMOVABLE; disk->flags |= GENHD_FL_REMOVABLE;
add_disk(disk); add_disk(disk);
blk_register_filter(disk);
sdev_printk(KERN_DEBUG, sdev, sdev_printk(KERN_DEBUG, sdev,
"Attached scsi CD-ROM %s\n", cd->cdi.name); "Attached scsi CD-ROM %s\n", cd->cdi.name);
...@@ -894,6 +895,7 @@ static int sr_remove(struct device *dev) ...@@ -894,6 +895,7 @@ static int sr_remove(struct device *dev)
{ {
struct scsi_cd *cd = dev_get_drvdata(dev); struct scsi_cd *cd = dev_get_drvdata(dev);
blk_unregister_filter(cd->disk);
del_gendisk(cd->disk); del_gendisk(cd->disk);
mutex_lock(&sr_ref_mutex); mutex_lock(&sr_ref_mutex);
......
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