From 9c710162e5acebd860f1d3f0e1bf204ac1ba98c1 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Wed, 23 Mar 2016 19:35:50 -0400 Subject: [PATCH] LU-7699 build: Eliminate lustre_build_version.h The lustre_build_version.h is no longer necessary. With the new versioning system the lustre version can now be retrieved from standard autotools defines and/or lustre_ver.h. To make compatibility easier for the upstream lustre client in the linux kernel, we use LUSTRE_VERSION_STRING from lustre_ver.h. Change-Id: I08233d8547bc4af7bf2fb0c15bee8e306f6fa0f0 Signed-off-by: Christopher J. Morrone Reviewed-on: http://review.whamcloud.com/18108 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- autoMakefile.am | 7 ++----- lustre/autoMakefile.am | 15 --------------- lustre/include/lustre/.gitignore | 1 - lustre/obdclass/class_obd.c | 32 ++++++++++++++++---------------- lustre/obdclass/linux/linux-module.c | 3 +-- lustre/utils/lustre_cfg.c | 2 +- lustre/utils/obd.c | 2 +- 7 files changed, 21 insertions(+), 41 deletions(-) diff --git a/autoMakefile.am b/autoMakefile.am index 70a967e..ed22c70 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -61,20 +61,17 @@ doxygen-%: build/doxyfile.% doxygen $< if MODULES -.PHONY: ldiskfs-sources lustre-sources +.PHONY: ldiskfs-sources ldiskfs-sources: if LDISKFS_ENABLED $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$? endif -lustre-sources: - $(MAKE) sources -C lustre || exit $$? - if LINUX all-am: modules -modules: undef.h ldiskfs-sources lustre-sources +modules: undef.h ldiskfs-sources $(MAKE) CC="$(CC)" -C $(LINUX_OBJ) \ -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \ LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \ diff --git a/lustre/autoMakefile.am b/lustre/autoMakefile.am index fb41119..a25fe05 100644 --- a/lustre/autoMakefile.am +++ b/lustre/autoMakefile.am @@ -60,18 +60,3 @@ endif DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) EXTRA_DIST = BUGS kernel_patches BUILDING - -sources: lustre_build_version - -all-recursive: lustre_build_version - -BUILD_VER_H=$(top_builddir)/lustre/include/lustre/lustre_build_version.h - -lustre_build_version: - echo -n "#define BUILD_VERSION \"" > tmpver - cat $(top_builddir)/LUSTRE-VERSION-FILE | tr -d '\n' | \ - sed -e 's/^LUSTRE_VERSION = //' >> tmpver - echo "\"" >> tmpver - cmp -s $(BUILD_VER_H) tmpver > tmpdiff 2> /dev/null && \ - $(RM) tmpver tmpdiff || \ - mv -f tmpver $(BUILD_VER_H) diff --git a/lustre/include/lustre/.gitignore b/lustre/include/lustre/.gitignore index f2a56d8..10a7e8d 100644 --- a/lustre/include/lustre/.gitignore +++ b/lustre/include/lustre/.gitignore @@ -1,2 +1 @@ /Makefile.in -/lustre_build_version.h diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index b742b51..91e3371 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #ifdef HAVE_SERVER_SUPPORT @@ -255,24 +255,24 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) GOTO(out, err); } - case OBD_GET_VERSION: - if (!data->ioc_inlbuf1) { - CERROR("No buffer passed in ioctl\n"); - GOTO(out, err = -EINVAL); - } + case OBD_GET_VERSION: + if (!data->ioc_inlbuf1) { + CERROR("No buffer passed in ioctl\n"); + GOTO(out, err = -EINVAL); + } - if (strlen(BUILD_VERSION) + 1 > data->ioc_inllen1) { - CERROR("ioctl buffer too small to hold version\n"); - GOTO(out, err = -EINVAL); - } + if (strlen(LUSTRE_VERSION_STRING) + 1 > data->ioc_inllen1) { + CERROR("ioctl buffer too small to hold version\n"); + GOTO(out, err = -EINVAL); + } - memcpy(data->ioc_bulk, BUILD_VERSION, - strlen(BUILD_VERSION) + 1); + memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING, + strlen(LUSTRE_VERSION_STRING) + 1); err = obd_ioctl_popdata((void __user *)arg, data, len); - if (err) - err = -EFAULT; - GOTO(out, err); + if (err) + err = -EFAULT; + GOTO(out, err); case OBD_IOC_NAME2DEV: { /* Resolve a device name. This does not change the @@ -500,7 +500,7 @@ static int __init obdclass_init(void) INIT_LIST_HEAD(&obd_stale_exports); atomic_set(&obd_stale_export_num, 0); - LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n"); + LCONSOLE_INFO("Lustre: Build Version: "LUSTRE_VERSION_STRING"\n"); spin_lock_init(&obd_types_lock); obd_zombie_impexp_init(); diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index c019863..c4c556d 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -73,7 +73,6 @@ #include #include #include -#include int proc_version; @@ -217,7 +216,7 @@ static int obd_proc_version_seq_show(struct seq_file *m, void *v) { seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n", LUSTRE_VERSION_STRING, "patchless_client", - BUILD_VERSION); + LUSTRE_VERSION_STRING); return 0; } LPROC_SEQ_FOPS_RO(obd_proc_version); diff --git a/lustre/utils/lustre_cfg.c b/lustre/utils/lustre_cfg.c index f0c5d5d..23ca708 100644 --- a/lustre/utils/lustre_cfg.c +++ b/lustre/utils/lustre_cfg.c @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 393c61a..796140c 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -73,7 +73,7 @@ #include #include #include -#include +#include #include #include -- 1.8.3.1