mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-10 16:34:00 +00:00
gfs2_atomic_open(): skip lookups on hashed dentry
hashed dentry can be passed to ->atomic_open() only if a) it has just passed revalidation and b) it's negative Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
18c85d09dc
commit
4d93bc3e81
1 changed files with 5 additions and 0 deletions
|
@ -1244,6 +1244,9 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
|
||||||
struct dentry *d;
|
struct dentry *d;
|
||||||
bool excl = !!(flags & O_EXCL);
|
bool excl = !!(flags & O_EXCL);
|
||||||
|
|
||||||
|
if (!d_unhashed(dentry))
|
||||||
|
goto skip_lookup;
|
||||||
|
|
||||||
d = __gfs2_lookup(dir, dentry, file, opened);
|
d = __gfs2_lookup(dir, dentry, file, opened);
|
||||||
if (IS_ERR(d))
|
if (IS_ERR(d))
|
||||||
return PTR_ERR(d);
|
return PTR_ERR(d);
|
||||||
|
@ -1260,6 +1263,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
|
||||||
}
|
}
|
||||||
|
|
||||||
BUG_ON(d != NULL);
|
BUG_ON(d != NULL);
|
||||||
|
|
||||||
|
skip_lookup:
|
||||||
if (!(flags & O_CREAT))
|
if (!(flags & O_CREAT))
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue