From: Marc Dionne Date: Mon, 9 Jun 2008 04:38:58 +0000 (+0000) Subject: linux-2626-support-20080608 X-Git-Tag: openafs-devel-1_5_61~1054 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=bed3e31ca4da711649d6c6b9ab828515cd3418fc linux-2626-support-20080608 LICENSE IPL10 FIXES 101091 add 2.6.26 support --- diff --git a/acinclude.m4 b/acinclude.m4 index 1fbd775..f951122 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -607,6 +607,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/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 752057d..93584ef 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -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_proc.c b/src/afs/LINUX/osi_proc.c index 7b378e2..7c15b73 100644 --- a/src/afs/LINUX/osi_proc.c +++ b/src/afs/LINUX/osi_proc.c @@ -317,9 +317,16 @@ void osi_proc_init(void) { struct proc_dir_entry *entry; - +#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 #ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H entry = create_proc_entry("unixusers", 0, openafs_procfs); if (entry) { @@ -338,9 +345,18 @@ osi_proc_init(void) void osi_proc_clean(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); #ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H remove_proc_entry("unixusers", openafs_procfs); #endif - remove_proc_entry(PROC_FSDIRNAME, proc_root_fs); } diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index f14d5f8..65df334 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1024,3 +1024,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]) +