All pastes #1473016 Raw Edit

patch_rcu

public diff v1 · immutable
#1473016 ·published 2009-06-24 19:10 UTC
rendered paste body
diff -b -u -r ../pre11/openafs-1.4.11pre1/src/afs/afs_osi.c src/afs/afs_osi.c--- ../pre11/openafs-1.4.11pre1/src/afs/afs_osi.c	2009-05-12 09:03:47.000000000 -0400+++ src/afs/afs_osi.c	2009-06-24 14:59:09.670004391 -0400@@ -850,7 +850,7 @@     if (&tasklist_lock) 	read_lock(&tasklist_lock); #endif /* EXPORTED_TASKLIST_LOCK */-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)     else #endif /* EXPORTED_TASKLIST_LOCK && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) */@@ -884,7 +884,7 @@     if (&tasklist_lock) 	read_unlock(&tasklist_lock); #endif /* EXPORTED_TASKLIST_LOCK */-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) && defined(EXPORTED_RCU_READ_LOCK) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)     else #endif /* EXPORTED_TASKLIST_LOCK && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) */@@ -1110,6 +1110,7 @@     return rv; } #elif defined(AFS_LINUX22_ENV)+#if defined(EXPORTED_RCU_READ_LOCK) && !defined(LINUX_KEYRING_SUPPORT) const struct AFS_UCRED * afs_osi_proc2cred(AFS_PROC * pr) {@@ -1142,6 +1143,7 @@      return rv; }+#endif #else const struct AFS_UCRED * afs_osi_proc2cred(AFS_PROC * pr)diff -b -u -r ../pre11/openafs-1.4.11pre1/src/afs/afs_user.c src/afs/afs_user.c--- ../pre11/openafs-1.4.11pre1/src/afs/afs_user.c	2006-12-20 15:09:06.000000000 -0500+++ src/afs/afs_user.c	2009-06-24 14:59:32.654519642 -0400@@ -552,7 +552,7 @@ }				/*afs_SetPrimary */  -#if AFS_GCPAGS+#if defined(AFS_GCPAGS)  /*  * Called by osi_TraverseProcTable (from afs_GCPAGs) for each @@ -581,6 +581,7 @@ /*  * LOCKS: afs_GCPAGs_perproc_func requires write lock on afs_xuser  */+#if !defined(LINUX_KEYRING_SUPPORT) && defined(EXPORTED_RCU_READ_LOCK) void afs_GCPAGs_perproc_func(AFS_PROC * pproc) {@@ -629,6 +630,7 @@ 	}     } }+#endif  /*  * Go through the process table, find all unused PAGs diff -b -u -r ../pre11/openafs-1.4.11pre1/src/afs/LINUX/osi_groups.c src/afs/LINUX/osi_groups.c--- ../pre11/openafs-1.4.11pre1/src/afs/LINUX/osi_groups.c	2009-03-23 11:17:02.000000000 -0400+++ src/afs/LINUX/osi_groups.c	2009-06-23 20:51:07.258620877 -0400@@ -228,7 +228,7 @@ static struct key_type *__key_type_keyring = &key_type_keyring;  static int-install_session_keyring(struct task_struct *task, struct key *keyring)+install_session_keyring(struct key *keyring) {     struct key *old;     char desc[20];@@ -242,21 +242,21 @@  	/* create an empty session keyring */ 	not_in_quota = KEY_ALLOC_IN_QUOTA;-	sprintf(desc, "_ses.%u", task->tgid);+	sprintf(desc, "_ses.%u", current->tgid);  #if defined(KEY_ALLOC_NEEDS_STRUCT_TASK) 	keyring = key_alloc(__key_type_keyring, desc,-			    task_uid(task), task_gid(task), task,+			    current_uid(), current_gid(), current, 			    (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_ALL, 			    not_in_quota); #elif defined(KEY_ALLOC_NEEDS_CRED) 	keyring = key_alloc(__key_type_keyring, desc,-			    task_uid(task), task_gid(task), current_cred(),+			    current_uid(), current_gid(), current_cred(), 			    (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_ALL, 			    not_in_quota); #else 	keyring = key_alloc(__key_type_keyring, desc,-			    task_uid(task), task_gid(task),+			    current_uid(), current_gid(), 			    (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_ALL, 			    not_in_quota); #endif@@ -273,11 +273,11 @@     }      /* install the keyring */-    spin_lock_irq(&task->sighand->siglock);-    old = task_session_keyring(task);+    spin_lock_irq(&current->sighand->siglock);+    old = task_session_keyring(current);     smp_wmb();-    task_session_keyring(task) = keyring;-    spin_unlock_irq(&task->sighand->siglock);+    task_session_keyring(current) = keyring;+    spin_unlock_irq(&current->sighand->siglock);      if (old) 	    key_put(old);@@ -340,7 +340,7 @@ #ifdef LINUX_KEYRING_SUPPORT     if (code == 0) { -	(void) install_session_keyring(current, NULL);+	(void) install_session_keyring(NULL);  	if (current_session_keyring()) { 	    struct key *key;