Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
761d5c38
Commit
761d5c38
authored
13 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
vfs: spread struct mount - umount_tree argument
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1b8e5564
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fs/namespace.c
+18
-18
18 additions, 18 deletions
fs/namespace.c
fs/pnode.c
+1
-1
1 addition, 1 deletion
fs/pnode.c
fs/pnode.h
+1
-1
1 addition, 1 deletion
fs/pnode.h
with
20 additions
and
20 deletions
fs/namespace.c
+
18
−
18
View file @
761d5c38
...
@@ -1217,12 +1217,12 @@ void release_mounts(struct list_head *head)
...
@@ -1217,12 +1217,12 @@ void release_mounts(struct list_head *head)
* vfsmount lock must be held for write
* vfsmount lock must be held for write
* namespace_sem must be held for write
* namespace_sem must be held for write
*/
*/
void
umount_tree
(
struct
vfs
mount
*
mnt
,
int
propagate
,
struct
list_head
*
kill
)
void
umount_tree
(
struct
mount
*
mnt
,
int
propagate
,
struct
list_head
*
kill
)
{
{
LIST_HEAD
(
tmp_list
);
LIST_HEAD
(
tmp_list
);
struct
mount
*
p
;
struct
mount
*
p
;
for
(
p
=
real_mount
(
mnt
)
;
p
;
p
=
next_mnt
(
p
,
mnt
))
for
(
p
=
mnt
;
p
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
list_move
(
&
p
->
mnt_hash
,
&
tmp_list
);
list_move
(
&
p
->
mnt_hash
,
&
tmp_list
);
if
(
propagate
)
if
(
propagate
)
...
@@ -1327,7 +1327,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
...
@@ -1327,7 +1327,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
retval
=
-
EBUSY
;
retval
=
-
EBUSY
;
if
(
flags
&
MNT_DETACH
||
!
propagate_mount_busy
(
mnt
,
2
))
{
if
(
flags
&
MNT_DETACH
||
!
propagate_mount_busy
(
mnt
,
2
))
{
if
(
!
list_empty
(
&
mnt
->
mnt_list
))
if
(
!
list_empty
(
&
mnt
->
mnt_list
))
umount_tree
(
mnt
,
1
,
&
umount_list
);
umount_tree
(
real_mount
(
mnt
)
,
1
,
&
umount_list
);
retval
=
0
;
retval
=
0
;
}
}
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
...
@@ -1455,7 +1455,7 @@ struct mount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
...
@@ -1455,7 +1455,7 @@ struct mount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
if
(
res
)
{
if
(
res
)
{
LIST_HEAD
(
umount_list
);
LIST_HEAD
(
umount_list
);
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
umount_tree
(
&
res
->
mnt
,
0
,
&
umount_list
);
umount_tree
(
res
,
0
,
&
umount_list
);
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
release_mounts
(
&
umount_list
);
release_mounts
(
&
umount_list
);
}
}
...
@@ -1476,7 +1476,7 @@ void drop_collected_mounts(struct vfsmount *mnt)
...
@@ -1476,7 +1476,7 @@ void drop_collected_mounts(struct vfsmount *mnt)
LIST_HEAD
(
umount_list
);
LIST_HEAD
(
umount_list
);
down_write
(
&
namespace_sem
);
down_write
(
&
namespace_sem
);
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
umount_tree
(
mnt
,
0
,
&
umount_list
);
umount_tree
(
real_mount
(
mnt
)
,
0
,
&
umount_list
);
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
up_write
(
&
namespace_sem
);
up_write
(
&
namespace_sem
);
release_mounts
(
&
umount_list
);
release_mounts
(
&
umount_list
);
...
@@ -1773,7 +1773,7 @@ static int do_loopback(struct path *path, char *old_name,
...
@@ -1773,7 +1773,7 @@ static int do_loopback(struct path *path, char *old_name,
err
=
graft_tree
(
&
mnt
->
mnt
,
path
);
err
=
graft_tree
(
&
mnt
->
mnt
,
path
);
if
(
err
)
{
if
(
err
)
{
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
umount_tree
(
&
mnt
->
mnt
,
0
,
&
umount_list
);
umount_tree
(
mnt
,
0
,
&
umount_list
);
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
}
}
out2:
out2:
...
@@ -2080,7 +2080,7 @@ EXPORT_SYMBOL(mnt_set_expiry);
...
@@ -2080,7 +2080,7 @@ EXPORT_SYMBOL(mnt_set_expiry);
*/
*/
void
mark_mounts_for_expiry
(
struct
list_head
*
mounts
)
void
mark_mounts_for_expiry
(
struct
list_head
*
mounts
)
{
{
struct
vfs
mount
*
mnt
,
*
next
;
struct
mount
*
mnt
,
*
next
;
LIST_HEAD
(
graveyard
);
LIST_HEAD
(
graveyard
);
LIST_HEAD
(
umounts
);
LIST_HEAD
(
umounts
);
...
@@ -2096,15 +2096,15 @@ void mark_mounts_for_expiry(struct list_head *mounts)
...
@@ -2096,15 +2096,15 @@ void mark_mounts_for_expiry(struct list_head *mounts)
* - still marked for expiry (marked on the last call here; marks are
* - still marked for expiry (marked on the last call here; marks are
* cleared by mntput())
* cleared by mntput())
*/
*/
list_for_each_entry_safe
(
mnt
,
next
,
mounts
,
mnt_expire
)
{
list_for_each_entry_safe
(
mnt
,
next
,
mounts
,
mnt
.
mnt_expire
)
{
if
(
!
xchg
(
&
mnt
->
mnt_expiry_mark
,
1
)
||
if
(
!
xchg
(
&
mnt
->
mnt
.
mnt
_expiry_mark
,
1
)
||
propagate_mount_busy
(
mnt
,
1
))
propagate_mount_busy
(
&
mnt
->
mnt
,
1
))
continue
;
continue
;
list_move
(
&
mnt
->
mnt_expire
,
&
graveyard
);
list_move
(
&
mnt
->
mnt
.
mnt
_expire
,
&
graveyard
);
}
}
while
(
!
list_empty
(
&
graveyard
))
{
while
(
!
list_empty
(
&
graveyard
))
{
mnt
=
list_first_entry
(
&
graveyard
,
struct
vfs
mount
,
mnt_expire
);
mnt
=
list_first_entry
(
&
graveyard
,
struct
mount
,
mnt
.
mnt_expire
);
touch_mnt_namespace
(
mnt
->
mnt_ns
);
touch_mnt_namespace
(
mnt
->
mnt
.
mnt
_ns
);
umount_tree
(
mnt
,
1
,
&
umounts
);
umount_tree
(
mnt
,
1
,
&
umounts
);
}
}
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
...
@@ -2170,14 +2170,14 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
...
@@ -2170,14 +2170,14 @@ static int select_submounts(struct vfsmount *parent, struct list_head *graveyard
static
void
shrink_submounts
(
struct
vfsmount
*
mnt
,
struct
list_head
*
umounts
)
static
void
shrink_submounts
(
struct
vfsmount
*
mnt
,
struct
list_head
*
umounts
)
{
{
LIST_HEAD
(
graveyard
);
LIST_HEAD
(
graveyard
);
struct
vfs
mount
*
m
;
struct
mount
*
m
;
/* extract submounts of 'mountpoint' from the expiration list */
/* extract submounts of 'mountpoint' from the expiration list */
while
(
select_submounts
(
mnt
,
&
graveyard
))
{
while
(
select_submounts
(
mnt
,
&
graveyard
))
{
while
(
!
list_empty
(
&
graveyard
))
{
while
(
!
list_empty
(
&
graveyard
))
{
m
=
list_first_entry
(
&
graveyard
,
struct
vfs
mount
,
m
=
list_first_entry
(
&
graveyard
,
struct
mount
,
mnt_expire
);
mnt
.
mnt_expire
);
touch_mnt_namespace
(
m
->
mnt_ns
);
touch_mnt_namespace
(
m
->
mnt
.
mnt
_ns
);
umount_tree
(
m
,
1
,
umounts
);
umount_tree
(
m
,
1
,
umounts
);
}
}
}
}
...
@@ -2750,7 +2750,7 @@ void put_mnt_ns(struct mnt_namespace *ns)
...
@@ -2750,7 +2750,7 @@ void put_mnt_ns(struct mnt_namespace *ns)
return
;
return
;
down_write
(
&
namespace_sem
);
down_write
(
&
namespace_sem
);
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
umount_tree
(
ns
->
root
,
0
,
&
umount_list
);
umount_tree
(
real_mount
(
ns
->
root
)
,
0
,
&
umount_list
);
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
up_write
(
&
namespace_sem
);
up_write
(
&
namespace_sem
);
release_mounts
(
&
umount_list
);
release_mounts
(
&
umount_list
);
...
...
This diff is collapsed.
Click to expand it.
fs/pnode.c
+
1
−
1
View file @
761d5c38
...
@@ -262,7 +262,7 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry,
...
@@ -262,7 +262,7 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry,
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
while
(
!
list_empty
(
&
tmp_list
))
{
while
(
!
list_empty
(
&
tmp_list
))
{
child
=
list_first_entry
(
&
tmp_list
,
struct
mount
,
mnt_hash
);
child
=
list_first_entry
(
&
tmp_list
,
struct
mount
,
mnt_hash
);
umount_tree
(
&
child
->
mnt
,
0
,
&
umount_list
);
umount_tree
(
child
,
0
,
&
umount_list
);
}
}
br_write_unlock
(
vfsmount_lock
);
br_write_unlock
(
vfsmount_lock
);
release_mounts
(
&
umount_list
);
release_mounts
(
&
umount_list
);
...
...
This diff is collapsed.
Click to expand it.
fs/pnode.h
+
1
−
1
View file @
761d5c38
...
@@ -40,7 +40,7 @@ unsigned int mnt_get_count(struct vfsmount *mnt);
...
@@ -40,7 +40,7 @@ unsigned int mnt_get_count(struct vfsmount *mnt);
void
mnt_set_mountpoint
(
struct
vfsmount
*
,
struct
dentry
*
,
void
mnt_set_mountpoint
(
struct
vfsmount
*
,
struct
dentry
*
,
struct
vfsmount
*
);
struct
vfsmount
*
);
void
release_mounts
(
struct
list_head
*
);
void
release_mounts
(
struct
list_head
*
);
void
umount_tree
(
struct
vfs
mount
*
,
int
,
struct
list_head
*
);
void
umount_tree
(
struct
mount
*
,
int
,
struct
list_head
*
);
struct
mount
*
copy_tree
(
struct
vfsmount
*
,
struct
dentry
*
,
int
);
struct
mount
*
copy_tree
(
struct
vfsmount
*
,
struct
dentry
*
,
int
);
bool
is_path_reachable
(
struct
vfsmount
*
,
struct
dentry
*
,
bool
is_path_reachable
(
struct
vfsmount
*
,
struct
dentry
*
,
const
struct
path
*
root
);
const
struct
path
*
root
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment