CC="$CC -m64"
])
-CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include -I$PWD/lustre/include/uapi $CPPFLAGS"
+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"
CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
AC_SUBST(CCASFLAGS)
libcfs_fail.h \
libcfs_hash.h \
libcfs_heap.h \
- libcfs_ioctl.h \
libcfs_prim.h \
libcfs_private.h \
libcfs_string.h \
#ifndef __LIBCFS_LIBCFS_H__
#define __LIBCFS_LIBCFS_H__
-#ifdef __KERNEL__
-# include <libcfs/linux/libcfs.h>
-# include "curproc.h"
+#include <uapi/linux/lnet/libcfs_ioctl.h>
+#include <libcfs/linux/libcfs.h>
+#include <libcfs/libcfs_debug.h>
+#include <libcfs/libcfs_private.h>
+#include <libcfs/bitmap.h>
+#include <libcfs/libcfs_cpu.h>
+#include <libcfs/libcfs_prim.h>
+#include <libcfs/libcfs_time.h>
+#include <libcfs/libcfs_string.h>
+#include <libcfs/libcfs_workitem.h>
+#include <libcfs/libcfs_hash.h>
+#include <libcfs/libcfs_heap.h>
+#include <libcfs/libcfs_fail.h>
+#include "curproc.h"
#define LIBCFS_VERSION "0.5.0"
/* seed the generator */
void cfs_srand(unsigned int, unsigned int);
void cfs_get_random_bytes(void *buf, int size);
-#endif /* __KERNEL__ */
-
-#include <libcfs/libcfs_debug.h>
-#ifdef __KERNEL__
-# include <libcfs/libcfs_private.h>
-# include <libcfs/bitmap.h>
-# include <libcfs/libcfs_cpu.h>
-# include <libcfs/libcfs_ioctl.h>
-# include <libcfs/libcfs_prim.h>
-# include <libcfs/libcfs_time.h>
-# include <libcfs/libcfs_string.h>
-# include <libcfs/libcfs_workitem.h>
-# include <libcfs/libcfs_hash.h>
-# include <libcfs/libcfs_heap.h>
-# include <libcfs/libcfs_fail.h>
int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
int libcfs_ioctl(unsigned long cmd, void __user *uparam);
#define container_of0(ptr, type, member) \
((type *)__container_of((ptr), offsetof(type, member)))
-#endif /* __KERNEL__ */
-
#endif /* _LIBCFS_LIBCFS_H_ */
#ifndef __LIBCFS_DEBUG_H__
#define __LIBCFS_DEBUG_H__
+#include <uapi/linux/lnet/libcfs_debug.h>
+
/*
* Debugging
*/
extern unsigned int libcfs_catastrophe;
extern unsigned int libcfs_panic_on_lbug;
-/**
- * Format for debug message headers
- */
-struct ptldebug_header {
- __u32 ph_len;
- __u32 ph_flags;
- __u32 ph_subsys;
- __u32 ph_mask;
- __u16 ph_cpu_id;
- __u16 ph_type;
- /* time_t overflow in 2106 */
- __u32 ph_sec;
- __u64 ph_usec;
- __u32 ph_stack;
- __u32 ph_pid;
- __u32 ph_extern_pid;
- __u32 ph_line_num;
-} __attribute__((packed));
-
-
-#define PH_FLAG_FIRST_RECORD 1
-
-/* Debugging subsystems (32 bits, non-overlapping) */
-#define S_UNDEFINED 0x00000001
-#define S_MDC 0x00000002
-#define S_MDS 0x00000004
-#define S_OSC 0x00000008
-#define S_OST 0x00000010
-#define S_CLASS 0x00000020
-#define S_LOG 0x00000040
-#define S_LLITE 0x00000080
-#define S_RPC 0x00000100
-#define S_MGMT 0x00000200
-#define S_LNET 0x00000400
-#define S_LND 0x00000800 /* ALL LNDs */
-#define S_PINGER 0x00001000
-#define S_FILTER 0x00002000
-/* unused */
-#define S_ECHO 0x00008000
-#define S_LDLM 0x00010000
-#define S_LOV 0x00020000
-#define S_LQUOTA 0x00040000
-#define S_OSD 0x00080000
-#define S_LFSCK 0x00100000
-#define S_SNAPSHOT 0x00200000
-/* unused */
-#define S_LMV 0x00800000 /* b_new_cmd */
-/* unused */
-#define S_SEC 0x02000000 /* upcall cache */
-#define S_GSS 0x04000000 /* b_new_cmd */
-/* unused */
-#define S_MGC 0x10000000
-#define S_MGS 0x20000000
-#define S_FID 0x40000000 /* b_new_cmd */
-#define S_FLD 0x80000000 /* b_new_cmd */
-
-#define LIBCFS_DEBUG_SUBSYS_NAMES { \
- "undefined", "mdc", "mds", "osc", "ost", "class", "log", \
- "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", "", \
- "echo", "ldlm", "lov", "lquota", "osd", "lfsck", "snapshot", "",\
- "lmv", "", "sec", "gss", "", "mgc", "mgs", "fid", "fld", NULL }
-
-/* Debugging masks (32 bits, non-overlapping) */
-#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */
-#define D_INODE 0x00000002
-#define D_SUPER 0x00000004
-#define D_EXT2 0x00000008 /* anything from ext2_debug */
-#define D_MALLOC 0x00000010 /* print malloc, free information */
-#define D_CACHE 0x00000020 /* cache-related items */
-#define D_INFO 0x00000040 /* general information */
-#define D_IOCTL 0x00000080 /* ioctl related information */
-#define D_NETERROR 0x00000100 /* network errors */
-#define D_NET 0x00000200 /* network communications */
-#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */
-#define D_BUFFS 0x00000800
-#define D_OTHER 0x00001000
-#define D_DENTRY 0x00002000
-#define D_NETTRACE 0x00004000
-#define D_PAGE 0x00008000 /* bulk page handling */
-#define D_DLMTRACE 0x00010000
-#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */
-#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */
-#define D_HA 0x00080000 /* recovery and failover */
-#define D_RPCTRACE 0x00100000 /* for distributed debugging */
-#define D_VFSTRACE 0x00200000
-#define D_READA 0x00400000 /* read-ahead */
-#define D_MMAP 0x00800000
-#define D_CONFIG 0x01000000
-#define D_CONSOLE 0x02000000
-#define D_QUOTA 0x04000000
-#define D_SEC 0x08000000
-#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */
-#define D_HSM 0x20000000
-#define D_SNAPSHOT 0x40000000 /* snapshot */
-#define D_LAYOUT 0x80000000
-
-#define LIBCFS_DEBUG_MASKS_NAMES { \
- "trace", "inode", "super", "ext2", "malloc", "cache", "info", \
- "ioctl", "neterror", "net", "warning", "buffs", "other", \
- "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
- "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
- "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\
- NULL }
-
-#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
-
#ifndef DEBUG_SUBSYSTEM
# define DEBUG_SUBSYSTEM S_UNDEFINED
#endif
.msg_cdls = (cdls) }; \
dataname.msg_mask = (mask);
-#ifdef __KERNEL__
-
-# ifdef CDEBUG_ENABLED
+#ifdef CDEBUG_ENABLED
/**
* Filters out logging messages based on mask and subsystem.
# warning "CDEBUG IS DISABLED. THIS SHOULD NEVER BE DONE FOR PRODUCTION!"
# endif /* CDEBUG_ENABLED */
-#else /* !__KERNEL__ */
-static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
-{
- return 0;
-}
-# define CDEBUG(mask, format, ...) \
-do { \
- if (((mask) & D_CANTMASK) != 0) \
- fprintf(stderr, "(%s:%d:%s()) " format, \
- __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__);\
-} while (0)
-
-# define CDEBUG_LIMIT CDEBUG
-
-#endif /* __KERNEL__ */
-
/*
* Lustre Error Checksum: calculates checksum
* of Hex number by XORing each bit.
#define LCONSOLE_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
-#if defined(CDEBUG_ENTRY_EXIT) && defined(__KERNEL__)
+#if defined(CDEBUG_ENTRY_EXIT)
void libcfs_log_goto(struct libcfs_debug_msg_data *goto_data,
const char *label, long rc);
# define ENTRY CDEBUG(D_TRACE, "Process entered\n")
# define EXIT CDEBUG(D_TRACE, "Process leaving\n")
-#else /* !CDEBUG_ENTRY_EXIT || !__KERNEL__ */
+#else /* !CDEBUG_ENTRY_EXIT */
# define GOTO(label, rc) \
do { \
# define ENTRY do { } while (0)
# define EXIT do { } while (0)
-#endif /* CDEBUG_ENTRY_EXIT && __KERNEL__ */
+#endif /* CDEBUG_ENTRY_EXIT */
#define RETURN_EXIT \
do { \
va_list args, const char *format2, ...)
__attribute__ ((format (printf, 4, 5)));
-#ifdef __KERNEL__
/* other external symbols that tracefile provides: */
extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char __user *usr_buffer,
int usr_buffer_nob);
extern int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob,
const char *knl_buffer, char *append);
-#endif /* __KERNEL__ */
#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
/* Sparse annotation. */
#define __user
-#include <libcfs/libcfs_ioctl.h>
+#include <uapi/linux/lnet/libcfs_ioctl.h>
#define LIBCFS_IOC_INIT(data) \
do { \
#include <linux/types.h>
#include <libcfs/util/ioctl.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
struct ioc_dev {
const char * dev_name;
#include <string.h>
#include <libcfs/util/string.h>
-#include <lnet/types.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/lnet-types.h>
+#include <linux/lnet/nidstr.h>
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
lnet/doc/Makefile
lnet/include/Makefile
lnet/include/lnet/Makefile
+lnet/include/uapi/linux/lnet/Makefile
lnet/klnds/Makefile
lnet/klnds/autoMakefile
lnet/klnds/o2iblnd/Makefile
-SUBDIRS = lnet
+SUBDIRS = lnet uapi/linux/lnet
-lnetdir=$(includedir)/lnet
-
EXTRA_DIST = \
api.h \
- lib-dlc.h \
lib-lnet.h \
lib-types.h \
- lnet.h \
- lnetctl.h \
- lnetst.h \
- nidstr.h \
- socklnd.h \
- types.h
+ socklnd.h
# error This include is only for kernel use.
#endif
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
/** \defgroup lnet_init_fini Initialization and cleanup
* The LNet must be properly initialized before any LNet calls can be made.
#include <libcfs/libcfs.h>
#include <lnet/api.h>
-#include <lnet/lnet.h>
#include <lnet/lib-types.h>
+#include <uapi/linux/lnet/lnet-dlc.h>
+#include <uapi/linux/lnet/lnet-types.h>
+#include <uapi/linux/lnet/lnetctl.h>
+#include <uapi/linux/lnet/nidstr.h>
extern struct lnet the_lnet; /* THE network */
#include <linux/uio.h>
#include <linux/types.h>
-#include <lnet/lnetctl.h>
+#include <uapi/linux/lnet/lnet-dlc.h>
+#include <uapi/linux/lnet/lnetctl.h>
/* Max payload size */
#ifndef CONFIG_LNET_MAX_PAYLOAD
* Lustre is a trademark of Sun Microsystems, Inc.
*
* lnet/include/lnet/socklnd.h
- *
- * #defines shared between socknal implementation and utilities
*/
#ifndef __LNET_LNET_SOCKLND_H__
#define __LNET_LNET_SOCKLND_H__
-#include <lnet/types.h>
-
-#define SOCKLND_CONN_NONE (-1)
-#define SOCKLND_CONN_ANY 0
-#define SOCKLND_CONN_CONTROL 1
-#define SOCKLND_CONN_BULK_IN 2
-#define SOCKLND_CONN_BULK_OUT 3
-#define SOCKLND_CONN_NTYPES 4
-
-#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN
+#include <uapi/linux/lnet/lnet-types.h>
+#include <uapi/linux/lnet/socklnd.h>
struct ksock_hello_msg {
__u32 kshm_magic; /* magic number of socklnd message */
--- /dev/null
+/Makefile.in
--- /dev/null
+#
+# GPL HEADER START
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 only,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License version 2 for more details (a copy is included
+# in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU General Public License
+# version 2 along with this program; If not, see
+# http://www.gnu.org/licenses/gpl-2.0.html
+#
+# GPL HEADER END
+#
+
+#
+# Copyright (c) 2017, James Simmons <jsimmons@infradead.org>
+#
+
+#
+# This file is part of Lustre, http://www.lustre.org/
+# Lustre is a trademark of Seagate, Inc.
+#
+
+lnetincludedir = /usr/include/linux/lnet
+lnetinclude_HEADERS = \
+ libcfs_debug.h \
+ libcfs_ioctl.h \
+ lnetctl.h \
+ lnet-dlc.h \
+ lnetst.h \
+ lnet-types.h \
+ nidstr.h \
+ socklnd.h
+
+EXTRA_DIST = \
+ libcfs_debug.h \
+ libcfs_ioctl.h \
+ lnetctl.h \
+ lnet-dlc.h \
+ lnetst.h \
+ lnet-types.h \
+ nidstr.h \
+ socklnd.h
--- /dev/null
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, 2014, Intel Corporation.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * libcfs/include/libcfs/libcfs_debug.h
+ *
+ * Debug messages and assertions
+ *
+ */
+
+#ifndef __UAPI_LIBCFS_DEBUG_H__
+#define __UAPI_LIBCFS_DEBUG_H__
+
+/**
+ * Format for debug message headers
+ */
+struct ptldebug_header {
+ __u32 ph_len;
+ __u32 ph_flags;
+ __u32 ph_subsys;
+ __u32 ph_mask;
+ __u16 ph_cpu_id;
+ __u16 ph_type;
+ /* time_t overflow in 2106 */
+ __u32 ph_sec;
+ __u64 ph_usec;
+ __u32 ph_stack;
+ __u32 ph_pid;
+ __u32 ph_extern_pid;
+ __u32 ph_line_num;
+} __attribute__((packed));
+
+#define PH_FLAG_FIRST_RECORD 1
+
+/* Debugging subsystems (32 bits, non-overlapping) */
+#define S_UNDEFINED 0x00000001
+#define S_MDC 0x00000002
+#define S_MDS 0x00000004
+#define S_OSC 0x00000008
+#define S_OST 0x00000010
+#define S_CLASS 0x00000020
+#define S_LOG 0x00000040
+#define S_LLITE 0x00000080
+#define S_RPC 0x00000100
+#define S_MGMT 0x00000200
+#define S_LNET 0x00000400
+#define S_LND 0x00000800 /* ALL LNDs */
+#define S_PINGER 0x00001000
+#define S_FILTER 0x00002000
+#define S_LIBCFS 0x00004000
+#define S_ECHO 0x00008000
+#define S_LDLM 0x00010000
+#define S_LOV 0x00020000
+#define S_LQUOTA 0x00040000
+#define S_OSD 0x00080000
+#define S_LFSCK 0x00100000
+#define S_SNAPSHOT 0x00200000
+/* unused */
+#define S_LMV 0x00800000 /* b_new_cmd */
+/* unused */
+#define S_SEC 0x02000000 /* upcall cache */
+#define S_GSS 0x04000000 /* b_new_cmd */
+/* unused */
+#define S_MGC 0x10000000
+#define S_MGS 0x20000000
+#define S_FID 0x40000000 /* b_new_cmd */
+#define S_FLD 0x80000000 /* b_new_cmd */
+
+#define LIBCFS_DEBUG_SUBSYS_NAMES { \
+ "undefined", "mdc", "mds", "osc", "ost", "class", "log", \
+ "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \
+ "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \
+ "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \
+ "fid", "fld", NULL }
+
+/* Debugging masks (32 bits, non-overlapping) */
+#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */
+#define D_INODE 0x00000002
+#define D_SUPER 0x00000004
+#define D_EXT2 0x00000008 /* anything from ext2_debug */
+#define D_MALLOC 0x00000010 /* print malloc, free information */
+#define D_CACHE 0x00000020 /* cache-related items */
+#define D_INFO 0x00000040 /* general information */
+#define D_IOCTL 0x00000080 /* ioctl related information */
+#define D_NETERROR 0x00000100 /* network errors */
+#define D_NET 0x00000200 /* network communications */
+#define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */
+#define D_BUFFS 0x00000800
+#define D_OTHER 0x00001000
+#define D_DENTRY 0x00002000
+#define D_NETTRACE 0x00004000
+#define D_PAGE 0x00008000 /* bulk page handling */
+#define D_DLMTRACE 0x00010000
+#define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */
+#define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */
+#define D_HA 0x00080000 /* recovery and failover */
+#define D_RPCTRACE 0x00100000 /* for distributed debugging */
+#define D_VFSTRACE 0x00200000
+#define D_READA 0x00400000 /* read-ahead */
+#define D_MMAP 0x00800000
+#define D_CONFIG 0x01000000
+#define D_CONSOLE 0x02000000
+#define D_QUOTA 0x04000000
+#define D_SEC 0x08000000
+#define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */
+#define D_HSM 0x20000000
+#define D_SNAPSHOT 0x40000000 /* snapshot */
+#define D_LAYOUT 0x80000000
+
+#define LIBCFS_DEBUG_MASKS_NAMES { \
+ "trace", "inode", "super", "ext2", "malloc", "cache", "info", \
+ "ioctl", "neterror", "net", "warning", "buffs", "other", \
+ "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
+ "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
+ "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\
+ NULL }
+
+#define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
+
+#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
+
+#endif /* __UAPI_LIBCFS_DEBUG_H__ */
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * libcfs/include/libcfs/libcfs_ioctl.h
- *
* Low-level ioctl data structures. Kernel ioctl functions declared here,
* and user space functions are in libcfs/util/ioctl.h.
*
*/
-#ifndef __LIBCFS_IOCTL_H__
-#define __LIBCFS_IOCTL_H__
+#ifndef __UAPI_LIBCFS_IOCTL_H__
+#define __UAPI_LIBCFS_IOCTL_H__
#include <linux/types.h>
#include <linux/ioctl.h>
char ioc_bulk[0];
};
-struct libcfs_debug_ioctl_data
-{
+struct libcfs_debug_ioctl_data {
struct libcfs_ioctl_hdr hdr;
unsigned int subs;
unsigned int debug;
extern int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
-#endif /* __LIBCFS_IOCTL_H__ */
+#endif /* __UAPI_LIBCFS_IOCTL_H__ */
* Author: Amir Shehata <amir.shehata@intel.com>
*/
-#ifndef LNET_DLC_H
-#define LNET_DLC_H
+#ifndef __UAPI_LNET_DLC_H_
+#define __UAPI_LNET_DLC_H_
-#include <libcfs/libcfs_ioctl.h>
-#include <lnet/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
#define MAX_NUM_SHOW_ENTRIES 32
#define LNET_MAX_STR_LEN 128
struct lnet_counters st_cntrs;
};
-#endif /* LNET_DLC_H */
+#endif /* _LNET_DLC_H_ */
* Lustre is a trademark of Sun Microsystems, Inc.
*/
-#ifndef __LNET_TYPES_H__
-#define __LNET_TYPES_H__
+#ifndef __UAPI_LNET_TYPES_H__
+#define __UAPI_LNET_TYPES_H__
/** \addtogroup lnet
* @{ */
/*
* Copyright (c) 2014, Intel Corporation.
*/
-#ifndef _LNETCTL_H_
-#define _LNETCTL_H_
+#ifndef __UAPI_LNETCTL_H_
+#define __UAPI_LNETCTL_H_
-#include <lnet/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
/** \addtogroup lnet_fault_simulation
* @{ */
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * lnet/include/lnet/lnetst.h
- *
* Author: Liang Zhen <liangzhen@clusterfs.com>
*/
-#ifndef __LNET_ST_H__
-#define __LNET_ST_H__
+#ifndef __UAPI_LNET_ST_H__
+#define __UAPI_LNET_ST_H__
#define LST_FEAT_NONE (0)
#define LST_FEAT_BULK_LEN (1 << 0) /* enable variable page size */
*/
#ifndef _LNET_NIDSTRINGS_H
#define _LNET_NIDSTRINGS_H
-#include <lnet/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
/**
* Lustre Network Driver types.
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
- *
- * Copyright (c) 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LNET_H__
-#define __LNET_H__
-
-/*
- * lnet.h
*
- * User application interface file
+ * #defines shared between socknal implementation and utilities
*/
+#ifndef __UAPI_LNET_SOCKLND_H__
+#define __UAPI_LNET_SOCKLND_H__
+
+#define SOCKLND_CONN_NONE (-1)
+#define SOCKLND_CONN_ANY 0
+#define SOCKLND_CONN_CONTROL 1
+#define SOCKLND_CONN_BULK_IN 2
+#define SOCKLND_CONN_BULK_OUT 3
+#define SOCKLND_CONN_NTYPES 4
-#include <lnet/types.h>
-#include <lnet/lib-dlc.h>
-#include <lnet/nidstr.h>
+#define SOCKLND_CONN_ACK SOCKLND_CONN_BULK_IN
#endif
#define DEBUG_SUBSYSTEM S_LND
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
#include <lnet/lib-lnet.h>
#define IBLND_PEER_HASH_SIZE 101 /* # peer_ni lists */
#include <net/tcp.h>
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
#include <lnet/lib-lnet.h>
#include <lnet/socklnd.h>
*/
#define DEBUG_SUBSYSTEM S_LNET
+
#include <lnet/lib-lnet.h>
-#include <lnet/lib-dlc.h>
+#include <uapi/linux/lnet/lnet-dlc.h>
static int config_on_load = 0;
module_param(config_on_load, int, 0444);
#define DEBUG_SUBSYSTEM S_LNET
#include <lnet/lib-lnet.h>
-#include <lnet/lnetctl.h>
+#include <uapi/linux/lnet/lnetctl.h>
#define LNET_MSG_MASK (LNET_PUT_BIT | LNET_ACK_BIT | \
LNET_GET_BIT | LNET_REPLY_BIT)
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
-#include <lnet/nidstr.h>
+#include <uapi/linux/lnet/nidstr.h>
/* max value for numeric network address */
#define MAX_NUMERIC_VALUE 0xffffffff
#define DEBUG_SUBSYSTEM S_LNET
#include <lnet/lib-lnet.h>
-#include <lnet/lib-dlc.h>
+#include <uapi/linux/lnet/lnet-dlc.h>
static void
lnet_peer_remove_from_remote_list(struct lnet_peer_ni *lpni)
#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
-#include <lnet/lnetst.h>
+#include <uapi/linux/lnet/lnetst.h>
#include "console.h"
static int
#define __LST_CONRPC_H__
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
#include <lnet/lib-types.h>
-#include <lnet/lnetst.h>
+#include <uapi/linux/lnet/lnetst.h>
#include "rpc.h"
#include "selftest.h"
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
#include <lnet/lib-types.h>
-#include <lnet/lnetst.h>
+#include <uapi/linux/lnet/lnetst.h>
#include "selftest.h"
#include "conrpc.h"
#ifndef __SELFTEST_RPC_H__
#define __SELFTEST_RPC_H__
-#include <lnet/lnetst.h>
+#include <uapi/linux/lnet/lnetst.h>
/*
* LST wired structures
#include <lnet/api.h>
#include <lnet/lib-lnet.h>
#include <lnet/lib-types.h>
-#include <lnet/lnetst.h>
+#include <uapi/linux/lnet/lnetst.h>
#include "rpc.h"
#include "timer.h"
#include <libcfs/util/ioctl.h>
#include <libcfs/util/param.h>
-#include <libcfs/libcfs_debug.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/libcfs_debug.h>
+#include <linux/lnet/lnetctl.h>
static char rawbuf[8192];
static char *buf = rawbuf;
#ifndef LIB_LND_CONFIG_API_H
#define LIB_LND_CONFIG_API_H
-#include <lnet/lib-dlc.h>
+#include <linux/lnet/socklnd.h>
+#include <linux/lnet/lnet-dlc.h>
#include "cyaml.h"
int
#include <sys/ioctl.h>
#include <net/if.h>
#include <libcfs/util/ioctl.h>
-#include <lnet/lnetctl.h>
-#include <lnet/socklnd.h>
+#include <linux/lnet/lnetctl.h>
#include "liblnd.h"
-#include <lnet/lnet.h>
#include <sys/types.h>
#include <ifaddrs.h>
#include "liblnetconfig.h"
#ifndef LIB_LNET_CONFIG_API_H
#define LIB_LNET_CONFIG_API_H
-#include <lnet/lnet.h>
+#include <libcfs/util/string.h>
+#include <linux/lnet/lnet-dlc.h>
+#include <linux/lnet/nidstr.h>
#define LUSTRE_CFG_RC_NO_ERR 0
#define LUSTRE_CFG_RC_BAD_PARAM -1
#define LUSTRE_CFG_RC_NO_MATCH -6
#define LUSTRE_CFG_RC_MATCH -7
-#include <lnet/lnet.h>
-#include <libcfs/util/string.h>
-
struct lnet_dlc_network_descr {
struct list_head network_on_rule;
__u32 nw_id;
#include <limits.h>
#include <libcfs/util/ioctl.h>
#include <libcfs/util/parser.h>
-#include <lnet/lnetctl.h>
-#include <lnet/nidstr.h>
#include <cyaml.h>
#include "lnetconfig/liblnetconfig.h"
#include <libcfs/util/list.h>
#include <libcfs/util/ioctl.h>
#include <libcfs/util/parser.h>
-#include <lnet/lnetctl.h>
-#include <lnet/lnetst.h>
-#include <lnet/lnet.h>
+#include <linux/lnet/lnetctl.h>
+#include <linux/lnet/lnetst.h>
+#include <linux/lnet/nidstr.h>
#include <utils/obdctl.h>
struct lst_sid LST_INVALID_SID = { .ses_nid = LNET_NID_ANY, .ses_stamp = -1 };
#include <libcfs/util/string.h>
#include <libcfs/util/ioctl.h>
-#include <libcfs/libcfs_debug.h>
-#include <lnet/lnetctl.h>
-#include <lnet/socklnd.h>
-#include <lnet/lnet.h>
+#include <linux/lnet/libcfs_debug.h>
+#include <linux/lnet/lnet-dlc.h>
+#include <linux/lnet/lnetctl.h>
+#include <linux/lnet/nidstr.h>
+#include <linux/lnet/socklnd.h>
unsigned int libcfs_debug;
unsigned int libcfs_printk = D_CANTMASK;
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <lnet/types.h>
+#include <linux/lnet/lnet-types.h>
#ifndef HAVE_STRNLEN
#define strnlen(s, i) strlen(s)
%endif
%{_datadir}/lustre
%{_includedir}/lustre
+%{_includedir}/linux/lnet
%endif
%{_sysconfdir}/udev/rules.d/99-lustre.rules
%config(noreplace) %{_sysconfdir}/ldev.conf
#include <asm/byteorder.h>
#include <linux/types.h>
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
#include <lustre/lustre_user.h> /* Defn's shared with user-space. */
#include <lustre_ver.h>
#include <linux/kobject.h>
#include <linux/uio.h>
#include <libcfs/libcfs.h>
-#include <lnet/nidstr.h>
#include <lnet/api.h>
+#include <uapi/linux/lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#include <lustre_ha.h>
#include <lustre_sec.h>
#define _UPCALL_CACHE_H
#include <libcfs/libcfs.h>
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
/** \defgroup ucache ucache
*
*/
#ifdef __KERNEL__
# include <lustre_dlm.h>
-#else
-# include <libcfs/libcfs.h>
#endif
#include <interval_tree.h>
# include <linux/uidgid.h>
#endif
#include "mdt_internal.h"
-#include <lnet/nidstr.h>
+#include <uapi/linux/lnet/nidstr.h>
#include <lustre_nodemap.h>
typedef enum ucred_init_type {
#include <asm/statfs.h>
#include <linux/module.h>
-#include <lnet/nidstr.h>
+#include <uapi/linux/lnet/nidstr.h>
/* LUSTRE_VERSION_CODE */
#include <lustre_ver.h>
/*
#include <obd_support.h>
#include <obd_class.h>
-#include <lnet/lnetctl.h>
+#include <uapi/linux/lnet/lnetctl.h>
#include <lustre_debug.h>
#include <lustre_kernelcomm.h>
#include <lprocfs_status.h>
#include <libcfs/libcfs.h>
#include <obd_support.h>
#include <obd_class.h>
-#include <lnet/lnetctl.h>
#include <lprocfs_status.h>
+#include <uapi/linux/lnet/lnetctl.h>
#include <uapi/linux/lustre_ioctl.h>
#include <lustre_ver.h>
#define DEBUG_SUBSYSTEM S_SEC
#include <libcfs/libcfs.h>
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
#include <upcall_cache.h>
static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
*/
#include <linux/module.h>
#include <linux/sort.h>
-#include <lnet/nidstr.h>
+#include <uapi/linux/lnet/nidstr.h>
#include <lustre_net.h>
#include <lustre_acl.h>
#include <lustre_eacl.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/types.h>
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
#include <lustre/lustre_idl.h>
#include <dt_object.h>
#include <lu_object.h>
*/
#define DEBUG_SUBSYSTEM S_RPC
+
#include <linux/kthread.h>
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_net.h>
#include <lu_object.h>
-#include <lnet/types.h>
+#include <uapi/linux/lnet/lnet-types.h>
#include "ptlrpc_internal.h"
/* The following are visible and mutable through /sys/module/ptlrpc */
*/
#define EXPORT_SYMBOL(s)
#define LASSERT assert
+#define RETURN return
+#define ENTRY
+#define EXIT
#include <../ldlm/interval_tree.c>
#include <stdio.h>
/* For basename() */
#include <libgen.h>
-#include <lnet/nidstr.h>
#include "lsupport.h"
int main(int argc, char **argv)
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#include "sk_utils.h"
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
-#include <lnet/nidstr.h>
#ifdef _NEW_BUILD_
# include "lgss_utils.h"
#else
#include <assert.h>
#include <unistd.h>
+#include <stdbool.h>
#include <stdint.h>
-#include <lnet/types.h>
+#include <libcfs/util/list.h>
+#include <linux/lnet/lnet-types.h>
+#include <linux/lnet/nidstr.h>
#define GSSD_CLI (0)
#define GSSD_SVC (1)
#include <openssl/hmac.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <lnet/nidstr.h>
#include "sk_utils.h"
#include "write_bytes.h"
#endif
#include <stdbool.h>
-#include <lnet/nidstr.h>
#include "svcgssd.h"
#include "gss_util.h"
#include <libcfs/util/param.h>
#include <libcfs/util/string.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
#include <lustre/lustre_user.h>
#include <lustre/lustre_idl.h>
#include <stdio.h>
#include <string.h>
#include <libcfs/util/parser.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
#include "obdctl.h"
#include <lustre_ver.h>
#include <libcfs/util/ioctl.h>
#include <libcfs/util/param.h>
#include <libcfs/util/string.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
#include <lustre/lustreapi.h>
#include <linux/lustre_ostid.h>
#include <linux/lustre_ioctl.h>
#include <unistd.h>
#endif
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
#include <lustre/lustre_idl.h>
#include <lustre/lustreapi.h>
#include "lustreapi_internal.h"
#endif
#include <linux/types.h>
#include <linux/version.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
#include <lustre_ver.h>
#ifdef HAVE_SELINUX
#include <linux/magic.h>
#include <errno.h>
#include <time.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
#include <linux/lustre_fid.h>
#include <linux/lustre_ostid.h>
#include <lustre/lustreapi.h>
#include <libcfs/util/string.h>
#include <libcfs/util/param.h>
#include <libcfs/util/parser.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
+#include <linux/lnet/lnetctl.h>
#include <linux/lustre_cfg.h>
#include <linux/lustre_ioctl.h>
#include <lustre_ver.h>
#include <string.h>
#include "obdctl.h"
-#include <lnet/lnetctl.h>
#include <stdio.h>
static char * lcfg_devname;
#include "lustreapi_internal.h"
#include <lustre/lustre_lfsck_user.h>
-#include <lnet/lnetctl.h>
+#include <linux/lnet/lnetctl.h>
#include <linux/lustre_ioctl.h>
/* Needs to be last to avoid clashes */
#include <libcfs/util/ioctl.h>
#include <sys/xattr.h>
#include <linux/types.h>
-#include <libcfs/libcfs_debug.h>
#include <libcfs/util/string.h>
#include <libcfs/util/parser.h>
+#include <linux/lnet/libcfs_debug.h>
#include <lustre/lustreapi.h>
#include "lustre_rsync.h"
#include <getopt.h>
#include <limits.h>
#include <ctype.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
+#include <linux/lnet/lnetctl.h>
#include <linux/lustre_param.h>
-#include <lnet/lnetctl.h>
#include <lustre_ver.h>
#include "mount_utils.h"
#include <lustre_ver.h>
#include <ctype.h>
#include <limits.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
#include <libcfs/util/string.h>
#include "obdctl.h"
#include <libcfs/util/parser.h>
#include <libcfs/util/string.h>
-#include <lnet/nidstr.h>
+#include <linux/lnet/nidstr.h>
+#include <linux/lnet/lnetctl.h>
#include <linux/lustre_ostid.h>
#include <linux/lustre_cfg.h>
#include <linux/lustre_ioctl.h>
#include <lustre_ver.h>
-#include <lnet/lnetctl.h>
#include <lustre/lustreapi.h>
#include <linux/lustre_param.h>
#include <lustre/lustre_barrier_user.h>