Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
odroid-linux-3.10.y-rt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oai
odroid-linux-3.10.y-rt
Commits
fc7be130
Commit
fc7be130
authored
Nov 25, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vfs: switch pnode.h macros to struct mount *
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
863d684f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
29 deletions
+29
-29
fs/namespace.c
fs/namespace.c
+21
-21
fs/pnode.c
fs/pnode.c
+3
-3
fs/pnode.h
fs/pnode.h
+5
-5
No files found.
fs/namespace.c
View file @
fc7be130
...
...
@@ -716,9 +716,9 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
if
(
flag
&
CL_SLAVE
)
{
list_add
(
&
mnt
->
mnt_slave
,
&
old
->
mnt_slave_list
);
mnt
->
mnt_master
=
old
;
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
CLEAR_MNT_SHARED
(
mnt
);
}
else
if
(
!
(
flag
&
CL_PRIVATE
))
{
if
((
flag
&
CL_MAKE_SHARED
)
||
IS_MNT_SHARED
(
&
old
->
mnt
))
if
((
flag
&
CL_MAKE_SHARED
)
||
IS_MNT_SHARED
(
old
))
list_add
(
&
mnt
->
mnt_share
,
&
old
->
mnt_share
);
if
(
IS_MNT_SLAVE
(
old
))
list_add
(
&
mnt
->
mnt_slave
,
&
old
->
mnt_slave
);
...
...
@@ -1050,7 +1050,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
show_mnt_opts
(
m
,
mnt
);
/* Tagged fields ("foo:X" or "bar") */
if
(
IS_MNT_SHARED
(
mnt
))
if
(
IS_MNT_SHARED
(
r
))
seq_printf
(
m
,
" shared:%i"
,
r
->
mnt_group_id
);
if
(
IS_MNT_SLAVE
(
r
))
{
int
master
=
r
->
mnt_master
->
mnt_group_id
;
...
...
@@ -1059,7 +1059,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
if
(
dom
&&
dom
!=
master
)
seq_printf
(
m
,
" propagate_from:%i"
,
dom
);
}
if
(
IS_MNT_UNBINDABLE
(
mnt
))
if
(
IS_MNT_UNBINDABLE
(
r
))
seq_puts
(
m
,
" unbindable"
);
/* Filesystem specific data */
...
...
@@ -1421,7 +1421,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
struct
mount
*
res
,
*
p
,
*
q
,
*
r
;
struct
path
path
;
if
(
!
(
flag
&
CL_COPY_ALL
)
&&
IS_MNT_UNBINDABLE
(
&
mnt
->
mnt
))
if
(
!
(
flag
&
CL_COPY_ALL
)
&&
IS_MNT_UNBINDABLE
(
mnt
))
return
NULL
;
res
=
q
=
clone_mnt
(
mnt
,
dentry
,
flag
);
...
...
@@ -1436,7 +1436,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
continue
;
for
(
s
=
r
;
s
;
s
=
next_mnt
(
s
,
&
r
->
mnt
))
{
if
(
!
(
flag
&
CL_COPY_ALL
)
&&
IS_MNT_UNBINDABLE
(
&
s
->
mnt
))
{
if
(
!
(
flag
&
CL_COPY_ALL
)
&&
IS_MNT_UNBINDABLE
(
s
))
{
s
=
skip_mnt_tree
(
s
);
continue
;
}
...
...
@@ -1509,7 +1509,7 @@ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
struct
mount
*
p
;
for
(
p
=
mnt
;
p
!=
end
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
{
if
(
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
if
(
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
p
))
mnt_release_group_id
(
p
);
}
}
...
...
@@ -1519,7 +1519,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
struct
mount
*
p
;
for
(
p
=
mnt
;
p
;
p
=
recurse
?
next_mnt
(
p
,
&
mnt
->
mnt
)
:
NULL
)
{
if
(
!
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
{
if
(
!
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
p
))
{
int
err
=
mnt_alloc_group_id
(
p
);
if
(
err
)
{
cleanup_group_ids
(
mnt
,
p
);
...
...
@@ -1603,7 +1603,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
struct
mount
*
child
,
*
p
;
int
err
;
if
(
IS_MNT_SHARED
(
&
dest_mnt
->
mnt
))
{
if
(
IS_MNT_SHARED
(
dest_
mnt
))
{
err
=
invent_group_ids
(
source_mnt
,
true
);
if
(
err
)
goto
out
;
...
...
@@ -1614,7 +1614,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
br_write_lock
(
vfsmount_lock
);
if
(
IS_MNT_SHARED
(
&
dest_mnt
->
mnt
))
{
if
(
IS_MNT_SHARED
(
dest_
mnt
))
{
for
(
p
=
source_mnt
;
p
;
p
=
next_mnt
(
p
,
&
source_mnt
->
mnt
))
set_mnt_shared
(
p
);
}
...
...
@@ -1636,7 +1636,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
return
0
;
out_cleanup_ids:
if
(
IS_MNT_SHARED
(
&
dest_mnt
->
mnt
))
if
(
IS_MNT_SHARED
(
dest_
mnt
))
cleanup_group_ids
(
source_mnt
,
NULL
);
out:
return
err
;
...
...
@@ -1764,7 +1764,7 @@ static int do_loopback(struct path *path, char *old_name,
old
=
real_mount
(
old_path
.
mnt
);
err
=
-
EINVAL
;
if
(
IS_MNT_UNBINDABLE
(
old
_path
.
mnt
))
if
(
IS_MNT_UNBINDABLE
(
old
))
goto
out2
;
if
(
!
check_mnt
(
real_mount
(
path
->
mnt
))
||
!
check_mnt
(
old
))
...
...
@@ -1859,7 +1859,7 @@ static inline int tree_contains_unbindable(struct mount *mnt)
{
struct
mount
*
p
;
for
(
p
=
mnt
;
p
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
{
if
(
IS_MNT_UNBINDABLE
(
&
p
->
mnt
))
if
(
IS_MNT_UNBINDABLE
(
p
))
return
1
;
}
return
0
;
...
...
@@ -1884,9 +1884,10 @@ static int do_move_mount(struct path *path, char *old_name)
goto
out
;
old
=
real_mount
(
old_path
.
mnt
);
p
=
real_mount
(
path
->
mnt
);
err
=
-
EINVAL
;
if
(
!
check_mnt
(
real_mount
(
path
->
mnt
)
)
||
!
check_mnt
(
old
))
if
(
!
check_mnt
(
p
)
||
!
check_mnt
(
old
))
goto
out1
;
if
(
d_unlinked
(
path
->
dentry
))
...
...
@@ -1905,17 +1906,16 @@ static int do_move_mount(struct path *path, char *old_name)
/*
* Don't move a mount residing in a shared parent.
*/
if
(
IS_MNT_SHARED
(
&
old
->
mnt_parent
->
m
nt
))
if
(
IS_MNT_SHARED
(
old
->
mnt_pare
nt
))
goto
out1
;
/*
* Don't move a mount tree containing unbindable mounts to a destination
* mount which is shared.
*/
if
(
IS_MNT_SHARED
(
path
->
mnt
)
&&
tree_contains_unbindable
(
old
))
if
(
IS_MNT_SHARED
(
p
)
&&
tree_contains_unbindable
(
old
))
goto
out1
;
err
=
-
ELOOP
;
for
(
p
=
real_mount
(
path
->
mnt
)
;
mnt_has_parent
(
p
);
p
=
p
->
mnt_parent
)
for
(;
mnt_has_parent
(
p
);
p
=
p
->
mnt_parent
)
if
(
p
==
old
)
goto
out1
;
...
...
@@ -2643,9 +2643,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
error
=
-
EINVAL
;
new_mnt
=
real_mount
(
new
.
mnt
);
root_mnt
=
real_mount
(
root
.
mnt
);
if
(
IS_MNT_SHARED
(
old
.
mnt
)
||
IS_MNT_SHARED
(
&
new_mnt
->
mnt_parent
->
m
nt
)
||
IS_MNT_SHARED
(
&
root_mnt
->
mnt_parent
->
m
nt
))
if
(
IS_MNT_SHARED
(
real_mount
(
old
.
mnt
)
)
||
IS_MNT_SHARED
(
new_mnt
->
mnt_pare
nt
)
||
IS_MNT_SHARED
(
root_mnt
->
mnt_pare
nt
))
goto
out4
;
if
(
!
check_mnt
(
root_mnt
)
||
!
check_mnt
(
new_mnt
))
goto
out4
;
...
...
fs/pnode.c
View file @
fc7be130
...
...
@@ -82,7 +82,7 @@ static int do_make_slave(struct mount *mnt)
if
(
peer_mnt
==
mnt
)
peer_mnt
=
NULL
;
}
if
(
IS_MNT_SHARED
(
&
mnt
->
mnt
)
&&
list_empty
(
&
mnt
->
mnt_share
))
if
(
IS_MNT_SHARED
(
mnt
)
&&
list_empty
(
&
mnt
->
mnt_share
))
mnt_release_group_id
(
mnt
);
list_del_init
(
&
mnt
->
mnt_share
);
...
...
@@ -107,7 +107,7 @@ static int do_make_slave(struct mount *mnt)
}
}
mnt
->
mnt_master
=
master
;
CLEAR_MNT_SHARED
(
&
mnt
->
mnt
);
CLEAR_MNT_SHARED
(
mnt
);
return
0
;
}
...
...
@@ -199,7 +199,7 @@ static struct mount *get_source(struct mount *dest,
/* slave of the earlier, then */
*
type
=
CL_SLAVE
;
/* beginning of peer group among the slaves? */
if
(
IS_MNT_SHARED
(
&
dest
->
mn
t
))
if
(
IS_MNT_SHARED
(
des
t
))
*
type
|=
CL_MAKE_SHARED
;
return
last_src
;
}
...
...
fs/pnode.h
View file @
fc7be130
...
...
@@ -11,11 +11,11 @@
#include <linux/list.h>
#include "mount.h"
#define IS_MNT_SHARED(m
nt) ((mnt)->
mnt_flags & MNT_SHARED)
#define IS_MNT_SLAVE(m
nt) ((mnt
)->mnt_master)
#define IS_MNT_NEW(m
nt) (!(mnt
)->mnt_ns)
#define CLEAR_MNT_SHARED(m
nt) ((mnt)->
mnt_flags &= ~MNT_SHARED)
#define IS_MNT_UNBINDABLE(m
nt) ((mnt)->
mnt_flags & MNT_UNBINDABLE)
#define IS_MNT_SHARED(m
) ((m)->mnt.
mnt_flags & MNT_SHARED)
#define IS_MNT_SLAVE(m
) ((m
)->mnt_master)
#define IS_MNT_NEW(m
) (!(m
)->mnt_ns)
#define CLEAR_MNT_SHARED(m
) ((m)->mnt.
mnt_flags &= ~MNT_SHARED)
#define IS_MNT_UNBINDABLE(m
) ((m)->mnt.
mnt_flags & MNT_UNBINDABLE)
#define CL_EXPIRE 0x01
#define CL_SLAVE 0x02
...
...
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