Re: blcr make error with linux kernel 2.4.2?

From: Paul H. Hargrove (PHHargrove_at_lbl.gov)
Date: Mon Nov 24 2003 - 09:30:50 PST


tingyu,

  I see that list_for_each_safe did not appear in the kernel sources
until 2.4.10.  Attached is a patch that should allow you to get past the
 compilation error you reported.

  We've done most of our recent testing and development on 2.4.18
kernels and newer.  So, I am not certain how well a 2.4.2 kernel will
work.  I am certainly willing to help you get blcr working with 2.4.2,
but I can't be certain how much work it will require.

-Paul

tingyu wrote:
> Hi guys,
> Just got the blcr module and try to install it into our cluster. I am
> using Radhat Linux 7.1
> with Kernel 2.4.2 and gcc 2.96. Configure step is ok, when "make", I got
> errors as below:
> 
> /*********************** begin of text**************
> [root@vortal0 blcr-0.2.0]# make
> make all-recursive
> make[1]: Entering directory `/home/tz9/blcr-0.2.0'
> Making all in man
> make[2]: Entering directory `/home/tz9/blcr-0.2.0/man'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/home/tz9/blcr-0.2.0/man'
> Making all in include
> make[2]: Entering directory `/home/tz9/blcr-0.2.0/include'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/home/tz9/blcr-0.2.0/include'
> Making all in cr_module
> make[2]: Entering directory `/home/tz9/blcr-0.2.0/cr_module'
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include
> -I../vmadump -I/usr/src/linux-2.4.2/include -D__KERNEL__ -DMODULE -Wall
> -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strength-reduce -g -O2
> -MT cr_async.o -MD -MP -MF ".deps/cr_async.Tpo" \
> -c -o cr_async.o `test -f 'cr_async.c' || echo './'`cr_async.c; \
> then mv -f ".deps/cr_async.Tpo" ".deps/cr_async.Po"; \
> else rm -f ".deps/cr_async.Tpo"; exit 1; \
> fi
> cr_async.c: In function `cr_phase1_release':
> cr_async.c:53: warning: implicit declaration of function
> `list_for_each_safe'
> cr_async.c:53: parse error before `{'
> cr_async.c:50: warning: `cr_task' might be used uninitialized in this
> function
> cr_async.c: At top level:
> cr_async.c:61: parse error before `do'
> make[2]: *** [cr_async.o] Error 1
> make[2]: Leaving directory `/home/tz9/blcr-0.2.0/cr_module'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/tz9/blcr-0.2.0'
> make: *** [all] Error 2
> 
> /******************* end of text ***********/
> 
> Could anybody give me some suggestion? Seems I HAVE TO update the kernel
> to 2.4.20?
> 
> Thanks a lot!
> 
> 
> Tingyu
> Nov 22, 2003
> 
> 
> 


-- 
Paul H. Hargrove                          PHHargrove_at_lbl_dot_gov
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-495-2998

Index: cr_module.h
===================================================================
RCS file: /var/local/cvs/lbnl_cr/cr_module/cr_module.h,v
retrieving revision 1.78
diff -u -r1.78 cr_module.h
--- cr_module.h	14 Nov 2003 19:55:14 -0000	1.78
+++ cr_module.h	24 Nov 2003 17:25:55 -0000
@@ -307,5 +307,7 @@
 extern ssize_t cr_kread(struct file * file, void *buf, size_t count);
 extern ssize_t cr_kwrite(struct file * file, void *buf, size_t count);
 
+#define list_for_each_safe(pos, n, head) \
+  for (pos = (head)->next, n = pos->next; pos != (head); pos = n, n = pos->next)
 
 #endif