fs/unionfs/: Several small cleanups in unionfs_interpose
authorJosef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Sat, 24 Feb 2007 21:46:08 +0000 (16:46 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Mon, 12 Jan 2009 23:20:18 +0000 (18:20 -0500)
1) No need to lock the inode - lockdep was complaining about potential
circular dependency

2) No need to use temporary variable for iunique() inode number

3) Removed unneeded comment

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/unionfs/main.c

index bd64242d75233b0379fde5e5deb667b594b7d46e..a37916d41c199b08ae6b4c393aaa00679ba40451 100644 (file)
@@ -66,19 +66,14 @@ int unionfs_interpose(struct dentry *dentry, struct super_block *sb, int flag)
                        err = -ENOMEM;
                        goto out;
                }
-               mutex_lock(&inode->i_mutex);
        } else {
-               ino_t ino;
                /* get unique inode number for unionfs */
-               ino = iunique(sb, UNIONFS_ROOT_INO);
-
-               inode = iget(sb, ino);
+               inode = iget(sb, iunique(sb, UNIONFS_ROOT_INO));
                if (!inode) {
-                       err = -EACCES;  /* should be impossible??? */
+                       err = -EACCES;
                        goto out;
                }
 
-               mutex_lock(&inode->i_mutex);
                if (atomic_read(&inode->i_count) > 1)
                        goto skip;
        }
@@ -147,8 +142,6 @@ skip:
                BUG();
        }
 
-       mutex_unlock(&inode->i_mutex);
-
 out:
        return err;
 }