diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-09-29 22:41:32 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-09-29 22:41:32 -0700 |
| commit | 02bf8fda08e10840cbf42716bf94e449d1486254 (patch) | |
| tree | 9f0c627c4e7d457f75a1159041033df76fc52da3 /include/linux | |
| parent | 780ad0f4b92d16fc1074193a250298795c9247e8 (diff) | |
[PATCH] get_gendisk() prototype change
get_gendisk() now takes dev_t (instead of kdev_t) and gets an additional
argument - int *part. Set to 0 for non-partitioned, partition number
for partititoned. Callers updated. Yes, I hate passing return values
that way ;-/ We need that since old "minor(dev) - disk->first_minor"
doesn't work for stuff with non-trivial numbers (e.g. floppy) and
get_gendisk() really has to return both gendisk and partition number.
Fortunately, amount of callers of gendisk() is about to drop RSN big way...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/genhd.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index cf6d72b21721..864cee147a82 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -95,7 +95,7 @@ struct gendisk { extern void add_disk(struct gendisk *disk); extern void del_gendisk(struct gendisk *gp); extern void unlink_gendisk(struct gendisk *gp); -extern struct gendisk *get_gendisk(kdev_t dev); +extern struct gendisk *get_gendisk(dev_t dev, int *part); static inline unsigned long get_start_sect(struct block_device *bdev) { return bdev->bd_offset; @@ -268,7 +268,8 @@ 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); + int part; + struct gendisk *g = get_gendisk(kdev_t_to_nr(dev), &part); return g ? (minor(dev) >> g->minor_shift) : 0; } |
