Unionfs: minor cleanup in check_empty
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Dec 2007 21:30:19 +0000 (16:30 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:37:21 +0000 (22:37 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dirhelper.c

index b40090a403929e89c59451e17713ec13bf288e67..4b73bb65e6673ebf372c487ce2ecada8715bfd55 100644 (file)
@@ -182,6 +182,7 @@ int check_empty(struct dentry *dentry, struct unionfs_dir_state **namelist)
 {
        int err = 0;
        struct dentry *lower_dentry = NULL;
+       struct vfsmount *mnt;
        struct super_block *sb;
        struct file *lower_file;
        struct unionfs_rdutil_callback *buf = NULL;
@@ -226,15 +227,11 @@ int check_empty(struct dentry *dentry, struct unionfs_dir_state **namelist)
                        continue;
 
                dget(lower_dentry);
-               unionfs_mntget(dentry, bindex);
+               mnt = unionfs_mntget(dentry, bindex);
                branchget(sb, bindex);
-               lower_file =
-                       dentry_open(lower_dentry,
-                                   unionfs_lower_mnt_idx(dentry, bindex),
-                                   O_RDONLY);
+               lower_file = dentry_open(lower_dentry, mnt, O_RDONLY);
                if (IS_ERR(lower_file)) {
                        err = PTR_ERR(lower_file);
-                       dput(lower_dentry);
                        branchput(sb, bindex);
                        goto out;
                }