From 443ac9b2957964cc7a8a6442f3dec2a286a0e471 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Sat, 21 Sep 2002 02:51:01 -0700 Subject: [PATCH] beginning of probe_disk() and gendisks for floppy That's a tricky one and large part of that stuff is temporary - it will be replaced as soon as we have gendisks for all block devices and get sane refcounting for gendisks. * we add per-major lists of gendisks; get_gendisk() looks into appropriate list instead of looking through the list of all gendisks. * we allow driver to override that search - it can call blk_set_probe(major, probe) and then gendisk will call probe(minor). blk_set_probe(major, NULL) restores the default behaviour. * floppy.c switched to use of gendisks; we have one gendisk per disk and let floppy_find(minor) return the right one. Note that final mechanism will involve a similar construction but floppy.c is actually the least interesting application - places where it will really play will include stuff like loading the right high-level driver when we open /dev/hdX, etc. And it won't be major-based... --- include/linux/genhd.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 8632a84676e0..33cfbe2f1108 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -81,6 +81,7 @@ struct gendisk { struct gendisk *next; struct block_device_operations *fops; sector_t capacity; + struct list_head list; int flags; int number; /* devfs crap */ @@ -260,6 +261,9 @@ char *disk_name (struct gendisk *hd, int part, char *buf); extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); extern void update_partition(struct gendisk *disk, int part); +/* will go away */ +extern void blk_set_probe(int major, struct gendisk *(p)(int)); + static inline unsigned int disk_index (kdev_t dev) { struct gendisk *g = get_gendisk(dev); -- cgit v1.2.3