Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
fc7be130
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fc7be130
编写于
11月 25, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: switch pnode.h macros to struct mount *
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
863d684f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
29 deletion
+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
未找到文件。
fs/namespace.c
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录