summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAlexander Viro <viro@math.psu.edu>2002-09-21 02:51:01 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-21 02:51:01 -0700
commit443ac9b2957964cc7a8a6442f3dec2a286a0e471 (patch)
tree0a48413f761ba749e657ff4388de54aaf580548a /include/linux
parentceb1ee4c055c9a0debecf2b1759b70ce65abf27d (diff)
[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...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/genhd.h4
1 files changed, 4 insertions, 0 deletions
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);