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
692afc31
Commit
692afc31
authored
Nov 24, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vfs: spread struct mount - shrink_submounts/select_submounts
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
761d5c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
fs/namespace.c
fs/namespace.c
+14
-14
No files found.
fs/namespace.c
View file @
692afc31
...
@@ -1244,7 +1244,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
...
@@ -1244,7 +1244,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
list_splice
(
&
tmp_list
,
kill
);
list_splice
(
&
tmp_list
,
kill
);
}
}
static
void
shrink_submounts
(
struct
vfs
mount
*
mnt
,
struct
list_head
*
umounts
);
static
void
shrink_submounts
(
struct
mount
*
mnt
,
struct
list_head
*
umounts
);
static
int
do_umount
(
struct
vfsmount
*
mnt
,
int
flags
)
static
int
do_umount
(
struct
vfsmount
*
mnt
,
int
flags
)
{
{
...
@@ -1322,7 +1322,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
...
@@ -1322,7 +1322,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
event
++
;
event
++
;
if
(
!
(
flags
&
MNT_DETACH
))
if
(
!
(
flags
&
MNT_DETACH
))
shrink_submounts
(
mnt
,
&
umount_list
);
shrink_submounts
(
real_mount
(
mnt
)
,
&
umount_list
);
retval
=
-
EBUSY
;
retval
=
-
EBUSY
;
if
(
flags
&
MNT_DETACH
||
!
propagate_mount_busy
(
mnt
,
2
))
{
if
(
flags
&
MNT_DETACH
||
!
propagate_mount_busy
(
mnt
,
2
))
{
...
@@ -2121,32 +2121,32 @@ EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);
...
@@ -2121,32 +2121,32 @@ EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);
* search the list of submounts for a given mountpoint, and move any
* search the list of submounts for a given mountpoint, and move any
* shrinkable submounts to the 'graveyard' list.
* shrinkable submounts to the 'graveyard' list.
*/
*/
static
int
select_submounts
(
struct
vfs
mount
*
parent
,
struct
list_head
*
graveyard
)
static
int
select_submounts
(
struct
mount
*
parent
,
struct
list_head
*
graveyard
)
{
{
struct
vfs
mount
*
this_parent
=
parent
;
struct
mount
*
this_parent
=
parent
;
struct
list_head
*
next
;
struct
list_head
*
next
;
int
found
=
0
;
int
found
=
0
;
repeat:
repeat:
next
=
this_parent
->
mnt_mounts
.
next
;
next
=
this_parent
->
mnt
.
mnt
_mounts
.
next
;
resume:
resume:
while
(
next
!=
&
this_parent
->
mnt_mounts
)
{
while
(
next
!=
&
this_parent
->
mnt
.
mnt
_mounts
)
{
struct
list_head
*
tmp
=
next
;
struct
list_head
*
tmp
=
next
;
struct
vfsmount
*
mnt
=
list_entry
(
tmp
,
struct
vfsmount
,
mnt_child
);
struct
mount
*
mnt
=
list_entry
(
tmp
,
struct
mount
,
mnt
.
mnt_child
);
next
=
tmp
->
next
;
next
=
tmp
->
next
;
if
(
!
(
mnt
->
mnt_flags
&
MNT_SHRINKABLE
))
if
(
!
(
mnt
->
mnt
.
mnt
_flags
&
MNT_SHRINKABLE
))
continue
;
continue
;
/*
/*
* Descend a level if the d_mounts list is non-empty.
* Descend a level if the d_mounts list is non-empty.
*/
*/
if
(
!
list_empty
(
&
mnt
->
mnt_mounts
))
{
if
(
!
list_empty
(
&
mnt
->
mnt
.
mnt
_mounts
))
{
this_parent
=
mnt
;
this_parent
=
mnt
;
goto
repeat
;
goto
repeat
;
}
}
if
(
!
propagate_mount_busy
(
mnt
,
1
))
{
if
(
!
propagate_mount_busy
(
&
mnt
->
mnt
,
1
))
{
list_move_tail
(
&
mnt
->
mnt_expire
,
graveyard
);
list_move_tail
(
&
mnt
->
mnt
.
mnt
_expire
,
graveyard
);
found
++
;
found
++
;
}
}
}
}
...
@@ -2154,8 +2154,8 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
...
@@ -2154,8 +2154,8 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
* All done at this level ... ascend and resume the search
* All done at this level ... ascend and resume the search
*/
*/
if
(
this_parent
!=
parent
)
{
if
(
this_parent
!=
parent
)
{
next
=
this_parent
->
mnt_child
.
next
;
next
=
this_parent
->
mnt
.
mnt
_child
.
next
;
this_parent
=
this_parent
->
mnt_parent
;
this_parent
=
real_mount
(
this_parent
->
mnt
.
mnt_parent
)
;
goto
resume
;
goto
resume
;
}
}
return
found
;
return
found
;
...
@@ -2167,7 +2167,7 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
...
@@ -2167,7 +2167,7 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
*
*
* vfsmount_lock must be held for write
* vfsmount_lock must be held for write
*/
*/
static
void
shrink_submounts
(
struct
vfs
mount
*
mnt
,
struct
list_head
*
umounts
)
static
void
shrink_submounts
(
struct
mount
*
mnt
,
struct
list_head
*
umounts
)
{
{
LIST_HEAD
(
graveyard
);
LIST_HEAD
(
graveyard
);
struct
mount
*
m
;
struct
mount
*
m
;
...
...
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