fix various build issues, re-enable netlink configure check
#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
LC_PERCPU_COUNTER
LC_QUOTA64
LC_4ARGS_VFS_SYMLINK
LC_PERCPU_COUNTER
LC_QUOTA64
LC_4ARGS_VFS_SYMLINK
# does the kernel have VFS intent patches?
LC_VFS_INTENT_PATCHES
# does the kernel have VFS intent patches?
LC_VFS_INTENT_PATCHES
+# 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
} __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));
}
#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 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) {
+ 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) {
#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"
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);
#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"
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 {
* 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
"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");
}
"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");
"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");
}
"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");
}
run_test 162 "path lookup sanity"
test_163() {
run_test 162 "path lookup sanity"
test_163() {
+ 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"