lkml.org 
[lkml]   [2001]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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.

Andries

[go to ftp://ftp.XX.kernel.org/pub/linux/kernel/people/aeb/ or so
and get patches 01*, 02*, ... and apply them successively to 2.4.6pre5.
complain to aeb@cwi.nl if anything is wrong]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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