[OpenAFS-devel] Mutexes in afs/LINUX/osi*

Jason McCormick jasonmc@cert.org
Fri, 11 Aug 2006 23:14:57 -0400


This is a multi-part message in MIME format.
--------------090003000409010608030904
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Sorry, I didn't copy the right patch locally.  The previous one
accidentally removed 'static' from osi_cred.c.

- Jason

--------------090003000409010608030904
Content-Type: text/x-patch;
 name="afs_osi_mutex.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="afs_osi_mutex.patch"

--- src/afs/LINUX/osi_alloc.c.orig	2006-08-11 22:23:13.000000000 -0400
+++ src/afs/LINUX/osi_alloc.c	2006-08-11 22:33:06.000000000 -0400
@@ -282,7 +282,11 @@
 /************** Linux memory allocator interface functions **********/
 
 #if defined(AFS_LINUX24_ENV)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+DEFINE_MUTEX(afs_linux_alloc_sem);
+#else
 DECLARE_MUTEX(afs_linux_alloc_sem);
+#endif
 #else
 struct semaphore afs_linux_alloc_sem = MUTEX;
 #endif
--- src/afs/LINUX/osi_cred.c.orig	2006-08-11 22:30:19.000000000 -0400
+++ src/afs/LINUX/osi_cred.c	2006-08-11 22:33:35.000000000 -0400
@@ -33,7 +33,11 @@
  * test if no creds in pool before grabbing lock in crfree().
  */
 #if defined(AFS_LINUX24_ENV)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+static DEFINE_MUTEX(linux_cred_pool_lock);
+#else
 static DECLARE_MUTEX(linux_cred_pool_lock);
+#endif
 #else
 static struct semaphore linux_cred_pool_lock = MUTEX;
 #endif
--- src/afs/LINUX/osi_pag_module.c.orig	2006-08-11 22:11:27.000000000 -0400
+++ src/afs/LINUX/osi_pag_module.c	2006-08-11 22:15:41.000000000 -0400
@@ -47,7 +47,11 @@
 MODULE_PARM_DESC(this_cell, "Local cell name");
 
 #if defined(AFS_LINUX24_ENV)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+DEFINE_MUTEX(afs_global_lock);
+#else
 DECLARE_MUTEX(afs_global_lock);
+#endif
 struct proc_dir_entry *openafs_procfs;
 #else
 struct semaphore afs_global_lock = MUTEX;

--------------090003000409010608030904--