[lkml]   [2001]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] wrong disk index in /proc/stat
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

 \ /
  Last update: 2005-03-22 12:55    [W:0.055 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site