[POWERPC] spufs: turn run_sema into run_mutex
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Apr 2007 19:08:17 +0000 (21:08 +0200)
committerArnd Bergmann <arnd@klappe.arndb.de>
Mon, 23 Apr 2007 19:18:56 +0000 (21:18 +0200)
There is no reason for run_sema to be a struct semaphore.  Changing
it to a mutex and rename it accordingly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
arch/powerpc/platforms/cell/spufs/context.c
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/spufs.h

index ce17a2847184018992c0fb79fd79476ac842c541..a87d9ca3dba26c926822f068e7e8ea0055cb60ba 100644 (file)
@@ -44,7 +44,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
        spin_lock_init(&ctx->mapping_lock);
        kref_init(&ctx->kref);
        mutex_init(&ctx->state_mutex);
-       init_MUTEX(&ctx->run_sema);
+       mutex_init(&ctx->run_mutex);
        init_waitqueue_head(&ctx->ibox_wq);
        init_waitqueue_head(&ctx->wbox_wq);
        init_waitqueue_head(&ctx->stop_wq);
index 1a8195bf75d5c0523822f0788345f7318afdeda4..7cf5b298fa13887de893187b2c1f583f03b2f13c 100644 (file)
@@ -288,7 +288,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx,
        int ret;
        u32 status;
 
-       if (down_interruptible(&ctx->run_sema))
+       if (mutex_lock_interruptible(&ctx->run_mutex))
                return -ERESTARTSYS;
 
        ctx->ops->master_start(ctx);
@@ -345,6 +345,6 @@ out2:
 
 out:
        *event = ctx->event_return;
-       up(&ctx->run_sema);
+       mutex_unlock(&ctx->run_mutex);
        return ret;
 }
index 9993c9b3cffcf7f60bc68d4f8304b78a98ccc1b4..dd5fc6494ecfddd0851761c0efc674f413970d98 100644 (file)
@@ -60,7 +60,7 @@ struct spu_context {
 
        enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
        struct mutex state_mutex;
-       struct semaphore run_sema;
+       struct mutex run_mutex;
 
        struct mm_struct *owner;