From 3be527797699853aae3d1a71089900c9b1676791 Mon Sep 17 00:00:00 2001
From: yangsheng <yangsheng>
Date: Thu, 10 Apr 2008 03:25:49 +0000
Subject: [PATCH] Branch HEAD b=13397 i=shadow i=johann

Update Lustre server to support 2.6.22.14 vanilla kernel.
---
 build/lustre-kernel-2.4.spec.in                  |  1 -
 lustre/ChangeLog                                 |  7 ++++++-
 lustre/autoconf/lustre-core.m4                   | 16 ++++++++++++++++
 .../kernel_patches/targets/2.6-vanilla.target.in |  6 +++---
 lustre/mdt/mdt_idmap.c                           |  2 ++
 lustre/utils/mount_lustre.c                      |  1 +
 6 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/build/lustre-kernel-2.4.spec.in b/build/lustre-kernel-2.4.spec.in
index 93450aeefc..54e83407f9 100644
--- a/build/lustre-kernel-2.4.spec.in
+++ b/build/lustre-kernel-2.4.spec.in
@@ -650,7 +650,6 @@ BuildObj ()
 	    MAKE_CC="CC=$CC"
 	fi
 	$MAKE "$MAKE_CC" $OLDCONFIG
-	$MAKE "$MAKE_CC" prepare-all
 	$MAKE clean
 	rm -rf $o/.config.old $o/include/config
         # Replace the Makefile in the object directory with a version
diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 3b87f95226..c7e9d228b9 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -3,7 +3,8 @@ tbd  Sun Microsystems, Inc.
        * Support for kernels:
         2.6.9-67.0.4.EL (RHEL 4),
         2.6.16.54-0.2.5 (SLES 10),
-        2.6.18-53.1.14.el5 (RHEL 5).
+        2.6.18-53.1.14.el5 (RHEL 5),
+        2.6.22.14 vanilla (kernel.org).
        * Client support for unpatched kernels:
         (see http://wiki.lustre.org/index.php?title=Patchless_Client)
         2.6.16 - 2.6.21 vanilla (kernel.org)
@@ -12,6 +13,10 @@ tbd  Sun Microsystems, Inc.
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
+Severity   : enhancement
+Bugzilla   : 13397
+Description: Update to support 2.6.22.14 vanilla kernel.
+
 Severity   : normal
 Bugzilla   : 14533
 Frequency  : rare, on recovery
diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index 772ba1fe03..7a628c0655 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -598,6 +598,21 @@ AC_DEFUN([LC_EXPORT___IGET],
 ])
 ])
 
+#
+# LC_EXPORT_NR_FREE_BUFFER_PAGES
+# starting from 2.6.23 linux kernel exports nr_free_buffer_pages()
+#
+AC_DEFUN([LC_EXPORT_NR_FREE_BUFFER_PAGES],
+[LB_CHECK_SYMBOL_EXPORT([nr_free_buffer_pages],
+[mm/page_alloc.c],[
+        AC_DEFINE(HAVE_EXPORT_NR_FREE_BUFFER_PAGES, 1, [kernel exports nr_free_buffer_pages])
+],[
+	if test x$enable_server = xyes ; then
+        	AC_MSG_ERROR([lustre server needs this symbol to be exported.])
+	fi
+])
+])
+
 
 AC_DEFUN([LC_LUSTRE_VERSION_H],
 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
@@ -1542,6 +1557,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_UNREGISTER_BLKDEV_RETURN_INT
          LC_KERNEL_SPLICE_READ
          LC_HAVE_EXPORTFS_H
+         LC_EXPORT_NR_FREE_BUFFER_PAGES
 ])
 
 #
diff --git a/lustre/kernel_patches/targets/2.6-vanilla.target.in b/lustre/kernel_patches/targets/2.6-vanilla.target.in
index dd7a0c2fc9..22b55d76d9 100644
--- a/lustre/kernel_patches/targets/2.6-vanilla.target.in
+++ b/lustre/kernel_patches/targets/2.6-vanilla.target.in
@@ -1,8 +1,8 @@
-lnxmaj="2.6.18"
-lnxrel="8"
+lnxmaj="2.6.22"
+lnxrel="14"
 
 KERNEL=linux-$lnxmaj.$lnxrel.tar.bz2
-SERIES=2.6.18-vanilla.series
+SERIES=2.6.22-vanilla.series
 VERSION=$lnxmaj
 EXTRA_VERSION="${lnxrel}_lustre.@VERSION@"
 LUSTRE_VERSION=@VERSION@
diff --git a/lustre/mdt/mdt_idmap.c b/lustre/mdt/mdt_idmap.c
index fb810413b5..468c77980e 100644
--- a/lustre/mdt/mdt_idmap.c
+++ b/lustre/mdt/mdt_idmap.c
@@ -27,7 +27,9 @@
 #endif
 #define DEBUG_SUBSYSTEM S_MDS
 
+#ifndef AUTOCONF_INCLUDED
 #include <linux/config.h>
+#endif
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c
index 004890ccad..c0905bc513 100644
--- a/lustre/utils/mount_lustre.c
+++ b/lustre/utils/mount_lustre.c
@@ -206,6 +206,7 @@ static const struct opt_map opt_map[] = {
   { "nouser",   1, 0         },      /* Forbid ordinary user to mount */
   { "noowner",  1, 0         },      /* Device owner has no special privs */
   { "_netdev",  0, 0         },      /* Device accessible only via network */
+  { "loop",     0, 0         },
   { NULL,       0, 0         }
 };
 /****************************************************************************/
-- 
GitLab