binder: switch alloc->mutex to spinlock_t
[linux-2.6-block.git] / drivers / android / binder_alloc.h
index a5181916942e71a9b7cb420eb981eb714fddd8dc..70387234477e0cc9e22317d705bc5206f90a9f94 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/rbtree.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <linux/rtmutex.h>
+#include <linux/spinlock.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/list_lru.h>
@@ -72,7 +72,7 @@ struct binder_lru_page {
 
 /**
  * struct binder_alloc - per-binder proc state for binder allocator
- * @mutex:              protects binder_alloc fields
+ * @lock:               protects binder_alloc fields
  * @vma:                vm_area_struct passed to mmap_handler
  *                      (invariant after mmap)
  * @mm:                 copy of task->mm (invariant after open)
@@ -96,7 +96,7 @@ struct binder_lru_page {
  * struct binder_buffer objects used to track the user buffers
  */
 struct binder_alloc {
-       struct mutex mutex;
+       spinlock_t lock;
        struct vm_area_struct *vma;
        struct mm_struct *mm;
        unsigned long buffer;
@@ -153,9 +153,9 @@ binder_alloc_get_free_async_space(struct binder_alloc *alloc)
 {
        size_t free_async_space;
 
-       mutex_lock(&alloc->mutex);
+       spin_lock(&alloc->lock);
        free_async_space = alloc->free_async_space;
-       mutex_unlock(&alloc->mutex);
+       spin_unlock(&alloc->lock);
        return free_async_space;
 }