From da289f1c235456d0d4fa9e0b7765298d40ac2475 Mon Sep 17 00:00:00 2001 From: ericm Date: Thu, 3 Jul 2008 22:19:27 +0000 Subject: [PATCH] branch: HEAD fix build breakage of utils/gss. --- lustre/utils/gss/Makefile.am | 18 ++++++++++-------- lustre/utils/gss/lgss_keyring.c | 2 -- lustre/utils/gss/lgss_utils.h | 8 +------- lustre/utils/gss/lsupport.c | 25 +++++++++++++++++-------- lustre/utils/gss/lsupport.h | 41 +++++------------------------------------ 5 files changed, 33 insertions(+), 61 deletions(-) diff --git a/lustre/utils/gss/Makefile.am b/lustre/utils/gss/Makefile.am index fd63d29..5da8cb2 100644 --- a/lustre/utils/gss/Makefile.am +++ b/lustre/utils/gss/Makefile.am @@ -1,12 +1,12 @@ -# gss daemons Makefile +# GSS daemons & tools Makefile SUBDIRS = AM_CFLAGS=$(LLCFLAGS) AM_CPPFLAGS=$(LLCPPFLAGS) -DLUSTRE_UTILS=1 -AM_LDFLAGS := -L$(top_builddir)/lnet/utils +AM_LDFLAGS := -L$(top_builddir)/libcfs/libcfs -LIBPTLCTL := $(top_builddir)/lnet/utils/libptlctl.a +LIBCFS := $(top_builddir)/libcfs/libcfs/libcfs.a sbin_PROGRAMS := lsvcgssd l_idmap @@ -46,9 +46,9 @@ lgssd_SOURCES = \ krb5_util.h \ write_bytes.h -lgssd_LDADD = $(GSSAPI_LIBS) $(KRBLIBS) -lgssd_LDFLAGS = $(KRBLDFLAGS) lgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) $(KRBCFLAGS) +lgssd_LDADD = $(GSSAPI_LIBS) $(KRBLIBS) +lgssd_LDFLAGS = $(KRBLDFLAGS) lsvcgssd_SOURCES = \ $(COMMON_SRCS) \ @@ -61,9 +61,10 @@ lsvcgssd_SOURCES = \ cacheio.h \ svcgssd.h -lsvcgssd_LDADD = $(GSSAPI_LIBS) $(KRBLIBS) -lsvcgssd_LDFLAGS = $(KRBLDFLAGS) lsvcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) $(KRBCFLAGS) +lsvcgssd_LDADD = $(LIBCFS) $(GSSAPI_LIBS) $(KRBLIBS) +lsvcgssd_LDFLAGS = $(KRBLDFLAGS) +lsvcgssd_DEPENDENCIES = $(LIBCFS) l_idmap_SOURCES = \ l_idmap.c \ @@ -87,7 +88,8 @@ lgss_keyring_SOURCES = \ lsupport.h lgss_keyring_CFLAGS = $(AM_CFLAGS) $(CFLAGS) $(KRBCFLAGS) -D _NEW_BUILD_ -lgss_keyring_LDADD = -lkeyutils $(GSSAPI_LIBS) $(KRBLIBS) +lgss_keyring_LDADD = $(LIBCFS) -lkeyutils $(GSSAPI_LIBS) $(KRBLIBS) lgss_keyring_LDFLAGS = $(KRBLDFLAGS) +lgss_keyring_DEPENDENCIES = $(LIBCFS) EXTRA_DIST = diff --git a/lustre/utils/gss/lgss_keyring.c b/lustre/utils/gss/lgss_keyring.c index 840e14c..95f277c 100644 --- a/lustre/utils/gss/lgss_keyring.c +++ b/lustre/utils/gss/lgss_keyring.c @@ -36,8 +36,6 @@ #include #include -#include - #include "lsupport.h" #include "lgss_utils.h" #include "write_bytes.h" diff --git a/lustre/utils/gss/lgss_utils.h b/lustre/utils/gss/lgss_utils.h index be9ae5a..8fd39ab 100644 --- a/lustre/utils/gss/lgss_utils.h +++ b/lustre/utils/gss/lgss_utils.h @@ -44,13 +44,7 @@ #include #include -#ifndef likely -#define likely(exp) (exp) -#endif - -#ifndef unlikely -#define unlikely(exp) (exp) -#endif +#include #define LGSS_SVC_MDS_STR "lustre_mds" #define LGSS_SVC_OST_STR "lustre_oss" diff --git a/lustre/utils/gss/lsupport.c b/lustre/utils/gss/lsupport.c index b629cb6..656fc91 100644 --- a/lustre/utils/gss/lsupport.c +++ b/lustre/utils/gss/lsupport.c @@ -273,11 +273,13 @@ int external_nid2hostname(char *lnd, uint32_t net, uint32_t addr, return 0; } -static struct { +struct convert_struct { char *name; lnd_nid2hostname_t *nid2name; -} converter[LND_ENUM_END_MARKER] = { - {"UNUSED0", NULL}, +}; + +static struct convert_struct converter[] = { + [0] = { "UNUSED0", NULL}, [QSWLND] = { "QSWLND", external_nid2hostname}, [SOCKLND] = { "SOCKLND", ipv4_nid2hostname }, [GMLND] = { "GMLND", external_nid2hostname}, @@ -289,8 +291,11 @@ static struct { [LOLND] = { "LOLND", lolnd_nid2hostname }, [RALND] = { "RALND", external_nid2hostname }, [VIBLND] = { "VIBLND", external_nid2hostname }, + [MXLND] = { "MXLND", external_nid2hostname }, }; +#define LND_MAX (sizeof(converter) / sizeof(converter[0])) + int lnet_nid2hostname(lnet_nid_t nid, char *buf, int buflen) { uint32_t lnd, net, addr; @@ -299,7 +304,7 @@ int lnet_nid2hostname(lnet_nid_t nid, char *buf, int buflen) net = LNET_NIDNET(nid); lnd = LNET_NETTYP(net); - if (lnd >= LND_ENUM_END_MARKER) { + if (lnd >= LND_MAX) { printerr(0, "ERROR: Unrecognized LND %u\n", lnd); return -1; } @@ -551,13 +556,17 @@ libcfs_str2net_internal(char *str, uint32_t *net) return nf; } +/* FIXME + * this is duplication in libcfs, but somehow doesn't make into libcfs.a. + * remove it when libcfs get fixed. + */ lnet_nid_t -libcfs_str2nid(char *str) +libcfs_str2nid(const char *str) { - char *sep = strchr(str, '@'); + const char *sep = strchr(str, '@'); struct netstrfns *nf; - uint32_t net; - uint32_t addr; + uint32_t net; + uint32_t addr; if (sep != NULL) { nf = libcfs_str2net_internal(sep + 1, &net); diff --git a/lustre/utils/gss/lsupport.h b/lustre/utils/gss/lsupport.h index 6748ecd..7fff8ad 100644 --- a/lustre/utils/gss/lsupport.h +++ b/lustre/utils/gss/lsupport.h @@ -2,12 +2,14 @@ * vim:expandtab:shiftwidth=8:tabstop=8: */ -#ifndef __LIBCFS_H__ -#define __LIBCFS_H__ +#ifndef __LSUPPORT_H__ +#define __LSUPPORT_H__ #include #include +#include + #define GSSD_CLI (0) #define GSSD_SVC (1) @@ -52,41 +54,8 @@ struct lgssd_ioctl_param { #define GSSD_DEFAULT_GETHOSTNAME_EX "/etc/lustre/nid2hostname" #define MAPPING_DATABASE_FILE "/etc/lustre/idmap.conf" -typedef uint64_t lnet_nid_t; -typedef uint32_t lnet_netid_t; - -#define LNET_NID_ANY ((lnet_nid_t) -1) -#define LNET_PID_ANY ((lnet_pid_t) -1) - -enum { - /* Only add to these values (i.e. don't ever change or redefine them): - * network addresses depend on them... */ - QSWLND = 1, - SOCKLND = 2, - GMLND = 3, - PTLLND = 4, - O2IBLND = 5, - CIBLND = 6, - OPENIBLND = 7, - IIBLND = 8, - LOLND = 9, - RALND = 10, - VIBLND = 11, - LND_ENUM_END_MARKER -}; - int lnet_nid2hostname(lnet_nid_t nid, char *buf, int buflen); void cleanup_mapping(void); int lookup_mapping(char *princ, uint64_t nid, uid_t *uid); -lnet_nid_t libcfs_str2nid(char *str); - -/* how an LNET NID encodes net:address */ -#define LNET_NIDADDR(nid) ((uint32_t)((nid) & 0xffffffff)) -#define LNET_NIDNET(nid) ((uint32_t)(((nid) >> 32)) & 0xffffffff) -#define LNET_MKNID(net,addr) ((((uint64_t)(net))<<32)|((uint64_t)(addr))) -/* how net encodes type:number */ -#define LNET_NETNUM(net) ((net) & 0xffff) -#define LNET_NETTYP(net) (((net) >> 16) & 0xffff) -#define LNET_MKNET(typ,num) ((((uint32_t)(typ))<<16)|((uint32_t)(num))) -#endif /* __LIBCFS_H__ */ +#endif /* __LSUPPORT_H__ */ -- 1.8.3.1