Commit 32390780 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] /proc/paritions: omit removable media

From: Neil Brown <neilb@cse.unsw.edu.au>

If programs like mount use /proc/partitions to find filesystems based on
labels, then surely we want md devices in there as they often contain
filesystems.

If the problem is that mount-by-label takes forever with removable media
then surely the "right" approch is the following patch, and then actually
set this flag on the "floppy.c" device.  (It is already set for ide-floppy
and sd devices).
parent 62c10f9e
......@@ -4376,6 +4376,7 @@ int __init floppy_init(void)
/* to be cleaned up... */
disks[drive]->private_data = (void*)(long)drive;
disks[drive]->queue = floppy_queue;
disks[drive]->flags |= GENHD_FL_REMOVABLE;
add_disk(disks[drive]);
}
......
......@@ -260,8 +260,10 @@ static int show_partition(struct seq_file *part, void *v)
if (&sgp->kobj.entry == block_subsys.kset.list.next)
seq_puts(part, "major minor #blocks name\n\n");
/* Don't show non-partitionable devices or empty devices */
if (!get_capacity(sgp) || sgp->minors == 1)
/* Don't show non-partitionable removeable devices or empty devices */
if (!get_capacity(sgp) ||
(sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))
)
return 0;
/* show the full disk and all non-0 size partitions of it */
......
......@@ -3511,7 +3511,7 @@ static int ide_cdrom_attach (ide_drive_t *drive)
snprintf(g->devfs_name, sizeof(g->devfs_name),
"%s/cd", drive->devfs_name);
g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) {
struct cdrom_device_info *devinfo = &info->devinfo;
DRIVER(drive)->busy--;
......
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