From 4945d9e4dbfb97e8e99e6491031db925443aabc8 Mon Sep 17 00:00:00 2001 From: braam Date: Sat, 1 Mar 2003 22:45:07 +0000 Subject: [PATCH] - fixes for builds of liblustre (leave out kernel include path) - get ptlrpc working in the library --- lustre/include/liblustre.h | 9 +++++++-- lustre/liblustre/libtest.c | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index deb35dc..0b37021 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -222,9 +222,14 @@ typedef struct { int size; } kmem_cache_t; #define SLAB_HWCACHE_ALIGN 0 -static inline kmem_cache_t *kmem_cache_create(name,objsize,c,d,e,f) +static inline kmem_cache_t *kmem_cache_create(name,objsize,cdum,d,e,f) { - return malloc(objsize); + kmem_cache_t *c; + c = malloc(sizeof(*c)); + if (!c) + return NULL; + c->size = objsize; + return c; }; static inline int kmem_cache_destroy(kmem_cache_t *a) diff --git a/lustre/liblustre/libtest.c b/lustre/liblustre/libtest.c index fd5bb20..fce75c0 100644 --- a/lustre/liblustre/libtest.c +++ b/lustre/liblustre/libtest.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #include /* needed for ptpctl.h */ #include /* needed for parse_dump */ @@ -44,13 +47,15 @@ void init_current(int argc, char **argv) } +extern ptl_nid_t tcpnal_mynid; + int init_lib_portals(struct pingcli_args *args) { int rc; PtlInit(); - - rc = PtlNIInit(procbridge_interface, 0, 0, args->mynid, &tcpnal_ni); + tcpnal_mynid = args->mynid; + rc = PtlNIInit(procbridge_interface, 0, 0, 0, &tcpnal_ni); if (rc != 0) { CERROR("ksocknal: PtlNIInit failed: error %d\n", rc); PtlFini(); @@ -79,7 +84,7 @@ int lib_ioctl(int dev_id, int opc, void * ptr) return (0); } -int main(int arc, char **argv) +int main(int argc, char **argv) { struct pingcli_args *args; args= malloc(sizeof(*args)); @@ -88,12 +93,10 @@ int main(int arc, char **argv) exit(1); } - args->mynid = atoi(argv[1]); - args->nid = atoi(argv[2]); - args->port = 9999; - args->count = atoi(argv[3]); - args->size = atoi(argv[4]); + args->mynid = ntohl (inet_addr (argv[1])); + INIT_LIST_HEAD(&ocus.ocus_conns); + init_current(argc, argv); init_obdclass(); init_lib_portals(args); ptlrpc_init(); -- 1.8.3.1