From d0a166bdffce2d2498cab54cc458d9489d05c299 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 31 Mar 2009 13:16:17 +0000 Subject: [PATCH 1/1] linux-2630-maybe-20090331 LICENSE IPL10 FIXES 124560 hopefully support 2.6.30 when it's released --- acinclude.m4 | 1 + src/afs/LINUX/osi_proc.c | 4 ++++ src/cf/linux-test4.m4 | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 296c042..ae9d031 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -840,6 +840,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_KMEM_CACHE_INIT LINUX_HAVE_GRAB_CACHE_PAGE_WRITE_BEGIN LINUX_STRUCT_TASK_HAS_CRED + LINUX_STRUCT_PROC_DIR_ENTRY_HAS_OWNER LINUX_HAVE_KMEM_CACHE_T LINUX_KMEM_CACHE_CREATE_TAKES_DTOR LINUX_D_PATH_TAKES_STRUCT_PATH diff --git a/src/afs/LINUX/osi_proc.c b/src/afs/LINUX/osi_proc.c index 3f340de..2ac51af 100644 --- a/src/afs/LINUX/osi_proc.c +++ b/src/afs/LINUX/osi_proc.c @@ -336,7 +336,9 @@ osi_proc_init(void) entry = create_proc_entry("unixusers", 0, openafs_procfs); if (entry) { entry->proc_fops = &afs_unixuser_fops; +#if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER) entry->owner = THIS_MODULE; +#endif } entry = create_proc_entry(PROC_CELLSERVDB_NAME, 0, openafs_procfs); if (entry) @@ -344,7 +346,9 @@ osi_proc_init(void) #else entry = create_proc_info_entry(PROC_CELLSERVDB_NAME, (S_IFREG|S_IRUGO), openafs_procfs, csdbproc_info); #endif +#if defined(STRUCT_PROC_DIR_ENTRY_HAS_OWNER) entry->owner = THIS_MODULE; +#endif } void diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 3e41edf..b787c25 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1201,3 +1201,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]) -- 1.9.4