Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1a4eeaf2
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1a4eeaf2
编写于
11月 25, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: move mnt_list to struct mount
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
fc7be130
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
25 deletion
+26
-25
fs/mount.h
fs/mount.h
+2
-1
fs/namespace.c
fs/namespace.c
+24
-23
include/linux/mount.h
include/linux/mount.h
+0
-1
未找到文件。
fs/mount.h
浏览文件 @
1a4eeaf2
...
...
@@ -19,7 +19,8 @@ struct mount {
#endif
struct
list_head
mnt_mounts
;
/* list of children, anchored here */
struct
list_head
mnt_child
;
/* and going through their mnt_child */
/* yet to be moved - up to mnt_list */
/* yet to be moved - up to mnt_devname */
struct
list_head
mnt_list
;
struct
list_head
mnt_expire
;
/* link in fs-specific expiry list */
struct
list_head
mnt_share
;
/* circular list of shared mounts */
struct
list_head
mnt_slave_list
;
/* list of slave mounts */
...
...
fs/namespace.c
浏览文件 @
1a4eeaf2
...
...
@@ -202,7 +202,7 @@ static struct mount *alloc_vfsmnt(const char *name)
INIT_LIST_HEAD
(
&
p
->
mnt_hash
);
INIT_LIST_HEAD
(
&
p
->
mnt_child
);
INIT_LIST_HEAD
(
&
p
->
mnt_mounts
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_list
);
INIT_LIST_HEAD
(
&
p
->
mnt_list
);
INIT_LIST_HEAD
(
&
p
->
mnt_expire
);
INIT_LIST_HEAD
(
&
p
->
mnt_share
);
INIT_LIST_HEAD
(
&
p
->
mnt_slave_list
);
...
...
@@ -618,8 +618,8 @@ static void commit_tree(struct mount *mnt)
BUG_ON
(
parent
==
mnt
);
list_add_tail
(
&
head
,
&
mnt
->
mnt
.
mnt
_list
);
list_for_each_entry
(
m
,
&
head
,
mnt
.
mnt
_list
)
{
list_add_tail
(
&
head
,
&
mnt
->
mnt_list
);
list_for_each_entry
(
m
,
&
head
,
mnt_list
)
{
m
->
mnt_ns
=
n
;
__mnt_make_longterm
(
m
);
}
...
...
@@ -987,7 +987,8 @@ static void show_type(struct seq_file *m, struct super_block *sb)
static
int
show_vfsmnt
(
struct
seq_file
*
m
,
void
*
v
)
{
struct
vfsmount
*
mnt
=
list_entry
(
v
,
struct
vfsmount
,
mnt_list
);
struct
mount
*
r
=
list_entry
(
v
,
struct
mount
,
mnt_list
);
struct
vfsmount
*
mnt
=
&
r
->
mnt
;
int
err
=
0
;
struct
path
mnt_path
=
{
.
dentry
=
mnt
->
mnt_root
,
.
mnt
=
mnt
};
...
...
@@ -1024,8 +1025,8 @@ const struct seq_operations mounts_op = {
static
int
show_mountinfo
(
struct
seq_file
*
m
,
void
*
v
)
{
struct
proc_mounts
*
p
=
m
->
private
;
struct
vfsmount
*
mnt
=
list_entry
(
v
,
struct
vfs
mount
,
mnt_list
);
struct
mount
*
r
=
real_mount
(
mnt
)
;
struct
mount
*
r
=
list_entry
(
v
,
struct
mount
,
mnt_list
);
struct
vfsmount
*
mnt
=
&
r
->
mnt
;
struct
super_block
*
sb
=
mnt
->
mnt_sb
;
struct
path
mnt_path
=
{
.
dentry
=
mnt
->
mnt_root
,
.
mnt
=
mnt
};
struct
path
root
=
p
->
root
;
...
...
@@ -1092,7 +1093,8 @@ const struct seq_operations mountinfo_op = {
static
int
show_vfsstat
(
struct
seq_file
*
m
,
void
*
v
)
{
struct
vfsmount
*
mnt
=
list_entry
(
v
,
struct
vfsmount
,
mnt_list
);
struct
mount
*
r
=
list_entry
(
v
,
struct
mount
,
mnt_list
);
struct
vfsmount
*
mnt
=
&
r
->
mnt
;
struct
path
mnt_path
=
{
.
dentry
=
mnt
->
mnt_root
,
.
mnt
=
mnt
};
int
err
=
0
;
...
...
@@ -1235,7 +1237,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
list_for_each_entry
(
p
,
&
tmp_list
,
mnt_hash
)
{
list_del_init
(
&
p
->
mnt_expire
);
list_del_init
(
&
p
->
mnt
.
mnt
_list
);
list_del_init
(
&
p
->
mnt_list
);
__touch_mnt_namespace
(
p
->
mnt_ns
);
p
->
mnt_ns
=
NULL
;
__mnt_make_shortterm
(
p
);
...
...
@@ -1331,7 +1333,7 @@ static int do_umount(struct mount *mnt, int flags)
retval
=
-
EBUSY
;
if
(
flags
&
MNT_DETACH
||
!
propagate_mount_busy
(
mnt
,
2
))
{
if
(
!
list_empty
(
&
mnt
->
mnt
.
mnt
_list
))
if
(
!
list_empty
(
&
mnt
->
mnt_list
))
umount_tree
(
mnt
,
1
,
&
umount_list
);
retval
=
0
;
}
...
...
@@ -1451,7 +1453,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
if
(
!
q
)
goto
Enomem
;
br_write_lock
(
vfsmount_lock
);
list_add_tail
(
&
q
->
mnt
.
mnt_list
,
&
res
->
mnt
.
mnt_list
);
list_add_tail
(
&
q
->
mnt
_list
,
&
res
->
mnt_list
);
attach_mnt
(
q
,
&
path
);
br_write_unlock
(
vfsmount_lock
);
}
...
...
@@ -1492,12 +1494,12 @@ void drop_collected_mounts(struct vfsmount *mnt)
int
iterate_mounts
(
int
(
*
f
)(
struct
vfsmount
*
,
void
*
),
void
*
arg
,
struct
vfsmount
*
root
)
{
struct
vfs
mount
*
mnt
;
struct
mount
*
mnt
;
int
res
=
f
(
root
,
arg
);
if
(
res
)
return
res
;
list_for_each_entry
(
mnt
,
&
r
oot
->
mnt_list
,
mnt_list
)
{
res
=
f
(
mnt
,
arg
);
list_for_each_entry
(
mnt
,
&
r
eal_mount
(
root
)
->
mnt_list
,
mnt_list
)
{
res
=
f
(
&
mnt
->
mnt
,
arg
);
if
(
res
)
return
res
;
}
...
...
@@ -2415,7 +2417,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,
}
new_ns
->
root
=
&
new
->
mnt
;
br_write_lock
(
vfsmount_lock
);
list_add_tail
(
&
new_ns
->
list
,
&
new
_ns
->
root
->
mnt_list
);
list_add_tail
(
&
new_ns
->
list
,
&
new
->
mnt_list
);
br_write_unlock
(
vfsmount_lock
);
/*
...
...
@@ -2476,18 +2478,17 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
* create_mnt_ns - creates a private namespace and adds a root filesystem
* @mnt: pointer to the new root filesystem mountpoint
*/
static
struct
mnt_namespace
*
create_mnt_ns
(
struct
vfsmount
*
m
nt
)
static
struct
mnt_namespace
*
create_mnt_ns
(
struct
vfsmount
*
m
)
{
struct
mnt_namespace
*
new_ns
;
new_ns
=
alloc_mnt_ns
();
struct
mnt_namespace
*
new_ns
=
alloc_mnt_ns
();
if
(
!
IS_ERR
(
new_ns
))
{
real_mount
(
mnt
)
->
mnt_ns
=
new_ns
;
__mnt_make_longterm
(
real_mount
(
mnt
));
new_ns
->
root
=
mnt
;
list_add
(
&
new_ns
->
list
,
&
new_ns
->
root
->
mnt_list
);
struct
mount
*
mnt
=
real_mount
(
m
);
mnt
->
mnt_ns
=
new_ns
;
__mnt_make_longterm
(
mnt
);
new_ns
->
root
=
m
;
list_add
(
&
new_ns
->
list
,
&
mnt
->
mnt_list
);
}
else
{
mntput
(
m
nt
);
mntput
(
m
);
}
return
new_ns
;
}
...
...
include/linux/mount.h
浏览文件 @
1a4eeaf2
...
...
@@ -57,7 +57,6 @@ struct vfsmount {
struct
hlist_head
mnt_fsnotify_marks
;
#endif
const
char
*
mnt_devname
;
/* Name of device e.g. /dev/dsk/hda1 */
struct
list_head
mnt_list
;
};
struct
file
;
/* forward dec */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录