Commit db09b5fc authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (7/25) Removing bogus arrays - ->part[].number

	Each hd_struct used to have int number; in it.  It's used _only_
in disk->part[0] - disk->part[n].number is never assigned/checked for any
positive n.  Moved from hd_struct to gendisk (disk->part[0].number to
disk->number).
parent c5f45a70
...@@ -300,8 +300,8 @@ static void devfs_register_disc(struct gendisk *dev) ...@@ -300,8 +300,8 @@ static void devfs_register_disc(struct gendisk *dev)
} }
if (!devfs_handle) if (!devfs_handle)
devfs_handle = devfs_mk_dir(NULL, "discs", NULL); devfs_handle = devfs_mk_dir(NULL, "discs", NULL);
p[0].number = devfs_alloc_unique_number (&disc_numspace); dev->number = devfs_alloc_unique_number (&disc_numspace);
sprintf(symlink, "disc%d", p[0].number); sprintf(symlink, "disc%d", dev->number);
devfs_mk_symlink (devfs_handle, symlink, DEVFS_FL_DEFAULT, devfs_mk_symlink (devfs_handle, symlink, DEVFS_FL_DEFAULT,
dirname + pos, &slave, NULL); dirname + pos, &slave, NULL);
p[0].de = devfs_register (dir, "disc", devfs_flags, p[0].de = devfs_register (dir, "disc", devfs_flags,
...@@ -333,7 +333,7 @@ void devfs_register_partitions (struct gendisk *dev, int unregister) ...@@ -333,7 +333,7 @@ void devfs_register_partitions (struct gendisk *dev, int unregister)
if (unregister) { if (unregister) {
devfs_unregister(p[0].de); devfs_unregister(p[0].de);
p[0].de = NULL; p[0].de = NULL;
devfs_dealloc_unique_number(&disc_numspace, p[0].number); devfs_dealloc_unique_number(&disc_numspace, dev->number);
} }
#endif /* CONFIG_DEVFS_FS */ #endif /* CONFIG_DEVFS_FS */
} }
......
...@@ -62,7 +62,6 @@ struct hd_struct { ...@@ -62,7 +62,6 @@ struct hd_struct {
unsigned long start_sect; unsigned long start_sect;
unsigned long nr_sects; unsigned long nr_sects;
devfs_handle_t de; /* primary (master) devfs entry */ devfs_handle_t de; /* primary (master) devfs entry */
int number; /* stupid old code wastes space */
struct device hd_driverfs_dev; /* support driverfs hiearchy */ struct device hd_driverfs_dev; /* support driverfs hiearchy */
}; };
...@@ -83,6 +82,7 @@ struct gendisk { ...@@ -83,6 +82,7 @@ struct gendisk {
devfs_handle_t *de_arr; /* one per physical disc */ devfs_handle_t *de_arr; /* one per physical disc */
struct device *driverfs_dev; struct device *driverfs_dev;
int flags; int flags;
int number; /* devfs crap */
}; };
/* drivers/block/genhd.c */ /* drivers/block/genhd.c */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment