Whamcloud - gitweb
b=19856
authornathan <nathan>
Wed, 29 Jul 2009 20:00:54 +0000 (20:00 +0000)
committernathan <nathan>
Wed, 29 Jul 2009 20:00:54 +0000 (20:00 +0000)
fix various build issues, re-enable netlink configure check

libcfs/libcfs/linux/linux-kernelcomm.c
lustre/autoconf/lustre-core.m4
lustre/include/lustre/lustre_user.h
lustre/tests/copytool.c
lustre/tests/mpi/lp_utils.c
lustre/tests/mpi/parallel_grouplock.c
lustre/tests/sanity.sh

index 9845b6c..b7e1d49 100644 (file)
 
 #include <libcfs/libcfs.h>
 
 
 #include <libcfs/libcfs.h>
 
+/* OFED backport #defines netlink_kernel_create with 6 args.
+   I haven't a clue why that header file gets included here,
+   but we must undo its mischief. */
+#ifdef BACKPORT_LINUX_NETLINK_H
+#undef netlink_kernel_create
+#endif
+
+
 /* Single Netlink Message type to send all Lustre messages */
 #define LNL_MSG 26
 
 /* Single Netlink Message type to send all Lustre messages */
 #define LNL_MSG 26
 
index 7f634ec..15fbe17 100644 (file)
@@ -1636,6 +1636,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_PERCPU_COUNTER
          LC_QUOTA64
          LC_4ARGS_VFS_SYMLINK
          LC_PERCPU_COUNTER
          LC_QUOTA64
          LC_4ARGS_VFS_SYMLINK
+         LC_NETLINK
 
          # does the kernel have VFS intent patches?
          LC_VFS_INTENT_PATCHES
 
          # does the kernel have VFS intent patches?
          LC_VFS_INTENT_PATCHES
@@ -2013,6 +2014,26 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
 ])
 
 #
+# LC_NETLINK
+#
+# If we have netlink.h
+#
+AC_DEFUN([LC_NETLINK],
+[LB_CHECK_FILE([$LINUX/include/net/netlink.h],[
+        AC_MSG_CHECKING([if netlink.h can be compiled])
+        LB_LINUX_TRY_COMPILE([
+                #include <net/netlink.h>
+        ],[],[
+                AC_MSG_RESULT([yes])
+                AC_DEFINE(HAVE_NETLINK, 1, [net/netlink.h found])
+        ],[
+                AC_MSG_RESULT([no])
+        ])
+],
+[])
+])
+
+#
 # LC_CONFIGURE
 #
 # other configure checks
 # LC_CONFIGURE
 #
 # other configure checks
index d7f65e3..87643f8 100644 (file)
@@ -480,12 +480,14 @@ struct hsm_action_list {
 } __attribute__((packed));
 
 /* Return pointer to first hai in action list */
 } __attribute__((packed));
 
 /* Return pointer to first hai in action list */
-static inline struct hsm_action_item * hai_zero(struct hsm_action_list *hal) {
+static __inline__ struct hsm_action_item * hai_zero(struct hsm_action_list *hal)
+{
         return (struct hsm_action_item *)(hal->hal_fsname +
                                           size_round(strlen(hal->hal_fsname)));
 }
 /* Return pointer to next hai */
         return (struct hsm_action_item *)(hal->hal_fsname +
                                           size_round(strlen(hal->hal_fsname)));
 }
 /* Return pointer to next hai */
-static inline struct hsm_action_item * hai_next(struct hsm_action_item *hai) {
+static __inline__ struct hsm_action_item * hai_next(struct hsm_action_item *hai)
+{
         return (struct hsm_action_item *)((char *)hai +
                                           size_round(hai->hai_len));
 }
         return (struct hsm_action_item *)((char *)hai +
                                           size_round(hai->hai_len));
 }
index a74fac3..c862426 100644 (file)
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
+#include <getopt.h>
 #include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 #include <lustre/liblustreapi.h>
 
 #include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 #include <lustre/liblustreapi.h>
 
-int main() {
+int main(int argc, char **argv) {
+        int c, test = 0;
+        struct option long_opts[] = {
+                {"test", no_argument, 0, 't'},
+                {0, 0, 0, 0}
+        };
         void *ctdata;
         int archive_nums[] = {1}; /* which archive numbers we care about */
         int rc;
 
         void *ctdata;
         int archive_nums[] = {1}; /* which archive numbers we care about */
         int rc;
 
+        optind = 0;
+        while ((c = getopt_long(argc, argv, "t", long_opts, NULL)) != -1) {
+                switch (c) {
+                case 't':
+                        test++;
+                        break;
+                default:
+                        fprintf(stderr, "error: %s: option '%s' unrecognized\n",
+                                argv[0], argv[optind - 1]);
+                        return -EINVAL;
+                }
+        }
+
         rc = llapi_copytool_start(&ctdata, 0, ARRAY_SIZE(archive_nums),
                                   archive_nums);
         if (rc < 0) {
         rc = llapi_copytool_start(&ctdata, 0, ARRAY_SIZE(archive_nums),
                                   archive_nums);
         if (rc < 0) {
@@ -64,6 +83,9 @@ int main() {
                 return rc;
         }
 
                 return rc;
         }
 
+        if (test)
+                return llapi_copytool_fini(&ctdata);
+
         printf("Waiting for message from kernel (pid=%d)\n", getpid());
 
         while(1) {
         printf("Waiting for message from kernel (pid=%d)\n", getpid());
 
         while(1) {
index ae7bd77..7f47b3d 100644 (file)
@@ -50,6 +50,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <libcfs/libcfs.h>
 #include "lustre/lustre_user.h"
 #include "lp_utils.h"
 
 #include "lustre/lustre_user.h"
 #include "lp_utils.h"
 
@@ -94,7 +95,7 @@ inline void end(char *str) {
                                timestamp(), str, elapsed / 60);
                 } else {
                         printf("%s:\tFinished %-15s(%.3f sec)\n",
                                timestamp(), str, elapsed / 60);
                 } else {
                         printf("%s:\tFinished %-15s(%.3f sec)\n",
-                              timestamp(), str, elapsed);
+                               timestamp(), str, elapsed);
 
                 }
                 fflush(stdout);
 
                 }
                 fflush(stdout);
index 3c63369..a2a6e86 100644 (file)
@@ -50,6 +50,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
 #include <errno.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 #include "lp_utils.h"
 
 #include <lustre/lustre_user.h>
 #include "lp_utils.h"
 
@@ -251,7 +252,7 @@ void grouplock_test1(char *filename, int fd, int blocking_op, int unlock_op)
                                 filename, errno, strerror(errno));
                         FAIL(errmsg);
                 }
                                 filename, errno, strerror(errno));
                         FAIL(errmsg);
                 }
-                
+
                 /* Wait for task1 to complete. */
                 iter = MAX_WAIT_TRIES;
                 do {
                 /* Wait for task1 to complete. */
                 iter = MAX_WAIT_TRIES;
                 do {
@@ -685,7 +686,7 @@ void grouplock_test4(char *filename, int fd)
         }
 }
 
         }
 }
 
-/* 
+/*
  * task0 attempts GR(gid=1) -- granted
  * task1 attempts PR on non-blocking fd -> should return -EWOULDBLOCK
  * task2 attempts PW on non-blocking fd -> should return -EWOULDBLOCK
  * task0 attempts GR(gid=1) -- granted
  * task1 attempts PR on non-blocking fd -> should return -EWOULDBLOCK
  * task2 attempts PW on non-blocking fd -> should return -EWOULDBLOCK
@@ -796,7 +797,7 @@ void grouplock_errorstest(char *filename, int fd)
                                         "with errno %d instead of EINVAL\n",
                                         errno);
                                 FAIL(errmsg);
                                         "with errno %d instead of EINVAL\n",
                                         errno);
                                 FAIL(errmsg);
-                        } 
+                        }
                 } else {
                         FAIL("Taking second GROUP lock on same fd succeed\n");
                 }
                 } else {
                         FAIL("Taking second GROUP lock on same fd succeed\n");
                 }
@@ -808,7 +809,7 @@ void grouplock_errorstest(char *filename, int fd)
                                         "different gid failed with errno %d "
                                         "instead of EINVAL\n", errno);
                                 FAIL(errmsg);
                                         "different gid failed with errno %d "
                                         "instead of EINVAL\n", errno);
                                 FAIL(errmsg);
-                        } 
+                        }
                 } else {
                         FAIL("Taking second GROUP lock on same fd, with "
                              "different gid, succeeded.\n");
                 } else {
                         FAIL("Taking second GROUP lock on same fd, with "
                              "different gid, succeeded.\n");
@@ -821,7 +822,7 @@ void grouplock_errorstest(char *filename, int fd)
                                         "failed with errno %d instead of "
                                         "EINVAL\n", errno);
                                 FAIL(errmsg);
                                         "failed with errno %d instead of "
                                         "EINVAL\n", errno);
                                 FAIL(errmsg);
-                        } 
+                        }
                 } else {
                         FAIL("GROUP unlock with wrong gid succeed\n");
                 }
                 } else {
                         FAIL("GROUP unlock with wrong gid succeed\n");
                 }
@@ -841,7 +842,7 @@ void grouplock_errorstest(char *filename, int fd)
                                         "fd failed with errno %d instead of "
                                         "EINVAL.\n", errno);
                                 FAIL(errmsg);
                                         "fd failed with errno %d instead of "
                                         "EINVAL.\n", errno);
                                 FAIL(errmsg);
-                        } 
+                        }
                 } else {
                         FAIL("GROUP unlock on never locked fd succeed\n");
                 }
                 } else {
                         FAIL("GROUP unlock on never locked fd succeed\n");
                 }
index 1e70847..f838a5f 100644 (file)
@@ -6376,7 +6376,8 @@ test_162() {
 run_test 162 "path lookup sanity"
 
 test_163() {
 run_test 162 "path lookup sanity"
 
 test_163() {
-        copytool &
+       copytool --test || { skip "copytool test: $? 38=enosys" && return; }
+       copytool &
        sleep 1
        # this proc file is temporary and linux-only
        $LCTL set_param mdc.lustre-MDT0000-mdc-*.netlink=0 || error "lnl send failed"
        sleep 1
        # this proc file is temporary and linux-only
        $LCTL set_param mdc.lustre-MDT0000-mdc-*.netlink=0 || error "lnl send failed"