diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4
index 37ce1c47394040dcf5b8fcf2d9a111546fe1d79b..2608f9a9055f6eed1db90f7753d30c98dbeadd1a 100644
--- a/build/autoconf/lustre-build-linux.m4
+++ b/build/autoconf/lustre-build-linux.m4
@@ -403,3 +403,40 @@ AC_DEFUN([LB_LINUX_CONDITIONALS],
 [AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
 ])
 
+
+#
+# LB_CHECK_SYMBOL_EXPORT
+# check symbol exported or not 
+# $1 - symbol
+# $2 - file(s) for find.
+# $3 - do 'yes'
+# $4 - do 'no'
+#
+# 2.6 based kernels - put modversion info into $LINUX/Module.modvers
+# or check 
+AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
+[AC_MSG_CHECKING([if Linux was built with symbol $1 is exported])
+grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/Module.symvers 2>/dev/null
+rc=$?
+if test $rc -ne 0; then
+    export=0
+    for file in $2; do
+    	grep -q -E "EXPORT_SYMBOL.*($1)" "$LINUX/$file" 2>/dev/null
+    	rc=$?
+	if test $rc -eq 0; then
+		export=1
+		break;
+	fi
+    done
+    if test $export -eq 0; then
+    	AC_MSG_RESULT([no])
+    	$4
+    else
+    	AC_MSG_RESULT([yes])
+    	$3
+    fi
+else
+    AC_MSG_RESULT([yes])
+    $3
+fi
+])
diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
index 94d7475f3715b874d5ddf69e309f0d59425cbca7..4e889076ec172d26f61ce33a53378dd84244b4a4 100644
--- a/lnet/autoconf/lustre-lnet.m4
+++ b/lnet/autoconf/lustre-lnet.m4
@@ -1031,35 +1031,22 @@ LB_LINUX_TRY_COMPILE([
 # we export show_task(), but not all kernels have it (yet)
 #
 AC_DEFUN([LN_FUNC_SHOW_TASK],
-[AC_MSG_CHECKING([if kernel exports show_task])
-have_show_task=0
-for file in ksyms sched ; do
-	if grep -q "EXPORT_SYMBOL(show_task)" \
-		 "$LINUX/kernel/$file.c" 2>/dev/null ; then
-		have_show_task=1
-		break
-	fi
-done
-if test x$have_show_task = x1 ; then
-	AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
-	AC_MSG_RESULT([yes])
-else
-	AC_MSG_RESULT([no])
-fi
+[LB_CHECK_SYMBOL_EXPORT([show_task],
+[kernel/ksyms.c kernel/sched.c],[
+AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
+],[
+])
 ])
 
 # LN_TASKLIST_LOCK
 # 2.6.18 remove tasklist_lock export
 AC_DEFUN([LN_TASKLIST_LOCK],
-[AC_MSG_CHECKING([kernel export tasklist_lock])
-        if grep -q "EXPORT_SYMBOL(tasklist_lock)" \
-                 "$LINUX/kernel/fork.c" 2>/dev/null ; then
-                AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
-                          [tasklist_lock exported])
-                AC_MSG_RESULT([yes])
-        else
-                AC_MSG_RESULT([no])
-        fi
+[LB_CHECK_SYMBOL_EXPORT([tasklist_lock],
+[kernel/fork.c],[
+AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
+         [tasklist_lock exported])
+],[
+])
 ])
 
 # 2.6.19 API changes