Whamcloud - gitweb
LU-1484 lprocfs: refine LC_PROCFS_USERS check
authorBobi Jam <bobijam.xu@intel.com>
Wed, 9 Jan 2013 01:16:08 +0000 (09:16 +0800)
committerJohann Lombardi <johann.lombardi@intel.com>
Mon, 14 Jan 2013 11:41:16 +0000 (06:41 -0500)
In some RHEL patched 2.6.18 kernels, pde_users member is added in
another struct proc_dir_entry_aux instead of in struct proc_dir_entry
in later kernel version of 2.6.23.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Icee65893b2fbf4d0c3b3e957cb038be99aaf6eb8
Reviewed-on: http://review.whamcloud.com/4976
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/autoconf/lustre-core.m4

index 9385d01..47ff230 100644 (file)
@@ -1240,10 +1240,22 @@ LB_LINUX_TRY_COMPILE([
         pde.pde_users   = 0;
 ],[
         AC_MSG_RESULT([yes])
-        AC_DEFINE(HAVE_PROCFS_USERS, 1, 
+        AC_DEFINE(HAVE_PROCFS_USERS, 1,
                 [kernel has pde_users member in procfs entry struct])
 ],[
-        AC_MSG_RESULT([no])
+       LB_LINUX_TRY_COMPILE([
+               #include "$LINUX/fs/proc/internal.h"
+       ],[
+               struct proc_dir_entry_aux pde_aux;
+
+               pde_aux.pde_users = 0;
+       ],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_PROCFS_USERS, 1,
+                       [kernel has pde_users member in proc_dir_entry_aux])
+       ],[
+               AC_MSG_RESULT([no])
+       ])
 ])
 ])