ext4: get rid of open-coded d_find_any_alias()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 Jun 2012 17:19:12 +0000 (13:19 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Jul 2012 12:32:54 +0000 (16:32 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext4/fsync.c

index bb6c7d8113134ee7796a141065d9ed602650f10e..4359a4d30069ab838646fddb8d50d8a1716b0792 100644 (file)
@@ -135,14 +135,7 @@ static int ext4_sync_parent(struct inode *inode)
        inode = igrab(inode);
        while (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {
                ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);
-               dentry = NULL;
-               spin_lock(&inode->i_lock);
-               if (!list_empty(&inode->i_dentry)) {
-                       dentry = list_first_entry(&inode->i_dentry,
-                                                 struct dentry, d_alias);
-                       dget(dentry);
-               }
-               spin_unlock(&inode->i_lock);
+               dentry = d_find_any_alias(inode);
                if (!dentry)
                        break;
                next = igrab(dentry->d_parent->d_inode);