Hi,

I have made available RPM packages of the DAFS sdk v 0.8.  You can find
them at:

ftp://ftp.clusterfs.com/pub/lustre/RPMS

I made a few patches, some to compile cleanly and others to provide a
header file structure that is usable in both user and kernel mode.

I have attached the patch - could it perhaps go into the main DAFS SDK
tree?  Would you like to include the spec file as well?

The DAFS stub generator is amazingly well designed and one can use that
with just the dafs-sdk in user and kernel mode.

To build the dafs library, which provides networking support too, one
needs a VIA library. I have also built some Linux 2.4.5 kernel RPMS with
the M-VIA libraries included.  You find these in the same place. (These
kernels also include also have pcmcia, ext3 0.0.8, InterMezzo, and -ac17
kernel patches.)

Please read the disclaimers and enjoy!

- Peter J. Braam -

http://www.clusterfilesystems.com
diff -uNr sdk/dafsgen/rpc_main.c sdk-new/dafsgen/rpc_main.c
--- sdk/dafsgen/rpc_main.c      Mon Jun 11 14:41:25 2001
+++ sdk-new/dafsgen/rpc_main.c  Thu Jun 28 10:29:38 2001
@@ -424,6 +424,7 @@
        add_warning();
 
        f_print(fout, "#ifndef DAFS_KERNEL\n"); 
+       f_print(fout, "#include <string.h>\n");
        f_print(fout, "#include <stddef.h>\n");
        f_print(fout, "#include <stdlib.h>\n");
        f_print(fout, "#else /* DAFS_KERNEL */\n");
diff -uNr sdk/dts/dts_sup.c sdk-new/dts/dts_sup.c
--- sdk/dts/dts_sup.c   Mon Jun 11 14:07:35 2001
+++ sdk-new/dts/dts_sup.c       Thu Jun 28 10:29:38 2001
@@ -4,6 +4,7 @@
 #include <pthread.h>
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 void *f_read(void *temp)
@@ -63,7 +64,7 @@
 
 printf("\nEnter the name of fifo for i/p to main dts>");
 gets(i_line);
-if(*i_line != NULL){
+if(*i_line != 0){
 if(mkfifo(i_line, S_IRWXU | S_IRWXG | S_IRWXO) != 0){
        printf("\nError in creating fifo");
        exit(0);
@@ -72,7 +73,7 @@
 }
 printf("\nEnter the name of fifo for receiving o/p from main dts>");
 gets(o_line);
-if(*o_line != NULL){
+if(*o_line != 0){
 if(mkfifo(o_line, S_IRWXU | S_IRWXO | S_IRWXG) != 0){
         printf("\nError in creating fifo");
         exit(0);
diff -uNr sdk/lib/dafslib.c sdk-new/lib/dafslib.c
--- sdk/lib/dafslib.c   Mon Jun 11 14:07:39 2001
+++ sdk-new/lib/dafslib.c       Thu Jun 28 10:29:38 2001
@@ -30,6 +30,7 @@
 /* dafslib.c - internal library utility routines, mostly the pool
    allocator and locking abstractions */
 
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 
diff -uNr sdk/lib/vi.c sdk-new/lib/vi.c
--- sdk/lib/vi.c        Mon Jun 11 14:07:39 2001
+++ sdk-new/lib/vi.c    Thu Jun 28 10:29:38 2001
@@ -29,6 +29,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef __linux__
+#include <string.h>
+#endif
 #ifdef WIN32
 #define strdup(filename) _strdup(filename)
 #define usleep(duration) Sleep(duration)
diff -uNr sdk/makefile.config sdk-new/makefile.config
--- sdk/makefile.config Mon Jun 11 14:07:00 2001
+++ sdk-new/makefile.config     Thu Jun 28 10:29:38 2001
@@ -9,7 +9,7 @@
 
 # edit as needed
 
-PLATFORM=      suncc
+PLATFORM=      linux
 
 VIPL_INCLUDE= ${SDK_BASE}/../../vipl
 VIPL_LIB= -L${SDK_BASE}/../../vipl -Wl,-R/opt/Troika/lib
diff -uNr sdk/mk/makefile.linux sdk-new/mk/makefile.linux
--- sdk/mk/makefile.linux       Mon Jun 11 14:07:40 2001
+++ sdk-new/mk/makefile.linux   Thu Jun 28 10:29:38 2001
@@ -1,7 +1,7 @@
 CC=            gcc
 LINK=          gcc
 AR=            ar
-CFLAGS=                -Wall -Werror -Wpointer-arith -g -DVIPL095
+CFLAGS=                -Wall -Werror -Wpointer-arith -g -D_REENTRANT
 LINKFLAGS=     -g -o $@ 
 LDFLAGS=       -L$(SDK_BASE)/lib -lpthread
 ARFLAGS=       -ruv $@
diff -uNr sdk/platform/linux/dafs_kernel_platform.h 
sdk-new/platform/linux/dafs_kernel_platform.h
--- sdk/platform/linux/dafs_kernel_platform.h   Wed Dec 31 17:00:00 1969
+++ sdk-new/platform/linux/dafs_kernel_platform.h       Thu Jun 28 10:48:17 2001
@@ -0,0 +1,14 @@
+/* dafs_kernel_platform.h - SOLARIS */
+#ifndef _DAFS_KERNEL_PLATFORM_H
+#define _DAFS_KERNEL_PLATFORM_H
+
+#include <linux/malloc.h>
+#include <linux/kernel.h>
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif /* NULL */
+
+#define malloc(len) kmalloc(len, GFP_KERNEL)
+
+#endif /* _DAFS_KERNEL_PLATFORM_H */
diff -uNr sdk/platform/linux/dafs_kernel_platform.h~ 
sdk-new/platform/linux/dafs_kernel_platform.h~
--- sdk/platform/linux/dafs_kernel_platform.h~  Wed Dec 31 17:00:00 1969
+++ sdk-new/platform/linux/dafs_kernel_platform.h~      Thu Jun 28 10:45:41 2001
@@ -0,0 +1,22 @@
+/* dafs_kernel_platform.h - SOLARIS */
+#ifndef _DAFS_KERNEL_PLATFORM_H
+#define _DAFS_KERNEL_PLATFORM_H
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif /* NULL */
+
+/*
+**     SDK functions called from the kernel should allocate space
+**     first, rather than passing in NULL pointers and waiting for
+**     the SDK to do it for them.  Since the SDK does not check for
+**     allocation failure, we panic here.  It's ugly, but
+**     until the SDK either checks for malloc errors or rejects
+**     requests that require allocation, this is what we're doing.
+**     RSB 1/3/01
+*/
+#define malloc(size) NULL
+#define memset(s, NA, size) bzero(s, size)
+#define memcpy(s1, s2, size) bcopy(s2, s1, size)
+
+#endif /* _DAFS_KERNEL_PLATFORM_H */
diff -uNr sdk/platform/linux/dafs_platform.h sdk-new/platform/linux/dafs_platform.h
--- sdk/platform/linux/dafs_platform.h  Mon Jun 11 14:07:40 2001
+++ sdk-new/platform/linux/dafs_platform.h      Thu Jun 28 10:30:49 2001
@@ -1,6 +1,10 @@
 /* dafs_platform.h - LINUX */
 
+#ifndef __KERNEL__
 #include <inttypes.h>
+#else
+#include <linux/types.h>
+#endif
 
 typedef int8_t dafs_int8;
 typedef int16_t dafs_int16;

Reply via email to