Re: [PATCH] wrong disk index in /proc/stat

From: Guest section DW (
Date: Tue Jun 26 2001 - 10:49:42 EST

On Tue, Jun 26, 2001 at 04:07:33PM +0200, Martin Wilck wrote:

> > static inline unsigned int disk_index (kdev_t dev)
> > {
> > struct gendisk *g = get_gendisk(dev);
> > return g ? (MINOR(dev) >> g->minor_shift) : 0;
> > }
> Well,
> a) this is not in the official kernel,
> b) the original genhd.h says that's too slow (is it really slower?)

Ad a): true.
Ad b): if you only make this change then it will be faster or slower
  depending on how many disks you have (because get_gendisk() used
  to be a linear search through a list that has as length the number
  of disk majors); however, my get_gendisk today is

        static inline struct gendisk *
        get_gendisk(kdev_t dev) {
                return blk_gendisk[MAJOR(dev)];

  hence is faster.


[go to or so
and get patches 01*, 02*, ... and apply them successively to 2.4.6pre5.
complain to if anything is wrong]
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:14 EST