Unionfs: minor code cleanups
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 15 Apr 2008 23:54:44 +0000 (19:54 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 15 Apr 2008 23:54:44 +0000 (19:54 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c
fs/unionfs/inode.c

index a6ead9ba219f506cea4b0db2c9f8551600d37737..c7cdff6e3b1b02efefb1e1591d6539789e7b9503 100644 (file)
@@ -249,7 +249,6 @@ static int do_delayed_copyup(struct file *file)
        BUG_ON(!S_ISREG(dentry->d_inode->i_mode));
 
        unionfs_check_file(file);
-       unionfs_check_dentry(dentry);
        for (bindex = bstart - 1; bindex >= 0; bindex--) {
                if (!d_deleted(dentry))
                        err = copyup_file(parent_inode, file, bstart,
@@ -291,7 +290,6 @@ static int do_delayed_copyup(struct file *file)
 
 out:
        unionfs_check_file(file);
-       unionfs_check_dentry(dentry);
        return err;
 }
 
index f421ffbd1b906bea7b51b5178796c92b5d389b1c..91eacea77c948dacae1713e3fb4a4df843b27730 100644 (file)
@@ -388,28 +388,23 @@ docopyup:
                                            bindex, old_dentry->d_name.name,
                                            old_dentry->d_name.len, NULL,
                                            i_size_read(old_dentry->d_inode));
-                       if (!err) {
-                               lower_new_dentry =
-                                       create_parents(dir, new_dentry,
-                                                      new_dentry->d_name.name,
-                                                      bindex);
-                               lower_old_dentry =
-                                       unionfs_lower_dentry(old_dentry);
-                               lower_dir_dentry =
-                                       lock_parent(lower_new_dentry);
-                               /*
-                                * see
-                                * Documentation/filesystems/unionfs/issues.txt
-                                */
-                               lockdep_off();
-                               /* do vfs_link */
-                               err = vfs_link(lower_old_dentry,
-                                              lower_dir_dentry->d_inode,
-                                              lower_new_dentry);
-                               lockdep_on();
-                               unlock_dir(lower_dir_dentry);
-                               goto check_link;
-                       }
+                       if (err)
+                               continue;
+                       lower_new_dentry =
+                               create_parents(dir, new_dentry,
+                                              new_dentry->d_name.name,
+                                              bindex);
+                       lower_old_dentry = unionfs_lower_dentry(old_dentry);
+                       lower_dir_dentry = lock_parent(lower_new_dentry);
+                       /* see Documentation/filesystems/unionfs/issues.txt */
+                       lockdep_off();
+                       /* do vfs_link */
+                       err = vfs_link(lower_old_dentry,
+                                      lower_dir_dentry->d_inode,
+                                      lower_new_dentry);
+                       lockdep_on();
+                       unlock_dir(lower_dir_dentry);
+                       goto check_link;
                }
                goto out;
        }