Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
6b41d536
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b41d536
编写于
11月 24, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: take mnt_child/mnt_mounts to struct mount
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
68e8a9fe
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
26 deletion
+26
-26
fs/mount.h
fs/mount.h
+2
-0
fs/namespace.c
fs/namespace.c
+21
-21
fs/pnode.c
fs/pnode.c
+3
-3
include/linux/mount.h
include/linux/mount.h
+0
-2
未找到文件。
fs/mount.h
浏览文件 @
6b41d536
...
...
@@ -17,6 +17,8 @@ struct mount {
int
mnt_count
;
int
mnt_writers
;
#endif
struct
list_head
mnt_mounts
;
/* list of children, anchored here */
struct
list_head
mnt_child
;
/* and going through their mnt_child */
};
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
...
...
fs/namespace.c
浏览文件 @
6b41d536
...
...
@@ -200,8 +200,8 @@ static struct mount *alloc_vfsmnt(const char *name)
#endif
INIT_LIST_HEAD
(
&
p
->
mnt_hash
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_child
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_mounts
);
INIT_LIST_HEAD
(
&
p
->
mnt_child
);
INIT_LIST_HEAD
(
&
p
->
mnt_mounts
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_list
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_expire
);
INIT_LIST_HEAD
(
&
mnt
->
mnt_share
);
...
...
@@ -562,7 +562,7 @@ static void detach_mnt(struct mount *mnt, struct path *old_path)
old_path
->
mnt
=
&
mnt
->
mnt_parent
->
mnt
;
mnt
->
mnt_parent
=
mnt
;
mnt
->
mnt_mountpoint
=
mnt
->
mnt
.
mnt_root
;
list_del_init
(
&
mnt
->
mnt
.
mnt
_child
);
list_del_init
(
&
mnt
->
mnt_child
);
list_del_init
(
&
mnt
->
mnt_hash
);
dentry_reset_mounted
(
old_path
->
dentry
);
}
...
...
@@ -588,7 +588,7 @@ static void attach_mnt(struct mount *mnt, struct path *path)
mnt_set_mountpoint
(
path
->
mnt
,
path
->
dentry
,
mnt
);
list_add_tail
(
&
mnt
->
mnt_hash
,
mount_hashtable
+
hash
(
path
->
mnt
,
path
->
dentry
));
list_add_tail
(
&
mnt
->
mnt
.
mnt_child
,
&
path
->
mnt
->
mnt_mounts
);
list_add_tail
(
&
mnt
->
mnt
_child
,
&
real_mount
(
path
->
mnt
)
->
mnt_mounts
);
}
static
inline
void
__mnt_make_longterm
(
struct
mount
*
mnt
)
...
...
@@ -628,32 +628,32 @@ static void commit_tree(struct mount *mnt)
list_add_tail
(
&
mnt
->
mnt_hash
,
mount_hashtable
+
hash
(
&
parent
->
mnt
,
mnt
->
mnt_mountpoint
));
list_add_tail
(
&
mnt
->
mnt
.
mnt_child
,
&
parent
->
mnt
.
mnt_mounts
);
list_add_tail
(
&
mnt
->
mnt
_child
,
&
parent
->
mnt_mounts
);
touch_mnt_namespace
(
n
);
}
static
struct
mount
*
next_mnt
(
struct
mount
*
p
,
struct
vfsmount
*
root
)
{
struct
list_head
*
next
=
p
->
mnt
.
mnt
_mounts
.
next
;
if
(
next
==
&
p
->
mnt
.
mnt
_mounts
)
{
struct
list_head
*
next
=
p
->
mnt_mounts
.
next
;
if
(
next
==
&
p
->
mnt_mounts
)
{
while
(
1
)
{
if
(
&
p
->
mnt
==
root
)
return
NULL
;
next
=
p
->
mnt
.
mnt
_child
.
next
;
if
(
next
!=
&
p
->
mnt_parent
->
mnt
.
mnt
_mounts
)
next
=
p
->
mnt_child
.
next
;
if
(
next
!=
&
p
->
mnt_parent
->
mnt_mounts
)
break
;
p
=
p
->
mnt_parent
;
}
}
return
list_entry
(
next
,
struct
mount
,
mnt
.
mnt
_child
);
return
list_entry
(
next
,
struct
mount
,
mnt_child
);
}
static
struct
mount
*
skip_mnt_tree
(
struct
mount
*
p
)
{
struct
list_head
*
prev
=
p
->
mnt
.
mnt
_mounts
.
prev
;
while
(
prev
!=
&
p
->
mnt
.
mnt
_mounts
)
{
p
=
list_entry
(
prev
,
struct
mount
,
mnt
.
mnt
_child
);
prev
=
p
->
mnt
.
mnt
_mounts
.
prev
;
struct
list_head
*
prev
=
p
->
mnt_mounts
.
prev
;
while
(
prev
!=
&
p
->
mnt_mounts
)
{
p
=
list_entry
(
prev
,
struct
mount
,
mnt_child
);
prev
=
p
->
mnt_mounts
.
prev
;
}
return
p
;
}
...
...
@@ -1238,7 +1238,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
__touch_mnt_namespace
(
p
->
mnt
.
mnt_ns
);
p
->
mnt
.
mnt_ns
=
NULL
;
__mnt_make_shortterm
(
p
);
list_del_init
(
&
p
->
mnt
.
mnt
_child
);
list_del_init
(
&
p
->
mnt_child
);
if
(
mnt_has_parent
(
p
))
{
p
->
mnt_parent
->
mnt
.
mnt_ghosts
++
;
dentry_reset_mounted
(
p
->
mnt_mountpoint
);
...
...
@@ -1427,7 +1427,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry,
q
->
mnt_mountpoint
=
mnt
->
mnt_mountpoint
;
p
=
mnt
;
list_for_each_entry
(
r
,
&
mnt
->
mnt
.
mnt_mounts
,
mnt
.
mnt_child
)
{
list_for_each_entry
(
r
,
&
mnt
->
mnt
_mounts
,
mnt_child
)
{
struct
mount
*
s
;
if
(
!
is_subdir
(
r
->
mnt_mountpoint
,
dentry
))
continue
;
...
...
@@ -2134,11 +2134,11 @@ static int select_submounts(struct mount *parent, struct list_head *graveyard)
int
found
=
0
;
repeat:
next
=
this_parent
->
mnt
.
mnt
_mounts
.
next
;
next
=
this_parent
->
mnt_mounts
.
next
;
resume:
while
(
next
!=
&
this_parent
->
mnt
.
mnt
_mounts
)
{
while
(
next
!=
&
this_parent
->
mnt_mounts
)
{
struct
list_head
*
tmp
=
next
;
struct
mount
*
mnt
=
list_entry
(
tmp
,
struct
mount
,
mnt
.
mnt
_child
);
struct
mount
*
mnt
=
list_entry
(
tmp
,
struct
mount
,
mnt_child
);
next
=
tmp
->
next
;
if
(
!
(
mnt
->
mnt
.
mnt_flags
&
MNT_SHRINKABLE
))
...
...
@@ -2146,7 +2146,7 @@ static int select_submounts(struct mount *parent, struct list_head *graveyard)
/*
* Descend a level if the d_mounts list is non-empty.
*/
if
(
!
list_empty
(
&
mnt
->
mnt
.
mnt
_mounts
))
{
if
(
!
list_empty
(
&
mnt
->
mnt_mounts
))
{
this_parent
=
mnt
;
goto
repeat
;
}
...
...
@@ -2160,7 +2160,7 @@ static int select_submounts(struct mount *parent, struct list_head *graveyard)
* All done at this level ... ascend and resume the search
*/
if
(
this_parent
!=
parent
)
{
next
=
this_parent
->
mnt
.
mnt
_child
.
next
;
next
=
this_parent
->
mnt_child
.
next
;
this_parent
=
this_parent
->
mnt_parent
;
goto
resume
;
}
...
...
fs/pnode.c
浏览文件 @
6b41d536
...
...
@@ -303,13 +303,13 @@ int propagate_mount_busy(struct mount *mnt, int refcnt)
* If not, we don't have to go checking for all other
* mounts
*/
if
(
!
list_empty
(
&
mnt
->
mnt
.
mnt
_mounts
)
||
do_refcount_check
(
mnt
,
refcnt
))
if
(
!
list_empty
(
&
mnt
->
mnt_mounts
)
||
do_refcount_check
(
mnt
,
refcnt
))
return
1
;
for
(
m
=
propagation_next
(
&
parent
->
mnt
,
&
parent
->
mnt
);
m
;
m
=
propagation_next
(
m
,
&
parent
->
mnt
))
{
child
=
__lookup_mnt
(
m
,
mnt
->
mnt_mountpoint
,
0
);
if
(
child
&&
list_empty
(
&
child
->
mnt
.
mnt
_mounts
)
&&
if
(
child
&&
list_empty
(
&
child
->
mnt_mounts
)
&&
(
ret
=
do_refcount_check
(
child
,
1
)))
break
;
}
...
...
@@ -336,7 +336,7 @@ static void __propagate_umount(struct mount *mnt)
* umount the child only if the child has no
* other children
*/
if
(
child
&&
list_empty
(
&
child
->
mnt
.
mnt
_mounts
))
if
(
child
&&
list_empty
(
&
child
->
mnt_mounts
))
list_move_tail
(
&
child
->
mnt_hash
,
&
mnt
->
mnt_hash
);
}
}
...
...
include/linux/mount.h
浏览文件 @
6b41d536
...
...
@@ -50,8 +50,6 @@ struct mnt_namespace;
struct
vfsmount
{
struct
dentry
*
mnt_root
;
/* root of the mounted tree */
struct
super_block
*
mnt_sb
;
/* pointer to superblock */
struct
list_head
mnt_mounts
;
/* list of children, anchored here */
struct
list_head
mnt_child
;
/* and going through their mnt_child */
int
mnt_flags
;
/* 4 bytes hole on 64bits arches without fsnotify */
#ifdef CONFIG_FSNOTIFY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录