From: Brian Behlendorf Date: Mon, 19 Dec 2011 21:10:17 +0000 (-0800) Subject: LU-936 Remove LUSTRE_KERNEL_VERSION X-Git-Tag: 2.2.53~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=10a847d2511254d7cab0accbca03524d5c1fd909 LU-936 Remove LUSTRE_KERNEL_VERSION Patched kernels are no longer an absolute requirement for Lustre servers. Remove the LC_LUSTRE_VERSION_H autoconf check and all usage of the LUSTRE_KERNEL_VERSION #define. Going forward any specific kernel dependency should be expressed with an explicit, clearly documented, autoconf test. As part of this change the check for automatically disabling lustre server support has been moved to the ldiskfs autoconf checks. Previously this was done by checking for the existance of a patched kernel. Change-Id: Ifb5dcaf62638146a190f5d7417b9462177c5730d Signed-off-by: Brian Behlendorf Reviewed-on: http://review.whamcloud.com/1873 Reviewed-by: Andreas Dilger Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/build/autoconf/lustre-build-ldiskfs.m4 b/build/autoconf/lustre-build-ldiskfs.m4 index 32608d1..8ffd5e9 100644 --- a/build/autoconf/lustre-build-ldiskfs.m4 +++ b/build/autoconf/lustre-build-ldiskfs.m4 @@ -209,21 +209,39 @@ AC_SUBST(EXT_DIR) AC_DEFUN([LB_LDISKFS_EXT_SOURCE], [ if test x$EXT_DIR = x; then - AC_MSG_ERROR([Complete $LDISKFS_BACKFS source must exist. - -If you are building using kernel-devel packages then ensure that the -matching kernel-debuginfo-common and kernel-debuginfo-common- -packages are installed.]) + enable_ldiskfs_build='no' +else + LB_CHECK_FILE([$EXT_DIR/dir.c], [], [ + enable_ldiskfs_build='no' + AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + LB_CHECK_FILE([$EXT_DIR/file.c], [], [ + enable_ldiskfs_build='no' + AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + LB_CHECK_FILE([$EXT_DIR/inode.c], [], [ + enable_ldiskfs_build='no' + AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) + LB_CHECK_FILE([$EXT_DIR/super.c], [], [ + enable_ldiskfs_build='no' + AC_MSG_WARN([$LDISKFS_BACKFS must exist for ldiskfs build])]) fi -LB_CHECK_FILE([$EXT_DIR/dir.c], [], [ AC_MSG_ERROR( - [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])]) -LB_CHECK_FILE([$EXT_DIR/file.c], [], [ AC_MSG_ERROR( - [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])]) -LB_CHECK_FILE([$EXT_DIR/inode.c], [], [ AC_MSG_ERROR( - [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])]) -LB_CHECK_FILE([$EXT_DIR/super.c], [], [ AC_MSG_ERROR( - [Complete $LDISKFS_BACKFS source must exist for ldiskfs build])]) +if test x$enable_ldiskfs_build = xno; then + enable_server='no' + enable_ldiskfs_build='no' + with_ldiskfs='no' + LDISKFS_SUBDIR= + + AC_MSG_WARN([ + +Disabling server because complete $LDISKFS_BACKFS source does not exist. + +If you are building using kernel-devel packages and require ldiskfs +server support then ensure that the matching kernel-debuginfo-common +and kernel-debuginfo-common- packages are installed. + +]) + +fi ]) # @@ -312,12 +330,12 @@ AC_ARG_ENABLE([ldiskfs-build], AC_MSG_CHECKING([whether to build ldiskfs]) if test x$enable_ldiskfs_build = xyes; then AC_MSG_RESULT([$enable_ldiskfs_build]) + LDISKFS_SUBDIR="ldiskfs" LB_CHECK_FILE([$LDISKFS_DIR/configure], [], [ AC_MSG_ERROR([Complete ldiskfs build system must exist])]) LB_LDISKFS_EXT_SOURCE - LDISKFS_SUBDIR="ldiskfs" AC_SUBST(LDISKFS_SUBDIR) else enable_ldiskfs_build='no' diff --git a/lnet/klnds/socklnd/socklnd_lib-linux.h b/lnet/klnds/socklnd/socklnd_lib-linux.h index 76be463..ee21efb 100644 --- a/lnet/klnds/socklnd/socklnd_lib-linux.h +++ b/lnet/klnds/socklnd/socklnd_lib-linux.h @@ -96,8 +96,7 @@ int ksocknal_nsched(void) return 1; } #else -#include -# if !(defined(CONFIG_X86) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,21))) || defined(CONFIG_X86_64) || ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && !defined(CONFIG_X86_HT)) +# if !defined(CONFIG_X86) || defined(CONFIG_X86_64) || !defined(CONFIG_X86_HT) static inline int ksocknal_nsched(void) { diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 38d3fa0..0ac3957 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -85,23 +85,6 @@ AC_TRY_COMPILE([ ]) # -# only for Lustre-patched kernels -# -AC_DEFUN([LC_LUSTRE_VERSION_H], -[LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[ - rm -f "$LUSTRE/include/linux/lustre_version.h" -],[ - touch "$LUSTRE/include/linux/lustre_version.h" - if test x$enable_server = xyes ; then - AC_MSG_WARN([Unpatched kernel detected.]) - AC_MSG_WARN([Lustre servers cannot be built with an unpatched kernel;]) - AC_MSG_WARN([disabling server build]) - enable_server='no' - fi -]) -]) - -# # LC_FUNC_DEV_SET_RDONLY # # check whether dev_set_rdonly is exported. This is needed until we @@ -1994,7 +1977,7 @@ AC_DEFINE(HAVE_SIMPLE_SETATTR, 1, # Lustre linux kernel checks # AC_DEFUN([LC_PROG_LINUX], - [LC_LUSTRE_VERSION_H + [ LC_CONFIG_PINGER LC_CONFIG_CHECKSUM LC_CONFIG_LIBLUSTRE_RECOVERY diff --git a/lustre/include/linux/lustre_intent.h b/lustre/include/linux/lustre_intent.h index 2cba960..be59853 100644 --- a/lustre/include/linux/lustre_intent.h +++ b/lustre/include/linux/lustre_intent.h @@ -37,8 +37,6 @@ #ifndef LUSTRE_INTENT_H #define LUSTRE_INTENT_H -#include - /* intent IT_XXX are defined in lustre/include/obd.h */ struct lustre_intent_data { int it_disposition; diff --git a/lustre/include/linux/lustre_patchless_compat.h b/lustre/include/linux/lustre_patchless_compat.h index 621889d..0e7e00e 100644 --- a/lustre/include/linux/lustre_patchless_compat.h +++ b/lustre/include/linux/lustre_patchless_compat.h @@ -37,7 +37,6 @@ #ifndef LUSTRE_PATCHLESS_COMPAT_H #define LUSTRE_PATCHLESS_COMPAT_H -#include #include #ifndef HAVE_TRUNCATE_COMPLETE_PAGE diff --git a/lustre/kernel_patches/patches/lustre_version.patch b/lustre/kernel_patches/patches/lustre_version.patch index d01f972..fe3a5c4 100644 --- a/lustre/kernel_patches/patches/lustre_version.patch +++ b/lustre/kernel_patches/patches/lustre_version.patch @@ -1,3 +1,8 @@ +This patch is no longer needed since Lustre 2.2. It is kept here to +allow older versions of Lustre to build against the same kernel as +Lustre 2.2 in order to allow upgrade of just Lustre without also +replacing the kernel at the same time. + Version 47: allow the ext3_map_inode_page() created param to be NULL Version 46: Separate ->fs_private in struct file Version 45: more robust and general dev_read_only for failover (b=4834) diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index de2225b..830eca1 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -45,8 +45,6 @@ #include #include #include -//#include -//#include #include "llite_internal.h" diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index df14fd5..6b0a59d 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -46,7 +46,6 @@ #include #include #include -#include #include "llite_internal.h" #define SA_OMITTED_ENTRY_MAX 8ULL diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index de8e858..43656bd 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -900,8 +900,6 @@ static int fsfilt_ext3_sync(struct super_block *sb) ext3_ext_walk_space(tree, block, num, cb); #endif -#include - struct bpointers { unsigned long *blocks; int *created; diff --git a/lustre/lvfs/lvfs_linux.c b/lustre/lvfs/lvfs_linux.c index ece23b4..7414471 100644 --- a/lustre/lvfs/lvfs_linux.c +++ b/lustre/lvfs/lvfs_linux.c @@ -486,7 +486,6 @@ out: } EXPORT_SYMBOL(simple_truncate); -#ifdef LUSTRE_KERNEL_VERSION int __lvfs_set_rdonly(lvfs_sbdev_type dev, lvfs_sbdev_type jdev) { #ifdef HAVE_DEV_SET_RDONLY @@ -536,7 +535,6 @@ int lvfs_check_io_health(struct obd_device *obd, struct file *file) RETURN(rc); } EXPORT_SYMBOL(lvfs_check_io_health); -#endif /* LUSTRE_KERNEL_VERSION */ void obd_update_maxusage() { diff --git a/lustre/obdclass/darwin/darwin-sysctl.c b/lustre/obdclass/darwin/darwin-sysctl.c index f4cd1eb..929407fd 100644 --- a/lustre/obdclass/darwin/darwin-sysctl.c +++ b/lustre/obdclass/darwin/darwin-sysctl.c @@ -48,9 +48,6 @@ #ifndef BUILD_VERSION #define BUILD_VERSION "Unknown" #endif -#ifndef LUSTRE_KERNEL_VERSION -#define LUSTRE_KERNEL_VERSION "Unknown Darwin version" -#endif cfs_sysctl_table_header_t *obd_table_header = NULL; @@ -62,7 +59,6 @@ extern unsigned int obd_sync_filter; extern atomic_t obd_memory; int read_build_version SYSCTL_HANDLER_ARGS; -int read_lustre_kernel_version SYSCTL_HANDLER_ARGS; SYSCTL_NODE (, OID_AUTO, lustre, CTLFLAG_RW, 0, "lustre sysctl top"); @@ -72,9 +68,6 @@ SYSCTL_PROC(_lustre, OID_AUTO, timeout, SYSCTL_PROC(_lustre, OID_AUTO, build_version, CTLTYPE_STRING | CTLFLAG_RD , NULL, 0, &read_build_version, "A", "lustre_build_version"); -SYSCTL_PROC(_lustre, OID_AUTO, lustre_kernel_version, - CTLTYPE_STRING | CTLFLAG_RD , NULL, - 0, &read_lustre_kernel_version, "A", "lustre_build_version"); SYSCTL_INT(_lustre, OID_AUTO, dump_on_timeout, CTLTYPE_INT | CTLFLAG_RW, &obd_dump_on_timeout, 0, "lustre_dump_on_timeout"); @@ -129,19 +122,6 @@ int read_build_version SYSCTL_HANDLER_ARGS return error; } -int read_lustre_kernel_version SYSCTL_HANDLER_ARGS -{ - int error = 0; - - error = sysctl_handle_long(oidp, oidp->oid_arg1, oidp->oid_arg2, req); - if ( req->newptr != NULL) { - printf("sysctl lustre_kernel_version is read-only!\n"); - } else { - error = SYSCTL_OUT(req, LUSTRE_KERNEL_VERSION, strlen(LUSTRE_KERNEL_VERSION)); - } - return error; -} - void obd_sysctl_init (void) { #if 1 diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index 2cfaec7..33de26f 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -86,7 +86,6 @@ #include #include #ifdef __KERNEL__ -#include int proc_version; @@ -443,18 +442,4 @@ int class_procfs_clean(void) } RETURN(0); } - - -/* Check that we're building against the appropriate version of the Lustre - * kernel patch */ -#include -#ifdef LUSTRE_KERNEL_VERSION -#define LUSTRE_MIN_VERSION 45 -#define LUSTRE_MAX_VERSION 47 -#if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION) -# error Cannot continue: Your Lustre kernel patch is older than the sources -#elif (LUSTRE_KERNEL_VERSION > LUSTRE_MAX_VERSION) -# error Cannot continue: Your Lustre sources are older than the kernel patch -#endif -#endif #endif