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
32301920
Commit
32301920
authored
Nov 25, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vfs: and now we can make ->mnt_master point to struct mount
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
d10e8def
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
fs/mount.h
fs/mount.h
+1
-1
fs/namespace.c
fs/namespace.c
+2
-2
fs/pnode.c
fs/pnode.c
+9
-9
No files found.
fs/mount.h
View file @
32301920
...
@@ -20,7 +20,7 @@ struct mount {
...
@@ -20,7 +20,7 @@ struct mount {
struct
list_head
mnt_mounts
;
/* list of children, anchored here */
struct
list_head
mnt_mounts
;
/* list of children, anchored here */
struct
list_head
mnt_child
;
/* and going through their mnt_child */
struct
list_head
mnt_child
;
/* and going through their mnt_child */
/* yet to be moved - up to mnt_slave */
/* yet to be moved - up to mnt_slave */
struct
vfs
mount
*
mnt_master
;
/* slave is on master->mnt_slave_list */
struct
mount
*
mnt_master
;
/* slave is on master->mnt_slave_list */
};
};
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
...
...
fs/namespace.c
View file @
32301920
...
@@ -715,7 +715,7 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
...
@@ -715,7 +715,7 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
if
(
flag
&
CL_SLAVE
)
{
if
(
flag
&
CL_SLAVE
)
{
list_add
(
&
mnt
->
mnt
.
mnt_slave
,
&
old
->
mnt
.
mnt_slave_list
);
list_add
(
&
mnt
->
mnt
.
mnt_slave
,
&
old
->
mnt
.
mnt_slave_list
);
mnt
->
mnt_master
=
&
old
->
mnt
;
mnt
->
mnt_master
=
old
;
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
}
else
if
(
!
(
flag
&
CL_PRIVATE
))
{
}
else
if
(
!
(
flag
&
CL_PRIVATE
))
{
if
((
flag
&
CL_MAKE_SHARED
)
||
IS_MNT_SHARED
(
&
old
->
mnt
))
if
((
flag
&
CL_MAKE_SHARED
)
||
IS_MNT_SHARED
(
&
old
->
mnt
))
...
@@ -1052,7 +1052,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
...
@@ -1052,7 +1052,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
if
(
IS_MNT_SHARED
(
mnt
))
if
(
IS_MNT_SHARED
(
mnt
))
seq_printf
(
m
,
" shared:%i"
,
mnt
->
mnt_group_id
);
seq_printf
(
m
,
" shared:%i"
,
mnt
->
mnt_group_id
);
if
(
IS_MNT_SLAVE
(
r
))
{
if
(
IS_MNT_SLAVE
(
r
))
{
int
master
=
r
->
mnt_master
->
mnt_group_id
;
int
master
=
r
->
mnt_master
->
mnt
.
mnt
_group_id
;
int
dom
=
get_dominating_id
(
r
,
&
p
->
root
);
int
dom
=
get_dominating_id
(
r
,
&
p
->
root
);
seq_printf
(
m
,
" master:%i"
,
master
);
seq_printf
(
m
,
" master:%i"
,
master
);
if
(
dom
&&
dom
!=
master
)
if
(
dom
&&
dom
!=
master
)
...
...
fs/pnode.c
View file @
32301920
...
@@ -55,7 +55,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
...
@@ -55,7 +55,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
{
{
struct
mount
*
m
;
struct
mount
*
m
;
for
(
m
=
real_mount
(
mnt
->
mnt_master
);
m
!=
NULL
;
m
=
real_mount
(
m
->
mnt_master
)
)
{
for
(
m
=
mnt
->
mnt_master
;
m
!=
NULL
;
m
=
m
->
mnt_master
)
{
struct
mount
*
d
=
get_peer_under_root
(
m
,
mnt
->
mnt
.
mnt_ns
,
root
);
struct
mount
*
d
=
get_peer_under_root
(
m
,
mnt
->
mnt
.
mnt_ns
,
root
);
if
(
d
)
if
(
d
)
return
d
->
mnt
.
mnt_group_id
;
return
d
->
mnt
.
mnt_group_id
;
...
@@ -66,7 +66,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
...
@@ -66,7 +66,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
static
int
do_make_slave
(
struct
mount
*
mnt
)
static
int
do_make_slave
(
struct
mount
*
mnt
)
{
{
struct
mount
*
peer_mnt
=
mnt
,
*
master
=
real_mount
(
mnt
->
mnt_master
)
;
struct
mount
*
peer_mnt
=
mnt
,
*
master
=
mnt
->
mnt_master
;
struct
mount
*
slave_mnt
;
struct
mount
*
slave_mnt
;
/*
/*
...
@@ -93,7 +93,7 @@ static int do_make_slave(struct mount *mnt)
...
@@ -93,7 +93,7 @@ static int do_make_slave(struct mount *mnt)
if
(
master
)
{
if
(
master
)
{
list_for_each_entry
(
slave_mnt
,
&
mnt
->
mnt
.
mnt_slave_list
,
mnt
.
mnt_slave
)
list_for_each_entry
(
slave_mnt
,
&
mnt
->
mnt
.
mnt_slave_list
,
mnt
.
mnt_slave
)
slave_mnt
->
mnt_master
=
&
master
->
mnt
;
slave_mnt
->
mnt_master
=
master
;
list_move
(
&
mnt
->
mnt
.
mnt_slave
,
&
master
->
mnt
.
mnt_slave_list
);
list_move
(
&
mnt
->
mnt
.
mnt_slave
,
&
master
->
mnt
.
mnt_slave_list
);
list_splice
(
&
mnt
->
mnt
.
mnt_slave_list
,
master
->
mnt
.
mnt_slave_list
.
prev
);
list_splice
(
&
mnt
->
mnt
.
mnt_slave_list
,
master
->
mnt
.
mnt_slave_list
.
prev
);
INIT_LIST_HEAD
(
&
mnt
->
mnt
.
mnt_slave_list
);
INIT_LIST_HEAD
(
&
mnt
->
mnt
.
mnt_slave_list
);
...
@@ -106,7 +106,7 @@ static int do_make_slave(struct mount *mnt)
...
@@ -106,7 +106,7 @@ static int do_make_slave(struct mount *mnt)
slave_mnt
->
mnt_master
=
NULL
;
slave_mnt
->
mnt_master
=
NULL
;
}
}
}
}
mnt
->
mnt_master
=
&
master
->
mnt
;
mnt
->
mnt_master
=
master
;
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
return
0
;
return
0
;
}
}
...
@@ -149,9 +149,9 @@ static struct mount *propagation_next(struct mount *m,
...
@@ -149,9 +149,9 @@ static struct mount *propagation_next(struct mount *m,
return
first_slave
(
m
);
return
first_slave
(
m
);
while
(
1
)
{
while
(
1
)
{
struct
mount
*
master
=
real_mount
(
m
->
mnt_master
)
;
struct
mount
*
master
=
m
->
mnt_master
;
if
(
&
master
->
mnt
==
origin
->
mnt_master
)
{
if
(
master
==
origin
->
mnt_master
)
{
struct
mount
*
next
=
next_peer
(
m
);
struct
mount
*
next
=
next_peer
(
m
);
return
(
next
==
origin
)
?
NULL
:
next
;
return
(
next
==
origin
)
?
NULL
:
next
;
}
else
if
(
m
->
mnt
.
mnt_slave
.
next
!=
&
master
->
mnt
.
mnt_slave_list
)
}
else
if
(
m
->
mnt
.
mnt_slave
.
next
!=
&
master
->
mnt
.
mnt_slave_list
)
...
@@ -179,11 +179,11 @@ static struct mount *get_source(struct mount *dest,
...
@@ -179,11 +179,11 @@ static struct mount *get_source(struct mount *dest,
struct
mount
*
p_last_src
=
NULL
;
struct
mount
*
p_last_src
=
NULL
;
struct
mount
*
p_last_dest
=
NULL
;
struct
mount
*
p_last_dest
=
NULL
;
while
(
&
last_dest
->
mn
t
!=
dest
->
mnt_master
)
{
while
(
last_des
t
!=
dest
->
mnt_master
)
{
p_last_dest
=
last_dest
;
p_last_dest
=
last_dest
;
p_last_src
=
last_src
;
p_last_src
=
last_src
;
last_dest
=
real_mount
(
last_dest
->
mnt_master
)
;
last_dest
=
last_dest
->
mnt_master
;
last_src
=
real_mount
(
last_src
->
mnt_master
)
;
last_src
=
last_src
->
mnt_master
;
}
}
if
(
p_last_dest
)
{
if
(
p_last_dest
)
{
...
...
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