-obj-m += @LDISKFS_SUBDIR@/ @LIBCFS_SUBDIR@/ lnet/
+obj-m += @LDISKFS_SUBDIR@/ libcfs/ lnet/
obj-m += lustre/
@INCLUDE_RULES@
SUBDIRS := @LDISKFS_SUBDIR@ \
. \
@LUSTREIOKIT_SUBDIR@ \
- @LIBCFS_SUBDIR@ \
@SNMP_SUBDIR@ \
+ libcfs \
lnet \
lustre
DIST_SUBDIRS := ldiskfs \
lustre-iokit \
- @LIBCFS_SUBDIR@ \
@SNMP_DIST_SUBDIR@ \
+ libcfs \
lnet \
lustre \
config
AM_CONDITIONAL([BUILD_LUSTREIOKIT], [test "x$enable_iokit" = xyes])
]) # LB_PATH_LUSTREIOKIT
-# Define no libcfs by default.
-AC_DEFUN([LB_LIBCFS_DIR], [
-AS_IF([test "x$libcfs_is_module" = xyes], [
- LIBCFS_INCLUDE_DIR="libcfs/include"
- LIBCFS_SUBDIR="libcfs"
- ], [
- LIBCFS_INCLUDE_DIR="lnet/include"
- LIBCFS_SUBDIR=""
- ])
-AC_SUBST(LIBCFS_INCLUDE_DIR)
-AC_SUBST(LIBCFS_SUBDIR)
-]) # LB_LIBCFS_DIR
-
#
# LB_LIBMOUNT
#
CC="$CC -m64"
])
-CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lnet/include/uapi -I$PWD/lustre/include -I$PWD/lustre/include/uapi $CPPFLAGS"
+# UAPI headers, libcfs/include for util headers, lustre/include for liblustreapi and friends
+CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/include/uapi -I$PWD/lustre/include -I$PWD/lustre/include/uapi $CPPFLAGS"
CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
AC_SUBST(CCASFLAGS)
-# everyone builds against lnet and lustre
-EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include"
+# everyone builds against lnet and lustre kernel headers
+EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/libcfs/include -I$PWD/libcfs/include/libcfs -I$PWD/lnet/include/uapi -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include"
AC_SUBST(EXTRA_KCFLAGS)
]) # LB_PROG_CC
LB_DOWNSTREAM_RELEASE
LB_USES_DPKG
-LB_LIBCFS_DIR
-
LB_INCLUDE_RULES
LB_PATH_DEFAULTS
/* Sparse annotation. */
#define __user
-#include <uapi/linux/lnet/libcfs_ioctl.h>
+#include <linux/lnet/libcfs_ioctl.h>
#define LIBCFS_IOC_INIT(data) \
do { \
#include <linux/types.h>
#include <linux/ioctl.h>
+/*
+ * sparse kernel source annotations
+ */
+#ifndef __user
+#define __user
+#endif
+
#define LIBCFS_IOCTL_VERSION 0x0001000a
#define LIBCFS_IOCTL_VERSION2 0x0001000b
#define __UAPI_LNET_DLC_H_
#include <linux/types.h>
-/*
- * This is due to us being out of kernel and the way the OpenSFS branch
- * handles CFLAGS.
- */
-#ifdef __KERNEL__
-# include <uapi/linux/lnet/libcfs_ioctl.h>
-# include <uapi/linux/lnet/lnet-types.h>
-#else
-# include <linux/lnet/libcfs_ioctl.h>
-# include <linux/lnet/lnet-types.h>
-#endif
+#include <linux/lnet/libcfs_ioctl.h>
+#include <linux/lnet/lnet-types.h>
#define MAX_NUM_SHOW_ENTRIES 32
#define LNET_MAX_STR_LEN 128
#define LNET_RT_MULTI_HOP (1 << 1)
/*
+ * sparse kernel source annotations
+ */
+#ifndef __user
+#define __user
+#endif
+
+/*
* To allow for future enhancements to extend the tunables
* add a hdr to this structure, so that the version can be set
* and checked for backwards compatibility. Newer versions of LNet
__u32 op_param;
__u32 ping_count;
__u32 ping_flags;
- bool mr_info;
+ __u32 mr_info;
struct lnet_process_id ping_id;
struct lnet_process_id __user *ping_buf;
};
lnet_nid_t prcfg_prim_nid;
lnet_nid_t prcfg_cfg_nid;
__u32 prcfg_count;
- bool prcfg_mr;
+ __u32 prcfg_mr;
__u32 prcfg_state;
__u32 prcfg_size;
void __user *prcfg_bulk;
struct lnet_ioctl_reset_health_cfg {
struct libcfs_ioctl_hdr rh_hdr;
- enum lnet_health_type rh_type;
- bool rh_all;
- int rh_value;
+ enum lnet_health_type rh_type:32;
+ __u16 rh_all:1;
+ __s16 rh_value;
lnet_nid_t rh_nid;
};
struct lnet_ioctl_recovery_list {
struct libcfs_ioctl_hdr rlst_hdr;
- enum lnet_health_type rlst_type;
- int rlst_num_nids;
+ enum lnet_health_type rlst_type:32;
+ __u32 rlst_num_nids;
lnet_nid_t rlst_nid_array[LNET_MAX_SHOW_NUM_NID];
};
#define __UAPI_LNETCTL_H_
#include <linux/types.h>
-/*
- * This is due to us being out of kernel and the way the OpenSFS branch
- * handles CFLAGS.
- */
-#ifdef __KERNEL__
-# include <uapi/linux/lnet/lnet-types.h>
-#else
-# include <linux/lnet/lnet-types.h>
-#endif
-
-#include <stdbool.h>
+#include <linux/lnet/lnet-types.h>
/** \addtogroup lnet_fault_simulation
* @{ */
/** error type mask */
__u32 da_health_error_mask;
/** randomize error generation */
- bool da_random;
+ __u32 da_random:1,
/** drop all messages if flag is set */
- bool da_drop_all;
+ da_drop_all:1;
} drop;
/** message latency simulation */
struct {
#define __UAPI_LNET_ST_H__
#include <linux/types.h>
+#include <linux/lnet/lnet-types.h>
+#include <linux/time.h>
#define LST_FEAT_NONE (0)
#define LST_FEAT_BULK_LEN (1 << 0) /* enable variable page size */
#define LSTIO_BATCH_QUERY 0xC27 /* query batch status */
#define LSTIO_STAT_QUERY 0xC30 /* get stats */
+/*
+ * sparse kernel source annotations
+ */
+#ifndef __user
+#define __user
+#endif
+
struct lst_sid {
lnet_nid_t ses_nid; /* nid of console node */
__s64 ses_stamp; /* time stamp in milliseconds */
}; /*** test/batch verbose information entry,
*** for list_batch command */
+/* This will go away once we move to netlink */
+#if !defined(__KERNEL__) && !defined(__LIBCFS_UTIL_LIST_H__)
+struct list_head {
+ struct list_head *next, *prev;
+};
+#endif
+
struct lstcon_rpc_ent {
struct list_head rpe_link; /* link chain */
struct lnet_process_id rpe_peer; /* peer's id */
#define _LNET_NIDSTRINGS_H
#include <linux/types.h>
-/*
- * This is due to us being out of kernel and the way the OpenSFS branch
- * handles CFLAGS.
- */
-#ifdef __KERNEL__
-# include <uapi/linux/lnet/lnet-types.h>
-#else
-# include <linux/lnet/lnet-types.h>
-#endif
+#include <linux/lnet/lnet-types.h>
/**
* Lustre Network Driver types.
char *libcfs_next_nidstring(void);
int libcfs_isknown_lnd(__u32 lnd);
char *libcfs_lnd2modname(__u32 lnd);
-char *libcfs_lnd2str_r(__u32 lnd, char *buf, size_t buf_size);
+char *libcfs_lnd2str_r(__u32 lnd, char *buf, __kernel_size_t buf_size);
static inline char *libcfs_lnd2str(__u32 lnd)
{
return libcfs_lnd2str_r(lnd, libcfs_next_nidstring(),
LNET_NIDSTR_SIZE);
}
int libcfs_str2lnd(const char *str);
-char *libcfs_net2str_r(__u32 net, char *buf, size_t buf_size);
+char *libcfs_net2str_r(__u32 net, char *buf, __kernel_size_t buf_size);
static inline char *libcfs_net2str(__u32 net)
{
return libcfs_net2str_r(net, libcfs_next_nidstring(),
LNET_NIDSTR_SIZE);
}
-char *libcfs_nid2str_r(lnet_nid_t nid, char *buf, size_t buf_size);
+char *libcfs_nid2str_r(lnet_nid_t nid, char *buf, __kernel_size_t buf_size);
static inline char *libcfs_nid2str(lnet_nid_t nid)
{
return libcfs_nid2str_r(nid, libcfs_next_nidstring(),
int cfs_ip_addr_parse(char *str, int len, struct list_head *list);
int cfs_ip_addr_match(__u32 addr, struct list_head *list);
int cfs_nidrange_find_min_max(struct list_head *nidlist, char *min_nid,
- char *max_nid, size_t nidstr_length);
+ char *max_nid, __kernel_size_t nidstr_length);
struct netstrfns {
__u32 nf_type;
char *nf_name;
char *nf_modname;
- void (*nf_addr2str)(__u32 addr, char *str, size_t size);
+ void (*nf_addr2str)(__u32 addr, char *str, __kernel_size_t size);
int (*nf_str2addr)(const char *str, int nob, __u32 *addr);
int (*nf_parse_addrlist)(char *str, int len,
struct list_head *list);
routerstat_LDADD = $(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la
lst_SOURCES = lst.c
+lst_CFLAGS = -fPIC -D_LINUX_TIME_H -D_GNU_SOURCE
lst_LDADD = $(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la \
$(LIBEFENCE)
lib_LTLIBRARIES = liblnetconfig.la
liblnetconfig_la_SOURCES = liblnetconfig.c liblnetconfig.h \
- liblnetconfig_lnd.c liblnd.h cyaml.c \
- $(top_builddir)/lnet/include/cyaml.h
+ liblnetconfig_lnd.c liblnd.h cyaml.c cyaml.h
liblnetconfig_la_CPPFLAGS = -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
- -DLUSTRE_UTILS=1 -I$(top_builddir)/lnet/include
+ -DLUSTRE_UTILS=1 -fPIC
liblnetconfig_la_LDFLAGS = -L$(top_builddir)/libcfs/libcfs -lyaml -lm \
$(LIBREADLINE) -version-info 4:0:0
liblnetconfig_la_LIBADD = $(top_builddir)/libcfs/libcfs/libcfs.la
#include <limits.h>
#include <libcfs/util/ioctl.h>
#include <libcfs/util/parser.h>
-#include <cyaml.h>
+#include "lnetconfig/cyaml.h"
#include "lnetconfig/liblnetconfig.h"
#define LNET_CONFIGURE true
#
AC_DEFUN([LC_CONFIG_SRCDIR], [
AC_CONFIG_SRCDIR([lustre/obdclass/obdo.c])
-libcfs_is_module="yes"
ldiskfs_is_ext4="yes"
])
*/
#include <linux/rcupdate.h>
-#ifdef HAVE_REFCOUNT_T
#include <linux/refcount.h>
-#else
-#include <libcfs/linux/linux-refcount.h>
-#endif
#include <linux/spinlock.h>
#include <libcfs/libcfs.h>
#include <linux/atomic.h>
#include <linux/list.h>
#include <linux/mutex.h>
-#ifdef HAVE_REFCOUNT_T
#include <linux/refcount.h>
-#else
-#include <libcfs/linux/linux-refcount.h>
-#endif
#include <linux/spinlock.h>
#include <linux/time.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/list.h>
-#ifdef HAVE_PROCESSOR_H
#include <linux/processor.h>
-#else
-#include <libcfs/linux/processor.h>
-#endif
#include <linux/random.h>
#include <libcfs/libcfs.h>
}
run_test 203 "add a network using an interface in the non-default namespace"
+test_300() {
+ # LU-13274
+ local header
+ local out=$TMP/$tfile
+ local prefix=/usr/include/linux/lnet
+
+ # We use a hard coded prefix so that this test will not fail
+ # when run in tree.
+ CC=${CC:-cc}
+ if ! which $CC > /dev/null 2>&1; then
+ skip_env "$CC is not installed"
+ fi
+
+ cleanup_lnet || exit 1
+ load_lnet
+
+ if ! [[ -d $prefix ]]; then
+ # Assume we're running in tree and fixup the include path.
+ prefix=$LUSTRE/../lnet/include/uapi/linux/lnet
+ fi
+
+ for header in $prefix/*.h; do
+ if ! [[ -f "$header" ]]; then
+ continue
+ fi
+
+ $CC -Wall -Werror -std=c99 -include $header -c -x c /dev/null -o $out ||
+ error "cannot compile '$header'"
+ done
+ rm -f $out
+}
+run_test 300 "packaged LNet UAPI headers can be compiled"
+
complete $SECONDS
cleanup_testsuite
lctl_DEPENDENCIES := liblustreapi.la
lfs_SOURCES = lfs.c lfs_project.c lfs_project.h
+lfs_CFLAGS := -fPIC -I $(top_builddir)/lnet/utils
lfs_LDADD := liblustreapi.la -lz
lfs_LDADD += $(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la
lfs_DEPENDENCIES := liblustreapi.la
#include <linux/lustre/lustre_ver.h>
#include <linux/lustre/lustre_param.h>
#include <linux/lnet/nidstr.h>
-#include <cyaml.h>
+#include <lnetconfig/cyaml.h>
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))