Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / fs / autofs4 / root.c
index 3d3590c..5100f98 100644 (file)
@@ -137,9 +137,7 @@ static int autofs4_dir_open(struct inode *inode, struct file *file)
                nd.flags = LOOKUP_DIRECTORY;
                ret = (dentry->d_op->d_revalidate)(dentry, &nd);
 
-               if (ret <= 0) {
-                       if (ret < 0)
-                               status = ret;
+               if (!ret) {
                        dcache_dir_close(inode, file);
                        goto out;
                }
@@ -402,23 +400,13 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
        struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb);
        int oz_mode = autofs4_oz_mode(sbi);
        int flags = nd ? nd->flags : 0;
-       int status;
+       int status = 0;
 
        /* Pending dentry */
        if (autofs4_ispending(dentry)) {
-               /* The daemon never causes a mount to trigger */
-               if (oz_mode)
-                       return 1;
-
-               /*
-                * A zero status is success otherwise we have a
-                * negative error code.
-                */
-               status = try_to_fill_dentry(dentry, flags);
-               if (status == 0)
-                       return 1;
-
-               return status;
+               if (!oz_mode)
+                       status = try_to_fill_dentry(dentry, flags);
+               return !status;
        }
 
        /* Negative dentry.. invalidate if "old" */
@@ -433,19 +421,9 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd)
                DPRINTK("dentry=%p %.*s, emptydir",
                         dentry, dentry->d_name.len, dentry->d_name.name);
                spin_unlock(&dcache_lock);
-               /* The daemon never causes a mount to trigger */
-               if (oz_mode)
-                       return 1;
-
-               /*
-                * A zero status is success otherwise we have a
-                * negative error code.
-                */
-               status = try_to_fill_dentry(dentry, flags);
-               if (status == 0)
-                       return 1;
-
-               return status;
+               if (!oz_mode)
+                       status = try_to_fill_dentry(dentry, flags);
+               return !status;
        }
        spin_unlock(&dcache_lock);