#ifndef __LIBCFS_PRIVATE_H__
#define __LIBCFS_PRIVATE_H__
-/* XXX this layering violation is for nidstrings */
-#include <lnet/types.h>
-
#ifndef DEBUG_SUBSYSTEM
# define DEBUG_SUBSYSTEM S_UNDEFINED
#endif
*/
#define CLASSERT(cond) do {switch (1) {case (cond): case 0: break; } } while (0)
-/* support decl needed both by kernel and liblustre */
-int libcfs_isknown_lnd(int type);
-char *libcfs_lnd2modname(int type);
-char *libcfs_lnd2str(int type);
-int libcfs_str2lnd(const char *str);
-char *libcfs_net2str(__u32 net);
-char *libcfs_nid2str(lnet_nid_t nid);
-__u32 libcfs_str2net(const char *str);
-lnet_nid_t libcfs_str2nid(const char *str);
-int libcfs_str2anynid(lnet_nid_t *nid, const char *str);
-char *libcfs_id2str(lnet_process_id_t id);
-void cfs_free_nidlist(struct list_head *list);
-int cfs_parse_nidlist(char *str, int len, struct list_head *list);
-int cfs_print_nidlist(char *buffer, int count,
- struct list_head *list);
-int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
-bool cfs_nidrange_is_contiguous(struct list_head *nidlist);
-void cfs_nidrange_find_min_max(struct list_head *nidlist,
- char *min_nid, char *max_nid,
- int nidstr_length);
-
-/** \addtogroup lnet_addr
- * @{ */
-/* how an LNET NID encodes net:address */
-/** extract the address part of an lnet_nid_t */
-#define LNET_NIDADDR(nid) ((__u32)((nid) & 0xffffffff))
-/** extract the network part of an lnet_nid_t */
-#define LNET_NIDNET(nid) ((__u32)(((nid) >> 32)) & 0xffffffff)
-/** make an lnet_nid_t from a network part and an address part */
-#define LNET_MKNID(net,addr) ((((__u64)(net))<<32)|((__u64)(addr)))
-/* how net encodes type:number */
-#define LNET_NETNUM(net) ((net) & 0xffff)
-#define LNET_NETTYP(net) (((net) >> 16) & 0xffff)
-#define LNET_MKNET(typ,num) ((((__u32)(typ))<<16)|((__u32)(num)))
-/** @} lnet_addr */
-
-/* max value for numeric network address */
-#define MAX_NUMERIC_VALUE 0xffffffff
-
/* implication */
#define ergo(a, b) (!(a) || (b))
/* logical equivalence */
#define _LUCACHE_H
#include <libcfs/libcfs.h>
+#include <lnet/types.h>
/** \defgroup ucache ucache
*
*/
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
/*
* Convert server error code to client format. Error codes are from
#include <lnet/lib-lnet.h>
#include <lnet/lib-dlc.h>
#include <lnet/lnet.h>
+#include <lnet/nidstr.h>
#include "tracefile.h"
void
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
+#include <lnet/nidstr.h>
#ifndef __KERNEL__
#ifdef HAVE_GETHOSTBYNAME
# include <netdb.h>
#endif
#endif
+/* max value for numeric network address */
+#define MAX_NUMERIC_VALUE 0xffffffff
+
#define IPSTRING_LENGTH 16
/* CAVEAT VENDITOR! Keep the canonical string representation of nets/nids
#define DEBUG_SUBSYSTEM S_SEC
#include <libcfs/lucache.h>
+#include <lnet/types.h>
static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
__u64 key, void *args)
#define __USE_FILE_OFFSET64
#include <libcfs/libcfsutil.h>
-#include <lnet/api-support.h>
#include <lnet/lnetctl.h>
static ioc_handler_t do_ioctl; /* forward ref */
SUBDIRS = linux
DIST_SUBDIRS = linux
-EXTRA_DIST = api.h api-support.h \
- lib-dlc.h lib-lnet.h lib-types.h lnet.h lnetctl.h types.h \
- socklnd.h lnetst.h
+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
+++ /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.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LNET_API_SUPPORT_H__
-#define __LNET_API_SUPPORT_H__
-
-#include <lnet/linux/api-support.h>
-
-#include <libcfs/libcfs.h>
-#include <lnet/types.h>
-#include <lnet/lnet.h>
-
-#endif
-EXTRA_DIST = lib-lnet.h lib-types.h lnet.h api-support.h
+EXTRA_DIST = lib-lnet.h lib-types.h lnet.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.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LINUX_API_SUPPORT_H__
-#define __LINUX_API_SUPPORT_H__
-
-#ifndef __LNET_API_SUPPORT_H__
-#error Do not #include this file directly. #include <lnet /api-support.h> instead
-#endif
-
-#ifndef __KERNEL__
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
-# include <time.h>
-
-/* Lots of POSIX dependencies to support PtlEQWait_timeout */
-# include <signal.h>
-# include <setjmp.h>
-# include <time.h>
-
-#ifdef HAVE_LIBREADLINE
-#define READLINE_LIBRARY
-#include <readline/readline.h>
-
-/* readline.h pulls in a #define that conflicts with one in libcfs.h */
-#undef RETURN
-
-/* completion_matches() is #if 0-ed out in modern glibc */
-#ifndef completion_matches
-# define completion_matches rl_completion_matches
-#endif
-
-#endif /* HAVE_LIBREADLINE */
-
-extern void using_history(void);
-extern void stifle_history(int);
-extern void add_history(char *);
-
-#endif /* !__KERNEL__ */
-
-#endif
#include <lnet/types.h>
#include <lnet/api.h>
-
-#define LNET_NIDSTR_COUNT 1024 /* # of nidstrings */
-#define LNET_NIDSTR_SIZE 32 /* size of each one (see below for usage) */
+#include <lnet/nidstr.h>
#endif
#define __LNET_ST_H__
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
#include <lnet/lib-types.h>
#define LST_FEAT_NONE (0)
--- /dev/null
+#ifndef _LNET_NIDSTRINGS_H
+#define _LNET_NIDSTRINGS_H
+#include <lnet/types.h>
+
+struct list_head;
+
+#define LNET_NIDSTR_COUNT 1024 /* # of nidstrings */
+#define LNET_NIDSTR_SIZE 32 /* size of each one (see below for usage) */
+
+/* support decl needed both by kernel and liblustre */
+int libcfs_isknown_lnd(int type);
+char *libcfs_lnd2modname(int type);
+char *libcfs_lnd2str(int type);
+int libcfs_str2lnd(const char *str);
+char *libcfs_net2str(__u32 net);
+char *libcfs_nid2str(lnet_nid_t nid);
+__u32 libcfs_str2net(const char *str);
+lnet_nid_t libcfs_str2nid(const char *str);
+int libcfs_str2anynid(lnet_nid_t *nid, const char *str);
+char *libcfs_id2str(lnet_process_id_t id);
+void cfs_free_nidlist(struct list_head *list);
+int cfs_parse_nidlist(char *str, int len, struct list_head *list);
+int cfs_print_nidlist(char *buffer, int count, struct list_head *list);
+int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
+bool cfs_nidrange_is_contiguous(struct list_head *nidlist);
+void cfs_nidrange_find_min_max(struct list_head *nidlist, char *min_nid,
+ char *max_nid, int nidstr_length);
+
+#endif /* _LNET_NIDSTRINGS_H */
/** \addtogroup lnet
* @{ */
-#include <libcfs/libcfs.h>
+#include <libcfs/types.h>
/** \addtogroup lnet_addr
* @{ */
#define LNET_TIME_FOREVER (-1)
+/* how an LNET NID encodes net:address */
+/** extract the address part of an lnet_nid_t */
+
+static inline __u32 LNET_NIDADDR(lnet_nid_t nid)
+{
+ return nid & 0xffffffff;
+}
+
+static inline __u32 LNET_NIDNET(lnet_nid_t nid)
+{
+ return (nid >> 32) & 0xffffffff;
+}
+
+static inline lnet_nid_t LNET_MKNID(__u32 net, __u32 addr)
+{
+ return (((__u64)net) << 32) | addr;
+}
+
+static inline __u32 LNET_NETNUM(__u32 net)
+{
+ return net & 0xffff;
+}
+
+static inline __u32 LNET_NETTYP(__u32 net)
+{
+ return (net >> 16) & 0xffff;
+}
+
+static inline __u32 LNET_MKNET(__u32 type, __u32 num)
+{
+ return (type << 16) | num;
+}
+
/**
* Objects maintained by the LNet are accessed through handles. Handle types
* have names of the form lnet_handle_xx_t, where xx is one of the two letter
#COMPILE = $(CC) -Wall -g -I$(srcdir)/../include -I../../include
#LINK = $(CC) -o $@
+AM_CFLAGS = $(LLCFLAGS)
+
LIBCFS= $(top_builddir)/libcfs/libcfs/libcfs.a
LIBCFSUTIL= $(top_builddir)/libcfs/libcfs/libcfsutil.a
int jt_dbg_mark_debug_buf(int argc, char **argv)
{
static char scratch[MAX_MARK_SIZE] = "";
- struct libcfs_ioctl_data data = { 0 };
+ struct libcfs_ioctl_data data;
char *text;
int rc;
+ memset(&data, 0, sizeof(data));
+
if (argc > 1) {
int count, max_size = sizeof(scratch) - 1;
* Author: Liang Zhen <liangzhen@clusterfs.com>
*/
-#define _GNU_SOURCE
-
#include <libcfs/libcfsutil.h>
#include <lnet/lnetctl.h>
#include <lnet/lnetst.h>
+#include <lnet/nidstr.h>
/* NB: these includes are layering violation */
#include <lustre_ver.h>
#include <lustre/lustre_idl.h>
*/
#include <libcfs/libcfsutil.h>
-#include <lnet/api-support.h>
+#include <lnet/nidstr.h>
#include <lnet/lnetctl.h>
#include <lnet/socklnd.h>
#include <lnet/lib-dlc.h>
#endif
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <lnet/lib-lnet.h>
+#include <lnet/lib-types.h>
#include <string.h>
#define _LUSTRE_IDL_H_
#include <libcfs/libcfs.h> /* for LPUX64, etc */
+#include <lnet/types.h>
#include <lustre/lustre_user.h> /* Defn's shared with user-space. */
#include <lustre/lustre_errno.h>
#include <lustre_ver.h>
#define DEBUG_SUBSYSTEM S_MDS
#include "mdt_internal.h"
-#include <lnet/lib-lnet.h>
-
+#include <lnet/nidstr.h>
typedef enum ucred_init_type {
NONE_INIT = 0,
#include <asm/statfs.h>
#include <linux/module.h>
-
+#include <lnet/nidstr.h>
/* LUSTRE_VERSION_CODE */
#include <lustre_ver.h>
/*
#include <lustre_mds.h>
#include <lprocfs_status.h>
#include "mdt_internal.h"
-#include <lnet/lib-lnet.h>
/**
* The rename stats output would be YAML formats, like
* Author: Joshua Walgenbach <jjw@iu.edu>
*/
#include <linux/module.h>
+#include <lnet/nidstr.h>
#include <lustre_net.h>
#include "nodemap_internal.h"
#include <stdio.h>
/* For basename() */
#include <libgen.h>
-
+#include <lnet/nidstr.h>
#include "lsupport.h"
int main(int argc, char **argv)
#ifdef HAVE_GETHOSTBYNAME
# include <netdb.h>
#endif
-
+#include <lnet/nidstr.h>
#ifdef _NEW_BUILD_
# include "lgss_utils.h"
#else
#include <stdint.h>
#include <libcfs/libcfs.h>
+#include <lnet/types.h>
#define GSSD_CLI (0)
#define GSSD_SVC (1)
#include <syslog.h>
#include <libcfs/libcfs.h>
+#include <lnet/nidstr.h>
#include <lustre/lustre_user.h>
#include <lustre/lustre_idl.h>
#include <time.h>
#include <libcfs/libcfs.h>
+#include <lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#include <lustre_cfg.h>
#include <sys/time.h>
#include <lnet/lnetctl.h>
+#include <lnet/nidstr.h>
#include <libcfs/libcfsutil.h>
#include <lustre_ioctl.h>
#include "obdctl.h"
#include <glob.h>
#include <libcfs/libcfs.h>
+#include <lnet/nidstr.h>
#include <lustre_cfg.h>
#include <lustre/lustre_idl.h>
#include <lustre/lustre_build_version.h>
#include <getopt.h>
#include <limits.h>
#include <ctype.h>
-
+#include <lnet/nidstr.h>
#include <lustre_disk.h>
#include <lustre_param.h>
#include <lnet/lnetctl.h>
#include <lustre_ver.h>
#include <ctype.h>
#include <limits.h>
+#include <lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 53, 0)
/*
#include "obdctl.h"
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
+#include <lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#include <lustre_cfg.h>
#include <lustre_ioctl.h>