[ENBD] Problems compiling 2.4.26a on RH6.2 kernel 2.2.19
Peter T. Breuer
enbd@lists.community.tummy.com
Fri, 11 Jan 2002 20:44:31 +0100 (MET)
"A month of sundays ago Nelson Vieira wrote:"
> Well that seemed to have done the trick. It now successfully compiles nbd.o
What did do the trick, exactly?
> with the following warnings:
>
> gcc -O2 -Wall -D_LARGEFILE64_SOURCE -D__KERNEL__ -DMODULE -DDEBUG=0 -I/home/
> neno/nbd-2.4.26a/linux/include -I/usr/src/linux/include -c -o nbd.o
> /home/neno/nbd-2.4.26a/linux/drivers/block/nbd.c
> /home/neno/nbd-2.4.26a/linux/drivers/block/nbd.c:227: warning: `module_init'
Well, I did say to put #ifndef's around the definitions!
> redefined
> /home/neno/nbd-2.4.26a/linux/drivers/block/nbd.c:259: warning: static
> declaration for `mark_buffer_protected' follows non-static
This is the interesting one. Can you find the other definition? The one
near line 259 in nbd.c is
static inline void mark_buffer_protected(struct buffer_head * bh) {
if (!atomic_set_buffer_protected(bh))
refile_buffer(bh);
}
and it is protected by a
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,30)
which I presume is now invalidated by marcello's backport of the
function to 2.2.19. I would be very grateful if you could check,
perhaps linux/fs.h, and show me the kernel definition, if you find it
there (or elsewhere).
> /home/neno/nbd-2.4.26a/linux/drivers/block/nbd.c: In function
> `cleanup_module':
> /home/neno/nbd-2.4.26a/linux/drivers/block/nbd.c:4912: warning: control
> reaches end of non-void function
I also don't like that! The function nbd_cleanup is declared void! What
have you done exactly?
void __exit
^^^^^
nbd_cleanup (void)
{
> make[1]: Leaving directory `/tmp'
>
> I'm not, but any means, a Linux system programmer, but this looks OK to me.
Not to me! (ps - a systems programmer is not a kernel programmer! It's
usually a very different world).
So what changes did you make? Did you define __init and __exit to
nothing, or to the modifier I suggested? If the latter, I think you
must have got something slightly wrong, because the cleanup function is
declared void ... aha, I see.
We have a slight difficulty in that module_exit() wanted a return
value from the function that is its argument. Try this instead:
#define module_exit(x) int cleanup_module(void) { x(); return 0; }
Peter