Jens Axboe wrote:
On Thu, May 02 2002, Johnathan Hicks wrote:
--- pktcdvd.c.org Thu May 2 16:34:10 2002 +++ pktcdvd.c Thu May 2 15:07:12 2002 @@ -161,7 +161,7 @@ static int pkt_front_merge_fn(request_queue_t *q, struct request *rq, struct bio *bio) { - struct pktcdvd_device *pd = &pkt_devs[minor(bio->bi_dev)]; + struct pktcdvd_device *pd = &pkt_devs[minor(bio->bi_bdev->bd_inode->i_rdev)];
make that
struct pktcdvd_device *pd = &pkt_devs[minor(to_kdev_t(bio->bi_bdev))];
Did you just go digging for where to find a kdev_t? :-)
Sort of. I tried to do it as logically as possible but the lack of comments on the structures prevented this. I'm sure someone will document them eventually. :)
You must always use bi_bdev, since the bio could have been remapped xx times before we receive it.
Yeah, I did see a whole bunch of remappings in the code there. --John