[ENBD] compilation problems

Peter T. Breuer enbd@lists.community.tummy.com
Wed, 12 Feb 2003 18:54:26 +0100 (MET)


"A month of sundays ago De Pelsemaeker Pieter wrote:"
> when I try  to compile nbd-2.4.30 I get the following errors:
> gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1 -D_XOPEN_S
> OURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -O2 -D__KERNEL__ -DMODULE -DDEBUG=0 -DC
> ONFIG_ENBD=m -I/home/pdp/nbd-2.4.30/linux/include -I/usr/src/linux/include  
> -c -o enbd.o /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c

Your kernel code in /usr/src./linux (surely that can't be correct? Have
you set LINUXDIR?) does not contain the macro for list_for_each_prev
which should be found in list.h. Please fix ...

There is a definition in enbd.c itself:

  #undef list_for_each_prev
  #define list_for_each_prev(pos, head) \
          for (pos = (struct request *)(head)->sem; pos != (head); \
                            pos = (struct request *)pos->sem)

but it's only activated for kernel code with a version before 2.3.30.
So the natural question to ask is - what kernel code can you be trying
to compile this against?  And why! Please reconsider your intention.


> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c: In function `nbd_rollback':
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1476: warning: implicit
> declaration of function `list_for_each_prev'
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1476: parse error before `{'
> /home/pdp/nbd-2.4.30/linux/drivers/block/enbd.c:1479: break statement not
> within loop or switch


Let's take a wild guess and say that you are compiling against an old
redhat installation with an early 2.4 kernel source in?

Maybe I should just let the enbd code define the macro unconditionally.

Peter