On Thu, May 29 2003, Nicolas Bellido wrote:
Jö Fahlke wrote:
Hi!
I get a compilation error ehen trying to compile the patched kernel on SuSE. I use the kernel 2.4.20.SuSE.
The problem is that the SuSE patches change blk_started_io() (defined in include/linux/blkdev.h) from having one argument to two, and pktcdvd.c uses this funktion. The change is introduced by SuSEs elevator_lowlatency patch. Unfortunately, blk_started_io() is only udes in that patch and pktcdvd.c and I have no idea what it is good for, so I don't dare to mangle the code myself. Any ideas what to do to make it compile?
I see I'm not the only one to have the problem ;)
In 2.4.20.SuSE, the blk_started_io function is defined as :
static inline void blk_started_io(struct request * req, int nsects) { request_queue_t * q = req->q;
if (q) atomic_add(nsects, &q->nr_sectors); BUG_ON(atomic_read(&q->nr_sectors) < 0); }
The pktcdvd_device structure (see in linux/pktcdvd.h) contains such a struct request.
So, I tried :
--- linux-2.4.20.SuSE.orig/drivers/block/pktcdvd.c Thu May 29 21:36:27 2003 +++ linux-2.4.20.SuSE/drivers/block/pktcdvd.c Tue May 27 22:48:53 2003 @@ -551,7 +551,7 @@ else bh = __pkt_get_buffer(pd, sector);
- blk_started_io(bh->b_size >> 9); + blk_started_io(pd->rq, bh->b_size >> 9); bh->b_blocknr = block; bh->b_end_io = pkt_end_io_write; bh->b_rsector = sector;
At least, now, it compiles, but I had no time to give it a try. Can someone confirm if this the Rigth Way(tm) to do ?
Looks fine, pd->rq should be set in that path. I'll try to get some 8.2 kernel rpms built with packet writing. -- Jens Axboe