diff --git a/acinclude.m4 b/acinclude.m4 index 9402d8592e..e544fa7bde 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -715,6 +715,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_HAVE_WRITE_BEGIN_AOP LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN LINUX_STRUCT_TASK_HAS_CRED + LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER LINUX_KMEM_CACHE_INIT LINUX_HAVE_BDI_INIT LINUX_HAVE_KMEM_CACHE_T diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index 12ac6948da..7807b66623 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -258,7 +258,9 @@ afsproc_init(void) entry1->proc_fops = &afs_syscall_fops; +#if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER) entry1->owner = THIS_MODULE; +#endif #ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H entry2 = create_proc_entry(PROC_CELLSERVDB_NAME, 0, openafs_procfs); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 409dd05759..b8093a1b9b 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1138,3 +1138,17 @@ _u =_t.cred->uid ;], if test "x$ac_cv_linux_struct_task_has_cred" = "xyes"; then AC_DEFINE([STRUCT_TASK_HAS_CRED], 1, [define if struct task has a cred pointer]) fi]) + +AC_DEFUN([LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER], [ + AC_MSG_CHECKING([if struct proc_dir_entry_has_owner]) + AC_CACHE_VAL([ac_cv_linux_struct_proc_dir_entry_has_owner], [ + AC_TRY_KBUILD( +[#include ], +[struct proc_dir_entry _p; +_p.owner= "";], + ac_cv_linux_struct_proc_dir_entry_has_owner=yes, + ac_cv_linux_struct_proc_dir_entry_has_owner=no)]) + AC_MSG_RESULT($ac_cv_linux_struct_proc_dir_entry_has_owner) + if test "x$ac_cv_linux_struct_proc_dir_entry_has_owner" = "xyes"; then + AC_DEFINE([STRUCT_PROC_DIR_ENTRY_HAS_OWNER], 1, [define if struct proc_dir_entry has an owner member]) + fi])