diff options
author | Christoph Hellwig <hch@lst.de> | 2007-02-13 23:36:50 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-02-13 23:52:37 +0300 |
commit | 650f8b0291ecd0abdeadbd0ff3d70c3538e55405 (patch) | |
tree | 3d3df208380ac7b2fafdd03b5fbcc01d2dedd934 /arch/powerpc/platforms/cell/spufs/spufs.h | |
parent | 202557d29eae528f464652e92085f3b19b05a0a7 (diff) | |
download | linux-650f8b0291ecd0abdeadbd0ff3d70c3538e55405.tar.xz |
[POWERPC] spufs: simplify state_mutex
The r/w semaphore to lock the spus was overkill and can be replaced
with a mutex to make it faster, simpler and easier to debug. It also
helps to allow making most spufs interruptible in future patches.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/spufs.h')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 9b44abe921cc..de2401afb226 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -23,7 +23,7 @@ #define SPUFS_H #include <linux/kref.h> -#include <linux/rwsem.h> +#include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/fs.h> @@ -53,7 +53,7 @@ struct spu_context { u64 object_id; /* user space pointer for oprofile */ enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state; - struct rw_semaphore state_sema; + struct mutex state_mutex; struct semaphore run_sema; struct mm_struct *owner; @@ -173,7 +173,7 @@ int spu_acquire_exclusive(struct spu_context *ctx); static inline void spu_release_exclusive(struct spu_context *ctx) { - up_write(&ctx->state_sema); + mutex_unlock(&ctx->state_mutex); } int spu_activate(struct spu_context *ctx, u64 flags); |