From 5a699e60360fd2339f487ca2a6bc60ac7d7cb85f Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 22 Aug 2003 21:39:57 +0000 Subject: [PATCH] fix socknal build on vanilla kernels by adding socket exports bumped the kernel patch version to 23, but really only vanilla-2.4.20 changed --- lnet/klnds/socklnd/Makefile.am | 4 +++ lustre/kernel_patches/patches/lustre_version.patch | 2 +- .../patches/socket-exports-vanilla.patch | 42 ++++++++++++++++++++++ lustre/kernel_patches/pc/socket-exports-vanilla.pc | 3 ++ lustre/kernel_patches/series/vanilla-2.4.20 | 1 + lustre/obdclass/class_obd.c | 4 +-- lustre/portals/knals/socknal/Makefile.am | 4 +++ 7 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 lustre/kernel_patches/patches/socket-exports-vanilla.patch create mode 100644 lustre/kernel_patches/pc/socket-exports-vanilla.pc diff --git a/lnet/klnds/socklnd/Makefile.am b/lnet/klnds/socklnd/Makefile.am index 437d7fc..d6c717c 100644 --- a/lnet/klnds/socklnd/Makefile.am +++ b/lnet/klnds/socklnd/Makefile.am @@ -9,5 +9,9 @@ MODULE = ksocknal modulenet_DATA = ksocknal.o EXTRA_PROGRAMS = ksocknal +# If you don't build with -O2, your modules won't insert, becahse htonl is +# just special that way. +CFLAGS += -O2 + DEFS = ksocknal_SOURCES = socknal.c socknal_cb.c socknal.h diff --git a/lustre/kernel_patches/patches/lustre_version.patch b/lustre/kernel_patches/patches/lustre_version.patch index c987485..7a47d62 100644 --- a/lustre/kernel_patches/patches/lustre_version.patch +++ b/lustre/kernel_patches/patches/lustre_version.patch @@ -7,6 +7,6 @@ --- /dev/null Fri Aug 30 17:31:37 2002 +++ linux-2.4.18-18.8.0-l12-braam/include/linux/lustre_version.h Thu Feb 13 07:58:33 2003 @@ -0,0 +1 @@ -+#define LUSTRE_KERNEL_VERSION 21 ++#define LUSTRE_KERNEL_VERSION 23 _ diff --git a/lustre/kernel_patches/patches/socket-exports-vanilla.patch b/lustre/kernel_patches/patches/socket-exports-vanilla.patch new file mode 100644 index 0000000..9dd5008 --- /dev/null +++ b/lustre/kernel_patches/patches/socket-exports-vanilla.patch @@ -0,0 +1,42 @@ + include/linux/socket.h | 4 ++++ + net/netsyms.c | 2 ++ + net/socket.c | 2 +- + 3 files changed, 7 insertions(+), 1 deletion(-) + +--- linux-2.4.20-l18/include/linux/socket.h~socket-exports-vanilla Fri Aug 22 15:43:58 2003 ++++ linux-2.4.20-l18-phil/include/linux/socket.h Fri Aug 22 16:26:37 2003 +@@ -260,6 +260,10 @@ extern void memcpy_tokerneliovec(struct + extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen); + extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr); + extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); ++struct socket; ++extern int sock_map_fd(struct socket *sock); ++extern struct socket *sockfd_lookup(int fd, int *err); ++ + #endif + #endif /* not kernel and not glibc */ + #endif /* _LINUX_SOCKET_H */ +--- linux-2.4.20-l18/net/netsyms.c~socket-exports-vanilla Fri Aug 22 15:43:58 2003 ++++ linux-2.4.20-l18-phil/net/netsyms.c Fri Aug 22 16:25:04 2003 +@@ -159,6 +159,8 @@ EXPORT_SYMBOL(datagram_poll); + EXPORT_SYMBOL(put_cmsg); + EXPORT_SYMBOL(sock_kmalloc); + EXPORT_SYMBOL(sock_kfree_s); ++EXPORT_SYMBOL(sockfd_lookup); ++EXPORT_SYMBOL(sock_map_fd); + + #ifdef CONFIG_FILTER + EXPORT_SYMBOL(sk_run_filter); +--- linux-2.4.20-l18/net/socket.c~socket-exports-vanilla Fri Aug 22 15:43:58 2003 ++++ linux-2.4.20-l18-phil/net/socket.c Fri Aug 22 16:25:04 2003 +@@ -325,7 +325,7 @@ static struct dentry_operations sockfs_d + * but we take care of internal coherence yet. + */ + +-static int sock_map_fd(struct socket *sock) ++int sock_map_fd(struct socket *sock) + { + int fd; + struct qstr this; + +_ diff --git a/lustre/kernel_patches/pc/socket-exports-vanilla.pc b/lustre/kernel_patches/pc/socket-exports-vanilla.pc new file mode 100644 index 0000000..3277003 --- /dev/null +++ b/lustre/kernel_patches/pc/socket-exports-vanilla.pc @@ -0,0 +1,3 @@ +include/linux/socket.h +net/netsyms.c +net/socket.c diff --git a/lustre/kernel_patches/series/vanilla-2.4.20 b/lustre/kernel_patches/series/vanilla-2.4.20 index 726a028..d36f90a 100644 --- a/lustre/kernel_patches/series/vanilla-2.4.20 +++ b/lustre/kernel_patches/series/vanilla-2.4.20 @@ -29,3 +29,4 @@ ext3-map_inode_page.patch ext3-error-export.patch iopen-2.4.20.patch tcp-zero-copy.patch +socket-exports-vanilla.patch diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 8275ed8..2efee5b 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -916,8 +916,8 @@ static void cleanup_obdclass(void) * kernel patch */ #ifdef __KERNEL__ #include -#define LUSTRE_MIN_VERSION 21 -#define LUSTRE_MAX_VERSION 21 +#define LUSTRE_MIN_VERSION 23 +#define LUSTRE_MAX_VERSION 23 #if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION) # error Cannot continue: Your Lustre kernel patch is older than the sources #elif (LUSTRE_KERNEL_VERSION > LUSTRE_MAX_VERSION) diff --git a/lustre/portals/knals/socknal/Makefile.am b/lustre/portals/knals/socknal/Makefile.am index 437d7fc..d6c717c 100644 --- a/lustre/portals/knals/socknal/Makefile.am +++ b/lustre/portals/knals/socknal/Makefile.am @@ -9,5 +9,9 @@ MODULE = ksocknal modulenet_DATA = ksocknal.o EXTRA_PROGRAMS = ksocknal +# If you don't build with -O2, your modules won't insert, becahse htonl is +# just special that way. +CFLAGS += -O2 + DEFS = ksocknal_SOURCES = socknal.c socknal_cb.c socknal.h -- 1.8.3.1