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
nexedi
linux
Commits
81e6f520
Commit
81e6f520
authored
Mar 30, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
untangling do_lookup() - take __lookup_hash()-calling case out of line.
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
a3255546
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
fs/namei.c
fs/namei.c
+16
-15
No files found.
fs/namei.c
View file @
81e6f520
...
@@ -1208,22 +1208,14 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
...
@@ -1208,22 +1208,14 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
dentry
=
__d_lookup
(
parent
,
name
);
dentry
=
__d_lookup
(
parent
,
name
);
}
}
if
(
dentry
&&
unlikely
(
d_need_lookup
(
dentry
)))
{
if
(
unlikely
(
!
dentry
))
goto
need_lookup
;
if
(
unlikely
(
d_need_lookup
(
dentry
)))
{
dput
(
dentry
);
dput
(
dentry
);
dentry
=
NULL
;
goto
need_lookup
;
}
}
retry:
if
(
unlikely
(
!
dentry
))
{
struct
inode
*
dir
=
parent
->
d_inode
;
BUG_ON
(
nd
->
inode
!=
dir
);
mutex_lock
(
&
dir
->
i_mutex
);
dentry
=
__lookup_hash
(
name
,
parent
,
nd
);
mutex_unlock
(
&
dir
->
i_mutex
);
if
(
IS_ERR
(
dentry
))
return
PTR_ERR
(
dentry
);
goto
done
;
}
if
(
unlikely
(
dentry
->
d_flags
&
DCACHE_OP_REVALIDATE
)
&&
need_reval
)
if
(
unlikely
(
dentry
->
d_flags
&
DCACHE_OP_REVALIDATE
)
&&
need_reval
)
status
=
d_revalidate
(
dentry
,
nd
);
status
=
d_revalidate
(
dentry
,
nd
);
if
(
unlikely
(
status
<=
0
))
{
if
(
unlikely
(
status
<=
0
))
{
...
@@ -1233,8 +1225,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
...
@@ -1233,8 +1225,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
}
}
if
(
!
d_invalidate
(
dentry
))
{
if
(
!
d_invalidate
(
dentry
))
{
dput
(
dentry
);
dput
(
dentry
);
dentry
=
NULL
;
goto
need_lookup
;
goto
retry
;
}
}
}
}
done:
done:
...
@@ -1249,6 +1240,16 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
...
@@ -1249,6 +1240,16 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
nd
->
flags
|=
LOOKUP_JUMPED
;
nd
->
flags
|=
LOOKUP_JUMPED
;
*
inode
=
path
->
dentry
->
d_inode
;
*
inode
=
path
->
dentry
->
d_inode
;
return
0
;
return
0
;
need_lookup:
BUG_ON
(
nd
->
inode
!=
parent
->
d_inode
);
mutex_lock
(
&
parent
->
d_inode
->
i_mutex
);
dentry
=
__lookup_hash
(
name
,
parent
,
nd
);
mutex_unlock
(
&
parent
->
d_inode
->
i_mutex
);
if
(
IS_ERR
(
dentry
))
return
PTR_ERR
(
dentry
);
goto
done
;
}
}
static
inline
int
may_lookup
(
struct
nameidata
*
nd
)
static
inline
int
may_lookup
(
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