libfs: rename simple_attr_close to simple_attr_release
[sfrench/cifs-2.6.git] / arch / powerpc / platforms / cell / spufs / file.c
index 3fcd06418b01d165ba1d01f7d9930608d6d15c6d..e393144d533dcf06f988fe841c8a8b527569973a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/poll.h>
 #include <linux/ptrace.h>
 #include <linux/seq_file.h>
+#include <linux/marker.h>
 
 #include <asm/io.h>
 #include <asm/semaphore.h>
@@ -358,6 +359,8 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
        struct spu_context *ctx = vma->vm_file->private_data;
        unsigned long area, offset = address - vma->vm_start;
 
+       spu_context_nospu_trace(spufs_ps_nopfn__enter, ctx);
+
        offset += vma->vm_pgoff << PAGE_SHIFT;
        if (offset >= ps_size)
                return NOPFN_SIGBUS;
@@ -375,11 +378,14 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
 
        if (ctx->state == SPU_STATE_SAVED) {
                up_read(&current->mm->mmap_sem);
+               spu_context_nospu_trace(spufs_ps_nopfn__sleep, ctx);
                spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
+               spu_context_trace(spufs_ps_nopfn__wake, ctx, ctx->spu);
                down_read(&current->mm->mmap_sem);
        } else {
                area = ctx->spu->problem_phys + ps_offs;
                vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
+               spu_context_trace(spufs_ps_nopfn__insert, ctx, ctx->spu);
        }
 
        spu_release(ctx);
@@ -454,7 +460,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)
        if (!i->i_openers++)
                ctx->cntl = inode->i_mapping;
        mutex_unlock(&ctx->mapping_lock);
-       return spufs_attr_open(inode, file, spufs_cntl_get,
+       return simple_attr_open(inode, file, spufs_cntl_get,
                                        spufs_cntl_set, "0x%08lx");
 }
 
@@ -464,7 +470,7 @@ spufs_cntl_release(struct inode *inode, struct file *file)
        struct spufs_inode_info *i = SPUFS_I(inode);
        struct spu_context *ctx = i->i_ctx;
 
-       spufs_attr_release(inode, file);
+       simple_attr_release(inode, file);
 
        mutex_lock(&ctx->mapping_lock);
        if (!--i->i_openers)
@@ -476,8 +482,8 @@ spufs_cntl_release(struct inode *inode, struct file *file)
 static const struct file_operations spufs_cntl_fops = {
        .open = spufs_cntl_open,
        .release = spufs_cntl_release,
-       .read = spufs_attr_read,
-       .write = spufs_attr_write,
+       .read = simple_attr_read,
+       .write = simple_attr_write,
        .mmap = spufs_cntl_mmap,
 };