From 20b6d341dfe94de7fd614ee7e431e06eada75fc9 Mon Sep 17 00:00:00 2001
From: shadow <shadow>
Date: Fri, 22 Jun 2007 07:01:50 +0000
Subject: [PATCH] improve checks for exported symbols. This allow run check
 without sources, but with Module.symvers shipped with kernel distribution.
 add check for truncate_complete_page used by patchless client.

b=12415
i=adilger
i=scjody
---
 lustre/ChangeLog               |  8 +++++++
 lustre/autoconf/lustre-core.m4 | 39 ++++++++++++++++++++--------------
 2 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 4c9f59801c..bf5fbc0ddd 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -370,6 +370,14 @@ Description: Correct condition for output debug message.
 Details    : inode i_nlink equal zero is not enough for output message about disk
 	     corruption, i_ctime and i_mode should be also checked.
 
+Severity   : minor
+Bugzilla   : 12415
+Frequency  : always in patchless client
+Description: add configure check for truncate_complete_page
+Details    : improve checks for exported symbols. This allow run check without
+             sources, but with Module.symvers shipped with kernel distribution.
+             add check for truncate_complete_page used by patchless client.
+
 --------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index 383c170fa6..0359013bc5 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -567,22 +567,21 @@ $1
 ],[
 AC_MSG_RESULT([no])
 ])
+])
 
 #
 # LC_EXPORT___IGET
 # starting from 2.6.19 linux kernel exports __iget()
 #
 AC_DEFUN([LC_EXPORT___IGET],
-[AC_MSG_CHECKING([if kernel exports __iget])
-	if grep -q "EXPORT_SYMBOL(__iget)" $LINUX/fs/inode.c 2>/dev/null ; then
-		AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
-	fi
+[LB_CHECK_SYMBOL_EXPORT([__iget],
+[fs/inode.c],[
+        AC_DEFINE(HAVE_EXPORT___IGET, 1, [kernel exports __iget])
+],[
 ])
 ])
 
+
 AC_DEFUN([LC_LUSTRE_VERSION_H],
 [LB_CHECK_FILE([$LINUX/include/linux/lustre_version.h],[
 	rm -f "$LUSTRE/include/linux/lustre_version.h"
@@ -598,15 +597,11 @@ AC_DEFUN([LC_LUSTRE_VERSION_H],
 ])
 
 AC_DEFUN([LC_FUNC_SET_FS_PWD],
-[AC_MSG_CHECKING([if kernel exports show_task])
-have_show_task=0
-        if grep -q "EXPORT_SYMBOL(show_task)" \
-                 "$LINUX/fs/namespace.c" 2>/dev/null ; then
-		AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
-		AC_MSG_RESULT([yes])
-	else
-		AC_MSG_RESULT([no])
-        fi
+[LB_CHECK_SYMBOL_EXPORT([set_fs_pwd],
+[fs/namespace.c],[
+        AC_DEFINE(HAVE_SET_FS_PWD, 1, [set_fs_pwd is exported])
+],[
+])
 ])
 
 
@@ -1029,6 +1024,16 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE],
+[LB_CHECK_SYMBOL_EXPORT([truncate_complete_page],
+[mm/truncate.c],[
+AC_DEFINE(HAVE_TRUNCATE_COMPLETE_PAGE, 1,
+            [kernel export truncate_complete_page])
+],[
+])
+])
+
+
 #
 # LC_PROG_LINUX
 #
@@ -1045,6 +1050,8 @@ LC_CONFIG_QUOTA
 LC_CONFIG_HEALTH_CHECK_WRITE
 
 LC_TASK_PPTR
+# RHEL4 pachess
+LC_EXPORT_TRUNCATE_COMPLETE
 
 LC_STRUCT_KIOBUF
 LC_FUNC_COND_RESCHED
-- 
GitLab