From f32bdde0574daae522a61d00f9dda87c84c9dd05 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Thu, 27 Oct 2022 15:15:00 -0400 Subject: [PATCH] LU-8837 lustre: make ldlm and target file lists Instead of listing files for ldlm and target in ptlrpc, list them in Makefile.in in the respective directories. This requires that Makefile.am be moved to autoMakefile.am to preserve MOSTLYCLEANFILES. This simplifies the makefiles in preparation for changes in what is included on the client. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I9f937e9460f1fe2ef436f8f7ace8999dd510885e Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/41767 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/Makefile.in | 3 +- lustre/autoconf/lustre-core.m4 | 2 ++ lustre/ldlm/.gitignore | 1 - lustre/ldlm/Makefile.in | 14 +++++++++ lustre/ldlm/{Makefile.am => autoMakefile.am} | 6 +--- lustre/ptlrpc/Makefile.in | 39 ++++++-------------------- lustre/target/.gitignore | 1 - lustre/target/Makefile.in | 14 +++++++++ lustre/target/{Makefile.am => autoMakefile.am} | 20 ++----------- 9 files changed, 43 insertions(+), 57 deletions(-) delete mode 100644 lustre/ldlm/.gitignore create mode 100644 lustre/ldlm/Makefile.in rename lustre/ldlm/{Makefile.am => autoMakefile.am} (80%) delete mode 100644 lustre/target/.gitignore create mode 100644 lustre/target/Makefile.in rename lustre/target/{Makefile.am => autoMakefile.am} (58%) diff --git a/lustre/Makefile.in b/lustre/Makefile.in index c5a0f67..1cde69a 100644 --- a/lustre/Makefile.in +++ b/lustre/Makefile.in @@ -1,12 +1,13 @@ obj-m += fid/ obj-m += obdclass/ obj-m += ptlrpc/ +obj-m += ldlm/ obj-m += obdecho/ obj-m += mgc/ obj-m += ec/ obj-m += tests/kernel/ -@SERVER_TRUE@obj-m += ost/ mgs/ mdt/ mdd/ ofd/ quota/ osp/ lod/ lfsck/ +@SERVER_TRUE@obj-m += ost/ mgs/ mdt/ mdd/ ofd/ quota/ osp/ lod/ lfsck/ target/ @CLIENT_TRUE@obj-m += lov/ osc/ mdc/ lmv/ llite/ fld/ @LDISKFS_ENABLED_TRUE@obj-m += osd-ldiskfs/ @ZFS_ENABLED_TRUE@obj-m += osd-zfs/ diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 7de9350..3948f0c 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -3339,6 +3339,7 @@ lustre/kernel_patches/targets/5.3-sles15sp3.target lustre/kernel_patches/targets/5.14-sles15sp4.target lustre/kernel_patches/targets/3.x-fc18.target lustre/ldlm/Makefile +lustre/ldlm/autoMakefile lustre/ec/autoMakefile lustre/ec/Makefile lustre/fid/Makefile @@ -3378,6 +3379,7 @@ lustre/mgc/autoMakefile lustre/mgs/Makefile lustre/mgs/autoMakefile lustre/target/Makefile +lustre/target/autoMakefile lustre/ptlrpc/Makefile lustre/ptlrpc/autoMakefile lustre/ptlrpc/gss/Makefile diff --git a/lustre/ldlm/.gitignore b/lustre/ldlm/.gitignore deleted file mode 100644 index 10a7e8d..0000000 --- a/lustre/ldlm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile.in diff --git a/lustre/ldlm/Makefile.in b/lustre/ldlm/Makefile.in new file mode 100644 index 0000000..580ed1e --- /dev/null +++ b/lustre/ldlm/Makefile.in @@ -0,0 +1,14 @@ +# This is included by ptlrpc + +ldlm_objs := l_lock.o ldlm_lock.o +ldlm_objs += ldlm_resource.o ldlm_lib.o +ldlm_objs += ldlm_plain.o ldlm_extent.o +ldlm_objs += ldlm_request.o ldlm_lockd.o +ldlm_objs += ldlm_flock.o ldlm_inodebits.o +ldlm_objs += ldlm_pool.o ldlm_reclaim.o + +EXTRA_DIST = $(ldlm_objs:.o=.c) $(ldlm_server_objs:.o=.c) ldlm_internal.h + +ifneq "$(MODULES)" "ptlrpc" +@INCLUDE_RULES@ +endif diff --git a/lustre/ldlm/Makefile.am b/lustre/ldlm/autoMakefile.am similarity index 80% rename from lustre/ldlm/Makefile.am rename to lustre/ldlm/autoMakefile.am index 8d89d0a..12157cb 100644 --- a/lustre/ldlm/Makefile.am +++ b/lustre/ldlm/autoMakefile.am @@ -35,8 +35,4 @@ # ldlm is built into ptlrpc # -MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ -EXTRA_DIST = ldlm_extent.c ldlm_flock.c ldlm_internal.h ldlm_lib.c \ - ldlm_lock.c ldlm_lockd.c ldlm_plain.c ldlm_request.c \ - ldlm_resource.c l_lock.c ldlm_inodebits.c ldlm_pool.c \ - ldlm_reclaim.c +MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ diff --git a/lustre/ptlrpc/Makefile.in b/lustre/ptlrpc/Makefile.in index 82f2e10..470941a 100644 --- a/lustre/ptlrpc/Makefile.in +++ b/lustre/ptlrpc/Makefile.in @@ -1,21 +1,8 @@ MODULES := ptlrpc +ptlrpc_dir := $(dir $(lastword $(MAKEFILE_LIST))) LDLM := @top_srcdir@/lustre/ldlm/ TARGET := @top_srcdir@/lustre/target/ -ldlm_objs := $(LDLM)l_lock.o $(LDLM)ldlm_lock.o -ldlm_objs += $(LDLM)ldlm_resource.o $(LDLM)ldlm_lib.o -ldlm_objs += $(LDLM)ldlm_plain.o $(LDLM)ldlm_extent.o -ldlm_objs += $(LDLM)ldlm_request.o $(LDLM)ldlm_lockd.o -ldlm_objs += $(LDLM)ldlm_flock.o $(LDLM)ldlm_inodebits.o -ldlm_objs += $(LDLM)ldlm_pool.o $(LDLM)ldlm_reclaim.o - -target_objs := $(TARGET)tgt_main.o $(TARGET)tgt_lastrcvd.o -target_objs += $(TARGET)tgt_handler.o $(TARGET)out_handler.o -target_objs += $(TARGET)out_lib.o $(TARGET)update_trans.o -target_objs += $(TARGET)update_records.o $(TARGET)update_recovery.o -target_objs += $(TARGET)tgt_grant.o $(TARGET)tgt_fmd.o -target_objs += $(TARGET)tgt_mount.o $(TARGET)barrier.o - ptlrpc_objs := client.o recover.o connection.o niobuf.o pack_generic.o ptlrpc_objs += events.o ptlrpc_module.o service.o pinger.o ptlrpc_objs += llog_net.o llog_client.o import.o ptlrpcd.o @@ -30,29 +17,19 @@ nodemap_objs := nodemap_handler.o nodemap_lproc.o nodemap_range.o nodemap_objs += nodemap_idmap.o nodemap_rbtree.o nodemap_member.o nodemap_objs += nodemap_storage.o -ptlrpc-objs := $(ldlm_objs) $(ptlrpc_objs) -@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs) $(nrs_server_objs) +include $(ptlrpc_dir)/../ldlm/Makefile +include $(ptlrpc_dir)/../target/Makefile + +ptlrpc-objs := $(ptlrpc_objs) +ptlrpc-objs += $(patsubst %,$(LDLM)%,$(ldlm_objs)) +@SERVER_TRUE@ptlrpc-objs += $(nodemap_objs) $(nrs_server_objs) @SERVER_TRUE@ptlrpc-objs += pack_server.o llog_server.o +@SERVER_TRUE@ptlrpc-objs += $(patsubst %,$(TARGET)%,$(target_objs)) @GSS_TRUE@obj-m += gss/ default: all -ldlm_%.c: @LUSTRE@/ldlm/ldlm_%.c - ln -sf $< $@ - -l_lock.c: @LUSTRE@/ldlm/l_lock.c - ln -sf $< $@ - -tgt_%.c: @LUSTRE@/target/tgt_%.c - ln -sf $< $@ - -out_%.c: @LUSTRE@/target/out_%.c - ln -sf $< $@ - -barrier.c: @LUSTRE@/target/barrier.c - ln -sf $< $@ - EXTRA_DIST := $(ptlrpc_objs:.o=.c) ptlrpc_internal.h EXTRA_DIST += $(nodemap_objs:.o=.c) nodemap_internal.h heap.h EXTRA_DIST += $(nrs_server_objs:.o=.c) diff --git a/lustre/target/.gitignore b/lustre/target/.gitignore deleted file mode 100644 index 10a7e8d..0000000 --- a/lustre/target/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile.in diff --git a/lustre/target/Makefile.in b/lustre/target/Makefile.in new file mode 100644 index 0000000..5093f11 --- /dev/null +++ b/lustre/target/Makefile.in @@ -0,0 +1,14 @@ +# This is included by ptlrpc + +target_objs := tgt_main.o tgt_lastrcvd.o +target_objs += tgt_handler.o out_handler.o +target_objs += out_lib.o update_trans.o +target_objs += update_records.o update_recovery.o +target_objs += tgt_grant.o tgt_fmd.o barrier.o +target_objs += tgt_mount.o + +EXTRA_DIST = $(target_objs:.o=.c) tgt_internal.h + +ifneq "$(MODULES)" "ptlrpc" +@INCLUDE_RULES@ +endif diff --git a/lustre/target/Makefile.am b/lustre/target/autoMakefile.am similarity index 58% rename from lustre/target/Makefile.am rename to lustre/target/autoMakefile.am index 2dedb56..9207e44 100644 --- a/lustre/target/Makefile.am +++ b/lustre/target/autoMakefile.am @@ -14,26 +14,10 @@ # 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, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 021110-1307, USA +# version 2 along with this program; If not, see +# http://www.gnu.org/licenses/gpl-2.0.html # # GPL HEADER END # -# -# Copyright (c) 2012, 2017, Intel Corporation. -# Use is subject to license terms. -# - -# -# target is built into ptlrpc -# - MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ -EXTRA_DIST = tgt_main.c tgt_lastrcvd.c tgt_handler.c tgt_internal.h \ - tgt_grant.c out_handler.c out_lib.c barrier.c tgt_fmd.c \ - tgt_mount.c -EXTRA_DIST += update_trans.c -EXTRA_DIST += update_records.c -EXTRA_DIST += update_recovery.c -- 1.8.3.1