diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-10-15 04:25:18 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-15 04:25:18 -0700 |
| commit | afae25b7c8d594f6349e81dce2b16ce44aa9f0ed (patch) | |
| tree | d76844b0077d72718f919c4394b24aac6ffd8c5a /include/linux | |
| parent | c6973580141ce5a4904436b29c0dc5f3d9982951 (diff) | |
[PATCH] preparation to use of driverfs refcounts, part 1 - partitions
* update_partition() split into add_partition() and delete_partition().
* all updating of ->part[] is switched to these two (including initial
filling/final cleaning).
* per-partition devices are allocated on-demand and never reused.
We allocate struct device in add_partition() and put reference to it into
hd_struct. ->release() for that struct device frees it. delete_partition()
removes reference from hd_struct and does put_device() on it. Basically,
we get rid of problems with reused struct device by never reusing them...
At that point devices for partitions are nice and sane.
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 6e1f68900bba..6b859fad6a8a 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -62,7 +62,7 @@ struct hd_struct { sector_t start_sect; sector_t nr_sects; devfs_handle_t de; /* primary (master) devfs entry */ - struct device hd_driverfs_dev; /* support driverfs hiearchy */ + struct device *hd_driverfs_dev; /* support driverfs hiearchy */ }; #define GENHD_FL_REMOVABLE 1 @@ -262,7 +262,8 @@ struct unixware_disklabel { 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); +extern void add_partition(struct gendisk *, int, sector_t, sector_t); +extern void delete_partition(struct gendisk *, int); extern struct gendisk *alloc_disk(int minors); extern void put_disk(struct gendisk *disk); |
