mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 06:50:12 +00:00
STABLE14-linux-fc9-20080419
LICENSE IPL10
add in needed changes for fc9 kernels
(cherry picked from commit 0caa578a05
)
This commit is contained in:
parent
e2c5207ca4
commit
2df69d3595
@ -677,6 +677,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
||||
LINUX_EXPORTS_SYS_CLOSE
|
||||
LINUX_EXPORTS_SYS_OPEN
|
||||
LINUX_EXPORTS_SYS_WAIT4
|
||||
LINUX_EXPORTS_RCU_READ_LOCK
|
||||
LINUX_WHICH_MODULES
|
||||
if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
|
||||
AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
|
||||
|
@ -50,12 +50,14 @@ afs_setgroups(cred_t **cr, struct group_info *group_info, int change_parent)
|
||||
|
||||
crset(*cr);
|
||||
|
||||
#ifdef STRUCT_TASK_STRUCT_HAS_PARENT
|
||||
if (change_parent) {
|
||||
old_info = current->parent->group_info;
|
||||
get_group_info(group_info);
|
||||
current->parent->group_info = group_info;
|
||||
put_group_info(old_info);
|
||||
}
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -625,32 +627,40 @@ extern rwlock_t tasklist_lock __attribute__((weak));
|
||||
void osi_keyring_init(void)
|
||||
{
|
||||
struct task_struct *p;
|
||||
|
||||
/* If we can't lock the tasklist, either with its explicit lock,
|
||||
* or by using the RCU lock, then we can't safely work out the
|
||||
* type of a keyring. So, we have to rely on the weak reference.
|
||||
* If that's not available, then keyring based PAGs won't work.
|
||||
*/
|
||||
|
||||
#if defined(EXPORTED_TASKLIST_LOCK) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
|
||||
if (__key_type_keyring == NULL) {
|
||||
#ifdef EXPORTED_TASKLIST_LOCK
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
if (&tasklist_lock)
|
||||
read_lock(&tasklist_lock);
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
else
|
||||
# endif
|
||||
# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
else
|
||||
# endif
|
||||
rcu_read_lock();
|
||||
#endif
|
||||
# endif
|
||||
p = find_task_by_pid(1);
|
||||
if (p && p->user->session_keyring)
|
||||
__key_type_keyring = p->user->session_keyring->type;
|
||||
#ifdef EXPORTED_TASKLIST_LOCK
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
if (&tasklist_lock)
|
||||
read_unlock(&tasklist_lock);
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
else
|
||||
# endif
|
||||
# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK))
|
||||
# ifdef EXPORTED_TASKLIST_LOCK
|
||||
else
|
||||
# endif
|
||||
rcu_read_unlock();
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
register_key_type(&key_type_afs_pag);
|
||||
}
|
||||
|
@ -980,3 +980,16 @@ printk("%x\n", _nd.path);],
|
||||
ac_cv_linux_struct_nameidata_has_path=no)])
|
||||
AC_MSG_RESULT($ac_cv_linux_struct_nameidata_has_path)])
|
||||
|
||||
AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
|
||||
AC_MSG_CHECKING([if rcu_read_lock is usable])
|
||||
AC_CACHE_VAL([ac_cv_linux_exports_rcu_read_lock], [
|
||||
AC_TRY_KBUILD(
|
||||
[#include <linux/rcupdate.h>],
|
||||
[rcu_read_lock();],
|
||||
ac_cv_linux_exports_rcu_read_lock=yes,
|
||||
ac_cv_linux_exports_rcu_read_lock=no)])
|
||||
AC_MSG_RESULT($ac_cv_linux_exports_rcu_read_lock)
|
||||
if test "x$ac_cv_linux_exports_rcu_read_lock" = "xyes"; then
|
||||
AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
|
||||
fi])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user