diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-09-07 03:05:14 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-07 03:05:14 -0700 |
| commit | e86a37861c8a0830d7410bf9ebe5ebaf5f6adc7f (patch) | |
| tree | 9441ca4833309bbf6acc94fea3082184476a396d /include/linux/genhd.h | |
| parent | 3708de94cf8d66e46d5ab7d712da81684ff99bf7 (diff) | |
[PATCH] (25/25) more cleanups of struct gendisk.
* we remove the paritition 0 from ->part[] and put the old
contents of ->part[0] into gendisk itself; indexes are shifted, obviously.
* ->part is allocated at add_gendisk() time and freed at del_gendisk()
according to value of ->minor_shift; static arrays of hd_struct are gone
from drivers, ditto for manual allocations a-la ide. As the matter of fact,
none of the drivers know about struct hd_struct now.
Diffstat (limited to 'include/linux/genhd.h')
| -rw-r--r-- | include/linux/genhd.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 0bd31339d6f5..ecd747fbe569 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -79,11 +79,14 @@ struct gendisk { struct hd_struct *part; /* [indexed by minor] */ struct gendisk *next; struct block_device_operations *fops; + sector_t capacity; - devfs_handle_t de; - struct device *driverfs_dev; int flags; int number; /* devfs crap */ + devfs_handle_t de; /* more of the same */ + devfs_handle_t disk_de; /* piled higher and deeper */ + struct device *driverfs_dev; + struct device disk_dev; }; /* drivers/block/genhd.c */ @@ -97,11 +100,11 @@ static inline unsigned long get_start_sect(struct block_device *bdev) } static inline sector_t get_capacity(struct gendisk *disk) { - return disk->part[0].nr_sects; + return disk->capacity; } static inline void set_capacity(struct gendisk *disk, sector_t size) { - disk->part[0].nr_sects = size; + disk->capacity = size; } #endif /* __KERNEL__ */ |
