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>
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])
])
])