From b492fba4f3dc730e6a5a245b4c15d55369e19229 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Sat, 5 Apr 2025 17:53:45 -0400 Subject: [PATCH] LU-18687 compat: move include and simplify lustre_compat Move the headers to the top-level. This will simplify the comiler command-line, isolate autotools dependencies to the headers, and allow for lustre_compat to use plain Makefiles (similar to Linux). Test-Parameters: trivial Fixes: 74faf91f44 ("LU-18687 compat: move xarray to lustre_compat") Signed-off-by: Timothy Day Change-Id: I851fa183c14a2661bb1eca91d94b7d757f9e575a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58694 Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- autoMakefile.am | 6 ++++-- config/lustre-build.m4 | 18 ------------------ config/lustre-toolchain.m4 | 2 +- .../lustre_compat/linux/generic-radix-tree.h | 0 .../include => include}/lustre_compat/linux/glob.h | 0 .../include => include}/lustre_compat/linux/xarray.h | 0 libcfs/libcfs/Makefile.in | 4 +++- lustre_compat/autoMakefile.am | 7 ------- lustre_compat/include/.gitignore | 1 - lustre_compat/include/Makefile.am | 8 -------- lustre_compat/include/lustre_compat/.gitignore | 1 - lustre_compat/include/lustre_compat/Makefile.am | 8 -------- lustre_compat/include/lustre_compat/linux/.gitignore | 1 - lustre_compat/include/lustre_compat/linux/Makefile.am | 7 ------- lustre_compat/{Makefile.in => lib/Makefile} | 4 +--- lustre_compat/lib/Makefile.in | 13 ------------- lustre_compat/lib/autoMakefile.am | 7 ------- 17 files changed, 9 insertions(+), 78 deletions(-) rename {lustre_compat/include => include}/lustre_compat/linux/generic-radix-tree.h (100%) rename {lustre_compat/include => include}/lustre_compat/linux/glob.h (100%) rename {lustre_compat/include => include}/lustre_compat/linux/xarray.h (100%) delete mode 100644 lustre_compat/autoMakefile.am delete mode 100644 lustre_compat/include/.gitignore delete mode 100644 lustre_compat/include/Makefile.am delete mode 100644 lustre_compat/include/lustre_compat/.gitignore delete mode 100644 lustre_compat/include/lustre_compat/Makefile.am delete mode 100644 lustre_compat/include/lustre_compat/linux/.gitignore delete mode 100644 lustre_compat/include/lustre_compat/linux/Makefile.am rename lustre_compat/{Makefile.in => lib/Makefile} (64%) delete mode 100644 lustre_compat/lib/Makefile.in delete mode 100644 lustre_compat/lib/autoMakefile.am diff --git a/autoMakefile.am b/autoMakefile.am index 3e88adb..543db02 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -14,7 +14,6 @@ SUBDIRS := @LDISKFS_SUBDIR@ \ . \ @LUSTREIOKIT_SUBDIR@ \ Documentation \ - lustre_compat \ libcfs \ lnet \ lustre @@ -22,7 +21,6 @@ SUBDIRS := @LDISKFS_SUBDIR@ \ DIST_SUBDIRS := ldiskfs \ lustre-iokit \ Documentation \ - lustre_compat \ libcfs \ lnet \ lustre \ @@ -177,6 +175,10 @@ undef.h: config.h.in grep -v config.h.in config.h.in > $@ dist-hook: undef.h + find include/ -type f \( -name "*.h" \) \ + -exec cp --parents {} $(distdir) \; + find lustre_compat/ -type f \( -name "*.c" -o -iname "Makefile" \) \ + -exec cp --parents {} $(distdir) \; find $(distdir) -name .deps -o \ -name CVS -o \ -name .svn -o \ diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 2217315..08a79ff 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -439,23 +439,6 @@ AC_DEFUN([LB_CONFIG_FILES], [ ]) # -# LB_COMPAT_CONFIG_FILES -# -# build-specific config files (lustre_compat) -# -AC_DEFUN([LB_COMPAT_CONFIG_FILES], [ - AC_CONFIG_FILES( - lustre_compat/Makefile - lustre_compat/lib/Makefile - lustre_compat/autoMakefile - lustre_compat/lib/autoMakefile - lustre_compat/include/Makefile - lustre_compat/include/lustre_compat/Makefile - lustre_compat/include/lustre_compat/linux/Makefile - ) -]) - -# # LB_CONFIG_SERVERS # AC_DEFUN([LB_CONFIG_SERVERS], [ @@ -715,7 +698,6 @@ LB_CONFIG_HEADERS LPLUG_CONFIGURE LIBCFS_CONFIG_FILES LB_CONFIG_FILES -LB_COMPAT_CONFIG_FILES LN_CONFIG_FILES LC_CONFIG_FILES LPLUG_CONFIG_FILES diff --git a/config/lustre-toolchain.m4 b/config/lustre-toolchain.m4 index 1e9f710..1550365 100644 --- a/config/lustre-toolchain.m4 +++ b/config/lustre-toolchain.m4 @@ -97,7 +97,7 @@ CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE" AC_SUBST(CCASFLAGS) # everyone builds against lnet and lustre kernel headers -EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/libcfs/include -I$PWD/libcfs/include/libcfs -I$PWD/lnet/include/uapi -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include -I$PWD/lustre_compat/include" +EXTRA_KCFLAGS="$EXTRA_KCFLAGS -g -I$PWD/libcfs/include -I$PWD/libcfs/include/libcfs -I$PWD/lnet/include/uapi -I$PWD/lnet/include -I$PWD/lustre/include/uapi -I$PWD/lustre/include -I$PWD/include" AC_SUBST(EXTRA_KCFLAGS) ]) # LTC_PROG_CC diff --git a/lustre_compat/include/lustre_compat/linux/generic-radix-tree.h b/include/lustre_compat/linux/generic-radix-tree.h similarity index 100% rename from lustre_compat/include/lustre_compat/linux/generic-radix-tree.h rename to include/lustre_compat/linux/generic-radix-tree.h diff --git a/lustre_compat/include/lustre_compat/linux/glob.h b/include/lustre_compat/linux/glob.h similarity index 100% rename from lustre_compat/include/lustre_compat/linux/glob.h rename to include/lustre_compat/linux/glob.h diff --git a/lustre_compat/include/lustre_compat/linux/xarray.h b/include/lustre_compat/linux/xarray.h similarity index 100% rename from lustre_compat/include/lustre_compat/linux/xarray.h rename to include/lustre_compat/linux/xarray.h diff --git a/libcfs/libcfs/Makefile.in b/libcfs/libcfs/Makefile.in index 81c6cc6..59d7e56 100644 --- a/libcfs/libcfs/Makefile.in +++ b/libcfs/libcfs/Makefile.in @@ -9,7 +9,7 @@ MODULES = libcfs COMPAT := @top_srcdir@/lustre_compat/lib/ libcfs_dir := $(dir $(lastword $(MAKEFILE_LIST))) --include $(libcfs_dir)/../../lustre_compat/lib/Makefile +include $(libcfs_dir)/../../lustre_compat/lib/Makefile libcfs-linux-objs := linux-prim.o libcfs-linux-objs += linux-hash.o @@ -17,6 +17,8 @@ libcfs-linux-objs += linux-wait.o libcfs-compat-objs += $(patsubst %,$(COMPAT)%,$(compat_objs)) +EXTRA_DIST = $(libcfs-compat-objs:.o=.c) + libcfs-crypto-objs := crypto.o fname.o hkdf.o hooks.o keyring.o libcfs-crypto-objs += keysetup.o keysetup_v1.o policy.o diff --git a/lustre_compat/autoMakefile.am b/lustre_compat/autoMakefile.am deleted file mode 100644 index 5d9eb34..0000000 --- a/lustre_compat/autoMakefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -SUBDIRS = lib include diff --git a/lustre_compat/include/.gitignore b/lustre_compat/include/.gitignore deleted file mode 100644 index 10a7e8d..0000000 --- a/lustre_compat/include/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile.in diff --git a/lustre_compat/include/Makefile.am b/lustre_compat/include/Makefile.am deleted file mode 100644 index 8303353..0000000 --- a/lustre_compat/include/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -SUBDIRS = lustre_compat -DIST_SUBDIRS = lustre_compat diff --git a/lustre_compat/include/lustre_compat/.gitignore b/lustre_compat/include/lustre_compat/.gitignore deleted file mode 100644 index 10a7e8d..0000000 --- a/lustre_compat/include/lustre_compat/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile.in diff --git a/lustre_compat/include/lustre_compat/Makefile.am b/lustre_compat/include/lustre_compat/Makefile.am deleted file mode 100644 index d21ce25..0000000 --- a/lustre_compat/include/lustre_compat/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -SUBDIRS = linux -DIST_SUBDIRS = linux diff --git a/lustre_compat/include/lustre_compat/linux/.gitignore b/lustre_compat/include/lustre_compat/linux/.gitignore deleted file mode 100644 index 10a7e8d..0000000 --- a/lustre_compat/include/lustre_compat/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile.in diff --git a/lustre_compat/include/lustre_compat/linux/Makefile.am b/lustre_compat/include/lustre_compat/linux/Makefile.am deleted file mode 100644 index da9f069..0000000 --- a/lustre_compat/include/lustre_compat/linux/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -EXTRA_DIST = xarray.h glob.h generic-radix-tree.h diff --git a/lustre_compat/Makefile.in b/lustre_compat/lib/Makefile similarity index 64% rename from lustre_compat/Makefile.in rename to lustre_compat/lib/Makefile index dadff32..6a36e8b 100644 --- a/lustre_compat/Makefile.in +++ b/lustre_compat/lib/Makefile @@ -4,6 +4,4 @@ # This file is part of Lustre, http://www.lustre.org/ # -obj-m += lib/ - -@INCLUDE_RULES@ +compat_objs := xarray.o glob.o generic-radix-tree.o diff --git a/lustre_compat/lib/Makefile.in b/lustre_compat/lib/Makefile.in deleted file mode 100644 index baf5240..0000000 --- a/lustre_compat/lib/Makefile.in +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -compat_objs := xarray.o glob.o generic-radix-tree.o - -EXTRA_DIST = $(compat_objs:.o=.c) - -ifneq "$(MODULES)" "libcfs" -@INCLUDE_RULES@ -endif diff --git a/lustre_compat/lib/autoMakefile.am b/lustre_compat/lib/autoMakefile.am deleted file mode 100644 index 3b1a5dc..0000000 --- a/lustre_compat/lib/autoMakefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 - -# -# This file is part of Lustre, http://www.lustre.org/ -# - -MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ -- 1.8.3.1