Whamcloud - gitweb
Branch HEAD
authorrobert.read <robert.read>
Mon, 11 Aug 2008 20:07:06 +0000 (20:07 +0000)
committerrobert.read <robert.read>
Mon, 11 Aug 2008 20:07:06 +0000 (20:07 +0000)
b=16639
i=umka
i=nathan

Fix user space build when older kernel is installed, and remove old and redundant code..

libcfs/include/libcfs/Makefile.am
libcfs/include/libcfs/darwin/Makefile.am
libcfs/include/libcfs/linux/Makefile.am
libcfs/include/libcfs/winnt/portals_utils.h
libcfs/libcfs/util/l_ioctl.c
lnet/utils/debug.c

index 207e7f6..dc2b841 100644 (file)
@@ -1,3 +1,4 @@
+
 SUBDIRS := linux posix util
 if DARWIN
 SUBDIRS += darwin
@@ -5,7 +6,7 @@ endif
 DIST_SUBDIRS := $(SUBDIRS)
 
 EXTRA_DIST := curproc.h libcfs_private.h libcfs.h list.h lltrace.h \
-       portals_utils.h user-lock.h user-prim.h user-time.h \
+       user-lock.h user-prim.h user-time.h \
        user-tcpip.h user-bitops.h bitmap.h user-mem.h\
        libcfs_prim.h libcfs_private.h libcfs_hash.h libcfs_time.h \
        libcfs_debug.h libcfsutil.h libcfs_ioctl.h
index f2f217a..b37750e 100644 (file)
@@ -1,3 +1,3 @@
-EXTRA_DIST := darwin-mem.h darwin-types.h libcfs.h portals_utils.h     \
+EXTRA_DIST := darwin-mem.h darwin-types.h libcfs.                       \
        darwin-fs.h darwin-prim.h darwin-utils.h lltrace.h              \
        darwin-lock.h darwin-sync.h darwin-tcpip.h kp30.h
index 072a7ad..a1f46cc 100644 (file)
@@ -1,3 +1,3 @@
 EXTRA_DIST := kp30.h libcfs.h linux-fs.h linux-lock.h linux-mem.h      \
        linux-prim.h linux-time.h linux-tcpip.h lltrace.h               \
-       portals_compat25.h portals_utils.h
+       portals_compat25.h
\ No newline at end of file
index 5c7c7b7..c9ae107 100644 (file)
 #ifndef __LIBCFS_WINNT_PORTALS_UTILS_H__
 #define __LIBCFS_WINNT_PORTALS_UTILS_H__
 
-#ifndef __LIBCFS_PORTALS_UTILS_H__
-#error Do not #include this file directly. #include <libcfs/portals_utils.h> instead
-#endif
-
 #ifndef cfs_is_flag_set
 #define cfs_is_flag_set(x,f) (((x)&(f))==(f))
 #endif
index 09cd171..59dc6d8 100644 (file)
 
 #define __USE_FILE_OFFSET64
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <unistd.h>
-
-
 #include <libcfs/libcfsutil.h>
 
 #include <lnet/api-support.h>
 #include <lnet/lnetctl.h>
-#include <libcfs/portals_utils.h>
-
 
 static ioc_handler_t  do_ioctl;                 /* forward ref */
 static ioc_handler_t *current_ioc_handler = &do_ioctl;
@@ -261,7 +247,7 @@ parse_dump(char * dump_file, ioc_handler_t ioc_func)
 #endif
         
 #ifndef __CYGWIN__
-        fd = syscall(SYS_open, dump_file, O_RDONLY);
+        fd = open(dump_file, O_RDONLY);
         if (fd < 0) {
                 fprintf(stderr, "couldn't open %s: %s\n", dump_file, 
                         strerror(errno));
index a4376fd..e1371c7 100644 (file)
 #define  _GNU_SOURCE
 #endif
 
-#include <stdio.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifndef _IOWR
-#include "ioctl.h"
-#endif
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <assert.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/utsname.h>
-
 #include <libcfs/libcfsutil.h>
 #include <lnet/lnetctl.h>
-#include <libcfs/portals_utils.h>
 
-#include <time.h>
+#include <sys/utsname.h>
 
 static char rawbuf[8192];
 static char *buf = rawbuf;
@@ -802,44 +778,6 @@ static struct mod_paths {
 
 static int jt_dbg_modules_2_4(int argc, char **argv)
 {
-#ifdef HAVE_LINUX_VERSION_H
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-        struct mod_paths *mp;
-        char *path = "";
-        char *kernel = "linux";
-
-        if (argc >= 2)
-                path = argv[1];
-        if (argc == 3)
-                kernel = argv[2];
-        if (argc > 3) {
-                printf("%s [path] [kernel]\n", argv[0]);
-                return 0;
-        }
-
-        for (mp = mod_paths; mp->name != NULL; mp++) {
-                struct module_info info;
-                int rc;
-                size_t crap;
-                int query_module(const char *name, int which, void *buf,
-                                 size_t bufsize, size_t *ret);
-
-                rc = query_module(mp->name, QM_INFO, &info, sizeof(info),
-                                  &crap);
-                if (rc < 0) {
-                        if (errno != ENOENT)
-                                printf("query_module(%s) failed: %s\n",
-                                       mp->name, strerror(errno));
-                } else {
-                        printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
-                               path[0] ? "/" : "", mp->path, mp->name,
-                               info.addr + sizeof(struct module));
-                }
-        }
-
-        return 0;
-#endif // Headers are 2.6-only
-#endif // !HAVE_LINUX_VERSION_H
         return -EINVAL;
 }