Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a03ece5f
Commit
a03ece5f
authored
Mar 08, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fold lookup_real() into __lookup_hash()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
903ddaf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
24 deletions
+17
-24
fs/namei.c
fs/namei.c
+17
-24
No files found.
fs/namei.c
View file @
a03ece5f
...
...
@@ -1473,43 +1473,36 @@ static struct dentry *lookup_dcache(const struct qstr *name,
}
/*
* Call i_op->lookup on the dentry. The dentry must be negative and
* unhashed.
*
* dir->d_inode->i_mutex must be held
* Parent directory has inode locked exclusive. This is one
* and only case when ->lookup() gets called on non in-lookup
* dentries - as the matter of fact, this only gets called
* when directory is guaranteed to have no in-lookup children
* at all.
*/
static
struct
dentry
*
lookup_real
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
unsigned
int
flags
)
{
struct
dentry
*
old
;
/* Don't create child dentry for a dead directory. */
if
(
unlikely
(
IS_DEADDIR
(
dir
)))
{
dput
(
dentry
);
return
ERR_PTR
(
-
ENOENT
);
}
old
=
dir
->
i_op
->
lookup
(
dir
,
dentry
,
flags
);
if
(
unlikely
(
old
))
{
dput
(
dentry
);
dentry
=
old
;
}
return
dentry
;
}
static
struct
dentry
*
__lookup_hash
(
const
struct
qstr
*
name
,
struct
dentry
*
base
,
unsigned
int
flags
)
{
struct
dentry
*
dentry
=
lookup_dcache
(
name
,
base
,
flags
);
struct
dentry
*
old
;
struct
inode
*
dir
=
base
->
d_inode
;
if
(
dentry
)
return
dentry
;
/* Don't create child dentry for a dead directory. */
if
(
unlikely
(
IS_DEADDIR
(
dir
)))
return
ERR_PTR
(
-
ENOENT
);
dentry
=
d_alloc
(
base
,
name
);
if
(
unlikely
(
!
dentry
))
return
ERR_PTR
(
-
ENOMEM
);
return
lookup_real
(
base
->
d_inode
,
dentry
,
flags
);
old
=
dir
->
i_op
->
lookup
(
dir
,
dentry
,
flags
);
if
(
unlikely
(
old
))
{
dput
(
dentry
);
dentry
=
old
;
}
return
dentry
;
}
static
int
lookup_fast
(
struct
nameidata
*
nd
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment