Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
87b95ce0
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
87b95ce0
编写于
1月 10, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch the IO-triggering parts of umount to fs_pin
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
59eda0e0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
29 deletion
+20
-29
fs/fs_pin.c
fs/fs_pin.c
+0
-1
fs/mount.h
fs/mount.h
+3
-1
fs/namespace.c
fs/namespace.c
+17
-27
未找到文件。
fs/fs_pin.c
浏览文件 @
87b95ce0
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/fs_pin.h>
#include "internal.h"
#include "mount.h"
...
...
fs/mount.h
浏览文件 @
87b95ce0
...
...
@@ -2,6 +2,7 @@
#include <linux/seq_file.h>
#include <linux/poll.h>
#include <linux/ns_common.h>
#include <linux/fs_pin.h>
struct
mnt_namespace
{
atomic_t
count
;
...
...
@@ -62,7 +63,8 @@ struct mount {
int
mnt_group_id
;
/* peer group identifier */
int
mnt_expiry_mark
;
/* true if marked for expiry */
struct
hlist_head
mnt_pins
;
struct
path
mnt_ex_mountpoint
;
struct
fs_pin
mnt_umount
;
struct
dentry
*
mnt_ex_mountpoint
;
};
#define MNT_NS_INTERNAL ERR_PTR(-EINVAL)
/* distinct from any mnt_namespace */
...
...
fs/namespace.c
浏览文件 @
87b95ce0
...
...
@@ -190,6 +190,14 @@ unsigned int mnt_get_count(struct mount *mnt)
#endif
}
static
void
drop_mountpoint
(
struct
fs_pin
*
p
)
{
struct
mount
*
m
=
container_of
(
p
,
struct
mount
,
mnt_umount
);
dput
(
m
->
mnt_ex_mountpoint
);
pin_remove
(
p
);
mntput
(
&
m
->
mnt
);
}
static
struct
mount
*
alloc_vfsmnt
(
const
char
*
name
)
{
struct
mount
*
mnt
=
kmem_cache_zalloc
(
mnt_cache
,
GFP_KERNEL
);
...
...
@@ -229,6 +237,7 @@ static struct mount *alloc_vfsmnt(const char *name)
#ifdef CONFIG_FSNOTIFY
INIT_HLIST_HEAD
(
&
mnt
->
mnt_fsnotify_marks
);
#endif
init_fs_pin
(
&
mnt
->
mnt_umount
,
drop_mountpoint
);
}
return
mnt
;
...
...
@@ -1289,7 +1298,6 @@ static HLIST_HEAD(unmounted); /* protected by namespace_sem */
static
void
namespace_unlock
(
void
)
{
struct
mount
*
mnt
;
struct
hlist_head
head
=
unmounted
;
if
(
likely
(
hlist_empty
(
&
head
)))
{
...
...
@@ -1299,23 +1307,11 @@ static void namespace_unlock(void)
head
.
first
->
pprev
=
&
head
.
first
;
INIT_HLIST_HEAD
(
&
unmounted
);
/* undo decrements we'd done in umount_tree() */
hlist_for_each_entry
(
mnt
,
&
head
,
mnt_hash
)
if
(
mnt
->
mnt_ex_mountpoint
.
mnt
)
mntget
(
mnt
->
mnt_ex_mountpoint
.
mnt
);
up_write
(
&
namespace_sem
);
synchronize_rcu
();
while
(
!
hlist_empty
(
&
head
))
{
mnt
=
hlist_entry
(
head
.
first
,
struct
mount
,
mnt_hash
);
hlist_del_init
(
&
mnt
->
mnt_hash
);
if
(
mnt
->
mnt_ex_mountpoint
.
mnt
)
path_put
(
&
mnt
->
mnt_ex_mountpoint
);
mntput
(
&
mnt
->
mnt
);
}
group_pin_kill
(
&
head
);
}
static
inline
void
namespace_lock
(
void
)
...
...
@@ -1334,7 +1330,6 @@ void umount_tree(struct mount *mnt, int how)
{
HLIST_HEAD
(
tmp_list
);
struct
mount
*
p
;
struct
mount
*
last
=
NULL
;
for
(
p
=
mnt
;
p
;
p
=
next_mnt
(
p
,
mnt
))
{
hlist_del_init_rcu
(
&
p
->
mnt_hash
);
...
...
@@ -1347,33 +1342,28 @@ void umount_tree(struct mount *mnt, int how)
if
(
how
)
propagate_umount
(
&
tmp_list
);
hlist_for_each_entry
(
p
,
&
tmp_list
,
mnt_hash
)
{
while
(
!
hlist_empty
(
&
tmp_list
))
{
p
=
hlist_entry
(
tmp_list
.
first
,
struct
mount
,
mnt_hash
);
hlist_del_init_rcu
(
&
p
->
mnt_hash
);
list_del_init
(
&
p
->
mnt_expire
);
list_del_init
(
&
p
->
mnt_list
);
__touch_mnt_namespace
(
p
->
mnt_ns
);
p
->
mnt_ns
=
NULL
;
if
(
how
<
2
)
p
->
mnt
.
mnt_flags
|=
MNT_SYNC_UMOUNT
;
pin_insert_group
(
&
p
->
mnt_umount
,
&
p
->
mnt_parent
->
mnt
,
&
unmounted
);
if
(
mnt_has_parent
(
p
))
{
hlist_del_init
(
&
p
->
mnt_mp_list
);
put_mountpoint
(
p
->
mnt_mp
);
mnt_add_count
(
p
->
mnt_parent
,
-
1
);
/* move the reference to mountpoint into ->mnt_ex_mountpoint */
p
->
mnt_ex_mountpoint
.
dentry
=
p
->
mnt_mountpoint
;
p
->
mnt_ex_mountpoint
.
mnt
=
&
p
->
mnt_parent
->
mnt
;
/* old mountpoint will be dropped when we can do that */
p
->
mnt_ex_mountpoint
=
p
->
mnt_mountpoint
;
p
->
mnt_mountpoint
=
p
->
mnt
.
mnt_root
;
p
->
mnt_parent
=
p
;
p
->
mnt_mp
=
NULL
;
}
change_mnt_propagation
(
p
,
MS_PRIVATE
);
last
=
p
;
}
if
(
last
)
{
last
->
mnt_hash
.
next
=
unmounted
.
first
;
if
(
unmounted
.
first
)
unmounted
.
first
->
pprev
=
&
last
->
mnt_hash
.
next
;
unmounted
.
first
=
tmp_list
.
first
;
unmounted
.
first
->
pprev
=
&
unmounted
.
first
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录