]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spufs/inode.c
[POWERPC] spufs: lockdep annotations for spufs_dir_close
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spufs / inode.c
index e6e6559c55ed5be7abfde887bb90cec1ce1501bd..f407b24718554f474a153dc9a66e93d88518739f 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * SPU file system
  *
@@ -22,6 +23,7 @@
 
 #include <linux/file.h>
 #include <linux/fs.h>
+#include <linux/fsnotify.h>
 #include <linux/backing-dev.h>
 #include <linux/init.h>
 #include <linux/ioctl.h>
@@ -34,7 +36,6 @@
 #include <linux/parser.h>
 
 #include <asm/prom.h>
-#include <asm/semaphore.h>
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
 #include <asm/uaccess.h>
@@ -223,7 +224,7 @@ static int spufs_dir_close(struct inode *inode, struct file *file)
        parent = dir->d_parent->d_inode;
        ctx = SPUFS_I(dir->d_inode)->i_ctx;
 
-       mutex_lock(&parent->i_mutex);
+       mutex_lock_nested(&parent->i_mutex, I_MUTEX_PARENT);
        ret = spufs_rmdir(parent, dir);
        mutex_unlock(&parent->i_mutex);
        WARN_ON(ret);
@@ -592,7 +593,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
 
        ret = -EINVAL;
        /* check if we are on spufs */
-       if (nd->dentry->d_sb->s_type != &spufs_type)
+       if (nd->path.dentry->d_sb->s_type != &spufs_type)
                goto out;
 
        /* don't accept undefined flags */
@@ -600,9 +601,9 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
                goto out;
 
        /* only threads can be underneath a gang */
-       if (nd->dentry != nd->dentry->d_sb->s_root) {
+       if (nd->path.dentry != nd->path.dentry->d_sb->s_root) {
                if ((flags & SPU_CREATE_GANG) ||
-                   !SPUFS_I(nd->dentry->d_inode)->i_gang)
+                   !SPUFS_I(nd->path.dentry->d_inode)->i_gang)
                        goto out;
        }
 
@@ -618,16 +619,20 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
        mode &= ~current->fs->umask;
 
        if (flags & SPU_CREATE_GANG)
-               return spufs_create_gang(nd->dentry->d_inode,
-                                       dentry, nd->mnt, mode);
+               ret = spufs_create_gang(nd->path.dentry->d_inode,
+                                        dentry, nd->path.mnt, mode);
        else
-               return spufs_create_context(nd->dentry->d_inode,
-                                       dentry, nd->mnt, flags, mode, filp);
+               ret = spufs_create_context(nd->path.dentry->d_inode,
+                                           dentry, nd->path.mnt, flags, mode,
+                                           filp);
+       if (ret >= 0)
+               fsnotify_mkdir(nd->path.dentry->d_inode, dentry);
+       return ret;
 
 out_dput:
        dput(dentry);
 out_dir:
-       mutex_unlock(&nd->dentry->d_inode->i_mutex);
+       mutex_unlock(&nd->path.dentry->d_inode->i_mutex);
 out:
        return ret;
 }