From 6e1c48c4b7224f28b2aebcb372dc1156f09268f6 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 29 Apr 2020 08:32:39 -0400 Subject: [PATCH] LU-9859 libcfs: handle missing refcount.h Recently the OpenSFS tree was modified to make backported headers to appear like native Linux kernel headers to avoid ifdef handling. One missed is refcount.h. Rename linux-refcount.h to refcount.h to make it look like the native kernel version. Change EXTRA_KCFLAGS to not include the Lustre include directories since it contains the fake kernel headers in the autoconf test. Also remove stray LC_REPLACE_EXCEPTIONAL_ENTRIES. Change-Id: Ia5de6dab0837db419a6b02b3b2a6ddeb6bb62f03 Test-Parameters: trivial Fixes: 742897a967cf ("LU-13274 uapi: make lnet UAPI headers C99 compliant") Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/38390 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- libcfs/autoconf/lustre-libcfs.m4 | 12 ++++++++++-- libcfs/include/libcfs/linux/Makefile.am | 2 +- libcfs/include/libcfs/linux/{linux-refcount.h => refcount.h} | 0 lustre/autoconf/lustre-core.m4 | 1 - 4 files changed, 11 insertions(+), 4 deletions(-) rename libcfs/include/libcfs/linux/{linux-refcount.h => refcount.h} (100%) diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index 76775ad..50c1431 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -733,9 +733,13 @@ cpu_hotplug_state_machine, [ # introduced refcount_t which is atomic_t plus over flow guards. # AC_DEFUN([LIBCFS_REFCOUNT_T], [ +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" LB_CHECK_LINUX_HEADER([linux/refcount.h], [ AC_DEFINE(HAVE_REFCOUNT_T, 1, - [refcount_t is supported])]) + [refcount_t is supported]) +]) +EXTRA_KCFLAGS="$tmp_flags" ]) # LIBCFS_REFCOUNT_T # @@ -839,9 +843,13 @@ uuid_t, [ # introduce processor.h # AC_DEFUN([LIBCFS_HAVE_PROCESSOR_HEADER], [ +tmp_flags="$EXTRA_KCFLAGS" +EXTRA_KCFLAGS="-Werror" LB_CHECK_LINUX_HEADER([linux/processor.h], [ AC_DEFINE(HAVE_PROCESSOR_H, 1, - [processor.h is present])]) + [processor.h is present]) +]) +EXTRA_KCFLAGS="$tmp_flags" ]) # LIBCFS_HAVE_PROCESSOR_HEADER # diff --git a/libcfs/include/libcfs/linux/Makefile.am b/libcfs/include/libcfs/linux/Makefile.am index 3e2c178..187d360 100644 --- a/libcfs/include/libcfs/linux/Makefile.am +++ b/libcfs/include/libcfs/linux/Makefile.am @@ -1,3 +1,3 @@ EXTRA_DIST = linux-misc.h linux-fs.h linux-mem.h linux-time.h linux-cpu.h \ linux-list.h linux-hash.h linux-uuid.h linux-wait.h \ - linux-refcount.h processor.h + refcount.h processor.h diff --git a/libcfs/include/libcfs/linux/linux-refcount.h b/libcfs/include/libcfs/linux/refcount.h similarity index 100% rename from libcfs/include/libcfs/linux/linux-refcount.h rename to libcfs/include/libcfs/linux/refcount.h diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 74d9743..1a2e781 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2349,7 +2349,6 @@ AC_DEFUN([LC_PROG_LINUX], [ LC___XA_SET_MARK LC_UAPI_LINUX_MOUNT_H LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK - LC_REPLACE_EXCEPTIONAL_ENTRIES # 5.1 LC_HAS_LINUX_SELINUX_ENABLED -- 1.8.3.1