compilation error with kernel 2.4.20.SuSE
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? Thanks in advance, Joe.
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 ?
Thanks in advance, Joe.
Nicolas.
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
Now that I am not in a hurry I hopefully used "g" instead of "r" in mutt. On Fri, May 30, 2003 at 09:44:25AM +0200, Jens Axboe wrote:
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.
I compiled them. There are rpm's under http://mathphys.fsk.uni-heidelberg.de/~joe/pktcd/ if someone want to test them. I use Debian normally and used a lot of guessing in creating the rpm's, so you probably should be careful. The kernel-source-pktcd rpm is the standard SuSE 8.2 kernel + packet-2.4.20-2.patch (slightly modified to apply cleanly) + packet-2.4.20-pre11-suse.patch + the patch from Nicolas Bellido (thanks a lot). The k_pktcd rpm is a heavily modified version of SuSEs k_deflt. I modified it so it doesn't install the just compiled kernel over the one I'm currently running while building the package. Again, I don't now much about rpm's and am not sure I don't make things worse. Thanks a lot, Jö. -- Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread! (s. also http://www.physik.uni-marburg.de/~kraft/sonstiges/virus.html)
Jö Fahlke wrote:
On Fri, May 30, 2003 at 09:44:25AM +0200, Jens Axboe wrote:
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.
I compiled them. There are rpm's under http://mathphys.fsk.uni-heidelberg.de/~joe/pktcd/ if someone want to test them. I use Debian normally and used a lot of guessing in creating the rpm's, so you probably should be careful.
I tried the kernel image and modules I built yesterday; and the packet to work seems to work, at first sight : basic reads/writes are OK. I will have a look to your rpm's, but I don't have a SuSE 8.2, so maybe I won't be able to check the deps (I'm running a 8.0, using apt).
Thanks a lot, Jv.
N.
participants (4)
-
Jens Axboe
-
Jö Fahlke
-
J� Fahlke
-
Nicolas Bellido