From fc0c821362bc4061489aa5c5dbf3f2748890bc90 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 27 Jun 2008 23:08:37 -0700 Subject: [PATCH] Apply upstream delta for Linux 2.6.26 support Upstream delta STABLE14-linux-2626-support-20080608. --- acinclude.m4 | 2 ++ debian/changelog | 1 + src/afs/LINUX/osi_groups.c | 6 +++++- src/afs/LINUX/osi_module.c | 21 +++++++++++++++++++-- src/cf/linux-test4.m4 | 27 +++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 231ca5a3f..164c310cc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -600,6 +600,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_KBUILD_USES_EXTRA_CFLAGS LINUX_KERNEL_COMPILE_WORKS + LINUX_EXPORTS_FIND_TASK_BY_PID + LINUX_EXPORTS_PROC_ROOT_FS LINUX_HAVE_CURRENT_KERNEL_TIME LINUX_KMEM_CACHE_INIT LINUX_HAVE_KMEM_CACHE_T diff --git a/debian/changelog b/debian/changelog index e71496cc9..2c16aab59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ openafs (1.4.7.dfsg1-3) UNRELEASED; urgency=low + * Apply upstream delta for Linux 2.6.26 support. * When clearing the restart time while installing a new cell, pass -localauth to avoid an authentication failure. Thanks, Davor Ocelic. (Closes: #488152) diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index cd8fb5035..612d05838 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -20,7 +20,7 @@ #endif RCSID - ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.15 2008/04/19 21:56:11 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.16 2008/06/09 03:39:44 shadow Exp $"); #include "afs/sysincludes.h" #include "afsincludes.h" @@ -646,7 +646,11 @@ void osi_keyring_init(void) # endif rcu_read_lock(); # endif +#if defined(EXPORTED_FIND_TASK_BY_PID) p = find_task_by_pid(1); +#else + p = find_task_by_vpid(1); +#endif if (p && p->user->session_keyring) __key_type_keyring = p->user->session_keyring->type; # ifdef EXPORTED_TASKLIST_LOCK diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index 52d2ced82..ef672402a 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -15,7 +15,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.29 2007/10/24 18:09:50 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.52.2.30 2008/06/09 03:39:44 shadow Exp $"); #include /* early to avoid printf->printk mapping */ #include "afs/sysincludes.h" @@ -237,8 +237,16 @@ afsproc_init(void) { struct proc_dir_entry *entry1; struct proc_dir_entry *entry2; +#if !defined(EXPORTED_PROC_ROOT_FS) + char path[64]; +#endif +#if defined(EXPORTED_PROC_ROOT_FS) openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs); +#else + sprintf(path, "fs/%s", PROC_FSDIRNAME); + openafs_procfs = proc_mkdir(path, NULL); +#endif entry1 = create_proc_entry(PROC_SYSCALL_NAME, 0666, openafs_procfs); entry1->proc_fops = &afs_syscall_fops; @@ -263,9 +271,18 @@ afsproc_init(void) static void afsproc_exit(void) { +#if !defined(EXPORTED_PROC_ROOT_FS) + char path[64]; +#endif + +#if defined(EXPORTED_PROC_ROOT_FS) + remove_proc_entry(PROC_FSDIRNAME, proc_root_fs); +#else + sprintf(path, "fs/%s", PROC_FSDIRNAME); + remove_proc_entry(path, NULL); +#endif remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs); remove_proc_entry(PROC_SYSCALL_NAME, openafs_procfs); - remove_proc_entry(PROC_FSDIRNAME, proc_root_fs); #if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL) if (ioctl32_done) unregister_ioctl32_conversion(VIOC_SYSCALL32); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 3c131cd0e..75949d8a4 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -993,3 +993,30 @@ AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [ AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable]) fi]) +AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [ + AC_MSG_CHECKING([if find_task_by_pid is usable]) + AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [ + AC_TRY_KBUILD( +[#include ], +[pid_t p; +find_task_by_pid(p);], + ac_cv_linux_exports_find_task_by_pid=yes, + ac_cv_linux_exports_find_task_by_pid=no)]) + AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid) + if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then + AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable]) + fi]) + +AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [ + AC_MSG_CHECKING([if proc_root_fs is defined and exported]) + AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [ + AC_TRY_KBUILD( +[#include ], +[struct proc_dir_entry *p = proc_root_fs;], + ac_cv_linux_exports_proc_root_fs=yes, + ac_cv_linux_exports_proc_root_fs=no)]) + AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs) + if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then + AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported]) + fi]) + -- 2.39.5