summaryrefslogtreecommitdiff
path: root/fs/aufs/dentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/dentry.c')
-rw-r--r--fs/aufs/dentry.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c
index 080fac9c8..4bb153086 100644
--- a/fs/aufs/dentry.c
+++ b/fs/aufs/dentry.c
@@ -9,14 +9,6 @@
#include <linux/namei.h>
#include "aufs.h"
-#define AuLkup_ALLOW_NEG 1
-#define AuLkup_IGNORE_PERM (1 << 1)
-#define au_ftest_lkup(flags, name) ((flags) & AuLkup_##name)
-#define au_fset_lkup(flags, name) \
- do { (flags) |= AuLkup_##name; } while (0)
-#define au_fclr_lkup(flags, name) \
- do { (flags) &= ~AuLkup_##name; } while (0)
-
struct au_do_lookup_args {
unsigned int flags;
mode_t type;
@@ -119,15 +111,15 @@ static int au_test_shwh(struct super_block *sb, const struct qstr *name)
* otherwise an error.
* can be called at unlinking with @type is zero.
*/
-int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t btop, mode_t type)
+int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t btop,
+ unsigned int flags)
{
int npositive, err;
aufs_bindex_t bindex, btail, bdiropq;
unsigned char isdir, dirperm1;
struct qstr whname;
struct au_do_lookup_args args = {
- .flags = 0,
- .type = type
+ .flags = flags
};
const struct qstr *name = &dentry->d_name;
struct dentry *parent;
@@ -143,8 +135,6 @@ int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t btop, mode_t type)
goto out;
isdir = !!d_is_dir(dentry);
- if (!type)
- au_fset_lkup(args.flags, ALLOW_NEG);
dirperm1 = !!au_opt_test(au_mntflags(sb), DIRPERM1);
npositive = 0;
@@ -158,9 +148,7 @@ int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t btop, mode_t type)
if (h_dentry) {
if (d_is_positive(h_dentry))
npositive++;
- if (type != S_IFDIR)
- break;
- continue;
+ break;
}
h_parent = au_h_dptr(parent, bindex);
if (!h_parent || !d_is_dir(h_parent))
@@ -761,7 +749,7 @@ int au_refresh_dentry(struct dentry *dentry, struct dentry *parent)
* if current working dir is removed, it returns an error.
* but the dentry is legal.
*/
- err = au_lkup_dentry(dentry, /*btop*/0, /*type*/0);
+ err = au_lkup_dentry(dentry, /*btop*/0, AuLkup_ALLOW_NEG);
AuDbgDentry(dentry);
au_di_swap(tmp, dinfo);
if (err == -ENOENT)