]> git.hungrycats.org Git - linux/commit
[PATCH] remove MAX_BLKDEV from genhd.c
authorAndrew Morton <akpm@digeo.com>
Tue, 25 Feb 2003 01:07:39 +0000 (17:07 -0800)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 25 Feb 2003 01:07:39 +0000 (17:07 -0800)
commit7bc4777dacb51aeafa835e7ddb6e534a60608098
treed361bd6a6489cb27deb2c0ef678fa85d01728aaa
parent51040fa7cfa0164f88d621edcdf0635fc30397e4
[PATCH] remove MAX_BLKDEV from genhd.c

Patch from Andries.Brouwer@cwi.nl

A patch for genhd.c:

- removed outdated comments
- removed MAX_BLKDEV

In genhd.c the variable MAX_BLKDEV was only the size of a hash
table, so I made it MAX_PROBE_HASH. It can be 1, or 23, or 256, or
whatever one wants.

Note that the current setup requires that every device number
in a given range is mapped by dev_to_index() to the same index
in the hash table, so this routine will have to be adapted in
case one wants to register multimajor ranges.

Discussion is possible about whether struct blk_probe needs
a dev_t or a kdev_t, but I left things this time.

If a range can end at precisely the end of [k]dev_t space,
the old code was wrong since (p->dev + p->range) would be 0.
That is why "p->dev + p->range <= dev" was replaced by
"p->dev + p->range - 1 < dev".
drivers/block/genhd.c