From 26d8420f685bfbf3e0cf35f69e04cc68588340dc Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 4 Jun 2014 20:36:17 -0400 Subject: [PATCH] LU-5140 build: Make ko2iblnd buildable with Mellanox and newer kernels The libcfs layer handles different level of support for process namespace support. It does this by examining the uidgid.h header. Both newer kernels and the Mellanox external OFED stack supply their own uidgid.h header. In the current ko2iblnd driver it completely ignores the Mellanox uidgid.h version which ends up conflicting with the native uidgid.h header. The reason libcfs misses the Mellanox handling is because the libcfs and lnet headers are placed before the Mellanox headers so the definations are missed. This patch moves all the libcfs and lnet headers after the Mellanox header section. Change-Id: Ibd7425b4a4d5b0f59c48e2007d870c67adb5f63d Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/10571 Tested-by: Jenkins Reviewed-by: Bob Glossman Reviewed-by: Liang Zhen Reviewed-by: Shuichi Ihara Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/curproc.h | 5 +++++ lnet/klnds/o2iblnd/o2iblnd.h | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libcfs/include/libcfs/curproc.h b/libcfs/include/libcfs/curproc.h index e5e3d57..aa144e7 100644 --- a/libcfs/include/libcfs/curproc.h +++ b/libcfs/include/libcfs/curproc.h @@ -45,6 +45,9 @@ #if !defined(HAVE_UIDGID_HEADER) || !defined(__KERNEL__) +#ifndef _LINUX_UIDGID_H +#define _LINUX_UIDGID_H + typedef uid_t kuid_t; typedef gid_t kgid_t; @@ -106,6 +109,8 @@ static inline bool gid_valid(kgid_t gid) { return (gid != INVALID_GID); } +#endif /* _LINUX_UIDGID_H */ + #endif int cfs_get_environ(const char *key, char *value, int *val_len); diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index f5edc51..26524f5 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -66,12 +66,6 @@ #include #include -#define DEBUG_SUBSYSTEM S_LND - -#include -#include -#include - #ifdef HAVE_COMPAT_RDMA #include #endif @@ -80,6 +74,12 @@ #include #include +#define DEBUG_SUBSYSTEM S_LND + +#include +#include +#include + #define IBLND_PEER_HASH_SIZE 101 /* # peer lists */ /* # scheduler loops before reschedule */ #define IBLND_RESCHED 100 -- 1.8.3.1