From: James Simmons Date: Fri, 6 Dec 2013 16:18:46 +0000 (-0500) Subject: LU-4287 autoconf: Improve test for proc write and read functions X-Git-Tag: 2.5.53~30 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1e60ce443bdb4d1211758b0e53aea597bbdbc22d;hp=b4d3116f44b6613a65ed259bf2f41c1eb41e2ba4 LU-4287 autoconf: Improve test for proc write and read functions 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 Change-Id: I96d21ae5f055d5077da69acdcc4948ec160dd63a Reviewed-on: http://review.whamcloud.com/8482 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 8124d2c..f47bc5f 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1258,13 +1258,12 @@ AC_DEFUN([LC_HAVE_ONLY_PROCFS_SEQ], LB_LINUX_TRY_COMPILE([ #include ],[ - 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]) ]) ])