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
287548e4
Commit
287548e4
authored
May 27, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split __follow_mount_rcu() into normal and .. cases
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
dc7acbb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
fs/namei.c
fs/namei.c
+26
-9
No files found.
fs/namei.c
View file @
287548e4
...
@@ -919,12 +919,11 @@ static inline bool managed_dentry_might_block(struct dentry *dentry)
...
@@ -919,12 +919,11 @@ static inline bool managed_dentry_might_block(struct dentry *dentry)
}
}
/*
/*
* Skip to top of mountpoint pile in rcuwalk mode. We abort the rcu-walk if we
* Try to skip to top of mountpoint pile in rcuwalk mode. Fail if
* meet a managed dentry and we're not walking to "..". True is returned to
* we meet a managed dentry that would need blocking.
* continue, false to abort.
*/
*/
static
bool
__follow_mount_rcu
(
struct
nameidata
*
nd
,
struct
path
*
path
,
static
bool
__follow_mount_rcu
(
struct
nameidata
*
nd
,
struct
path
*
path
,
struct
inode
**
inode
,
bool
reverse_transit
)
struct
inode
**
inode
)
{
{
for
(;;)
{
for
(;;)
{
struct
vfsmount
*
mounted
;
struct
vfsmount
*
mounted
;
...
@@ -933,8 +932,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
...
@@ -933,8 +932,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
* that wants to block transit.
* that wants to block transit.
*/
*/
*
inode
=
path
->
dentry
->
d_inode
;
*
inode
=
path
->
dentry
->
d_inode
;
if
(
!
reverse_transit
&&
if
(
unlikely
(
managed_dentry_might_block
(
path
->
dentry
)))
unlikely
(
managed_dentry_might_block
(
path
->
dentry
)))
return
false
;
return
false
;
if
(
!
d_mountpoint
(
path
->
dentry
))
if
(
!
d_mountpoint
(
path
->
dentry
))
...
@@ -949,10 +947,29 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
...
@@ -949,10 +947,29 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
}
}
if
(
unlikely
(
path
->
dentry
->
d_flags
&
DCACHE_NEED_AUTOMOUNT
))
if
(
unlikely
(
path
->
dentry
->
d_flags
&
DCACHE_NEED_AUTOMOUNT
))
return
reverse_transit
;
return
false
;
return
true
;
return
true
;
}
}
static
void
follow_mount_rcu
(
struct
nameidata
*
nd
,
struct
path
*
path
,
struct
inode
**
inode
)
{
for
(;;)
{
struct
vfsmount
*
mounted
;
*
inode
=
path
->
dentry
->
d_inode
;
if
(
!
d_mountpoint
(
path
->
dentry
))
break
;
mounted
=
__lookup_mnt
(
path
->
mnt
,
path
->
dentry
,
1
);
if
(
!
mounted
)
break
;
path
->
mnt
=
mounted
;
path
->
dentry
=
mounted
->
mnt_root
;
nd
->
seq
=
read_seqcount_begin
(
&
path
->
dentry
->
d_seq
);
}
}
static
int
follow_dotdot_rcu
(
struct
nameidata
*
nd
)
static
int
follow_dotdot_rcu
(
struct
nameidata
*
nd
)
{
{
struct
inode
*
inode
=
nd
->
inode
;
struct
inode
*
inode
=
nd
->
inode
;
...
@@ -982,7 +999,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
...
@@ -982,7 +999,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
nd
->
seq
=
read_seqcount_begin
(
&
nd
->
path
.
dentry
->
d_seq
);
nd
->
seq
=
read_seqcount_begin
(
&
nd
->
path
.
dentry
->
d_seq
);
inode
=
nd
->
path
.
dentry
->
d_inode
;
inode
=
nd
->
path
.
dentry
->
d_inode
;
}
}
__follow_mount_rcu
(
nd
,
&
nd
->
path
,
&
inode
,
tru
e
);
follow_mount_rcu
(
nd
,
&
nd
->
path
,
&
inod
e
);
nd
->
inode
=
inode
;
nd
->
inode
=
inode
;
return
0
;
return
0
;
...
@@ -1157,7 +1174,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
...
@@ -1157,7 +1174,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
}
}
path
->
mnt
=
mnt
;
path
->
mnt
=
mnt
;
path
->
dentry
=
dentry
;
path
->
dentry
=
dentry
;
if
(
likely
(
__follow_mount_rcu
(
nd
,
path
,
inode
,
false
)))
if
(
likely
(
__follow_mount_rcu
(
nd
,
path
,
inode
)))
return
0
;
return
0
;
unlazy:
unlazy:
if
(
unlazy_walk
(
nd
,
dentry
))
if
(
unlazy_walk
(
nd
,
dentry
))
...
...
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