Whamcloud - gitweb
LU-4287 autoconf: Improve test for proc write and read functions 82/8482/6
authorJames Simmons <uja.ornl@gmail.com>
Fri, 6 Dec 2013 16:18:46 +0000 (11:18 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 Dec 2013 03:17:49 +0000 (03:17 +0000)
For newer kernels the proc api has changed to using only
seq_files. To detect this I tested the presence of PDE_DATA
to determine if it was a newer kernel. Now in RHEL6.5 this
macro has been backported but the rest of the changes have
not so it has broken the build. This patch moves from
testing PDE_DATA to testing if you can call write_proc_t
in struct proc_dir_entry. In newer kernels that function
is missing.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I96d21ae5f055d5077da69acdcc4948ec160dd63a
Reviewed-on: http://review.whamcloud.com/8482
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4

index 8124d2c..f47bc5f 100644 (file)
@@ -1258,13 +1258,12 @@ AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ],
 LB_LINUX_TRY_COMPILE([
        #include <linux/proc_fs.h>
 ],[
-       struct inode *inode = NULL;
-       PDE_DATA(inode);
+       ((struct proc_dir_entry *)0)->write_proc(NULL, NULL, 0, NULL);
+],[
+       AC_MSG_RESULT([no])
 ],[
        AC_DEFINE(HAVE_ONLY_PROCFS_SEQ, 1, [only seq_files supported])
        AC_MSG_RESULT([yes])
-],[
-       AC_MSG_RESULT([no])
 ])
 ])