Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4b8b21f4
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看板
提交
4b8b21f4
编写于
11月 24, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: spread struct mount - mount group id handling
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
4b2619a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
20 deletion
+20
-20
fs/namespace.c
fs/namespace.c
+18
-18
fs/pnode.c
fs/pnode.c
+1
-1
fs/pnode.h
fs/pnode.h
+1
-1
未找到文件。
fs/namespace.c
浏览文件 @
4b8b21f4
...
...
@@ -110,7 +110,7 @@ static void mnt_free_id(struct vfsmount *mnt)
*
* mnt_group_ida is protected by namespace_sem
*/
static
int
mnt_alloc_group_id
(
struct
vfs
mount
*
mnt
)
static
int
mnt_alloc_group_id
(
struct
mount
*
mnt
)
{
int
res
;
...
...
@@ -119,9 +119,9 @@ static int mnt_alloc_group_id(struct vfsmount *mnt)
res
=
ida_get_new_above
(
&
mnt_group_ida
,
mnt_group_start
,
&
mnt
->
mnt_group_id
);
&
mnt
->
mnt
.
mnt
_group_id
);
if
(
!
res
)
mnt_group_start
=
mnt
->
mnt_group_id
+
1
;
mnt_group_start
=
mnt
->
mnt
.
mnt
_group_id
+
1
;
return
res
;
}
...
...
@@ -129,13 +129,13 @@ static int mnt_alloc_group_id(struct vfsmount *mnt)
/*
* Release a peer group ID
*/
void
mnt_release_group_id
(
struct
vfs
mount
*
mnt
)
void
mnt_release_group_id
(
struct
mount
*
mnt
)
{
int
id
=
mnt
->
mnt_group_id
;
int
id
=
mnt
->
mnt
.
mnt
_group_id
;
ida_remove
(
&
mnt_group_ida
,
id
);
if
(
mnt_group_start
>
id
)
mnt_group_start
=
id
;
mnt
->
mnt_group_id
=
0
;
mnt
->
mnt
.
mnt
_group_id
=
0
;
}
/*
...
...
@@ -701,7 +701,7 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
mnt
->
mnt_group_id
=
old
->
mnt_group_id
;
if
((
flag
&
CL_MAKE_SHARED
)
&&
!
mnt
->
mnt_group_id
)
{
int
err
=
mnt_alloc_group_id
(
mnt
);
int
err
=
mnt_alloc_group_id
(
real_mount
(
mnt
)
);
if
(
err
)
goto
out_free
;
}
...
...
@@ -1497,25 +1497,25 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
return
0
;
}
static
void
cleanup_group_ids
(
struct
vfsmount
*
mnt
,
struct
vfs
mount
*
end
)
static
void
cleanup_group_ids
(
struct
mount
*
mnt
,
struct
mount
*
end
)
{
struct
mount
*
p
;
for
(
p
=
real_mount
(
mnt
);
&
p
->
mnt
!=
end
;
p
=
next_mnt
(
p
,
mnt
))
{
for
(
p
=
mnt
;
p
!=
end
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
{
if
(
p
->
mnt
.
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
mnt_release_group_id
(
&
p
->
mnt
);
mnt_release_group_id
(
p
);
}
}
static
int
invent_group_ids
(
struct
vfs
mount
*
mnt
,
bool
recurse
)
static
int
invent_group_ids
(
struct
mount
*
mnt
,
bool
recurse
)
{
struct
mount
*
p
;
for
(
p
=
real_mount
(
mnt
);
p
;
p
=
recurse
?
next_mnt
(
p
,
mnt
)
:
NULL
)
{
for
(
p
=
mnt
;
p
;
p
=
recurse
?
next_mnt
(
p
,
&
mnt
->
mnt
)
:
NULL
)
{
if
(
!
p
->
mnt
.
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
{
int
err
=
mnt_alloc_group_id
(
&
p
->
mnt
);
int
err
=
mnt_alloc_group_id
(
p
);
if
(
err
)
{
cleanup_group_ids
(
mnt
,
&
p
->
mnt
);
cleanup_group_ids
(
mnt
,
p
);
return
err
;
}
}
...
...
@@ -1597,7 +1597,7 @@ static int attach_recursive_mnt(struct vfsmount *source_mnt,
int
err
;
if
(
IS_MNT_SHARED
(
dest_mnt
))
{
err
=
invent_group_ids
(
source_mnt
,
true
);
err
=
invent_group_ids
(
real_mount
(
source_mnt
)
,
true
);
if
(
err
)
goto
out
;
}
...
...
@@ -1630,7 +1630,7 @@ static int attach_recursive_mnt(struct vfsmount *source_mnt,
out_cleanup_ids:
if
(
IS_MNT_SHARED
(
dest_mnt
))
cleanup_group_ids
(
source_mnt
,
NULL
);
cleanup_group_ids
(
real_mount
(
source_mnt
)
,
NULL
);
out:
return
err
;
}
...
...
@@ -1700,7 +1700,7 @@ static int flags_to_propagation_type(int flags)
static
int
do_change_type
(
struct
path
*
path
,
int
flag
)
{
struct
mount
*
m
;
struct
vfsmount
*
mnt
=
path
->
mnt
;
struct
mount
*
mnt
=
real_mount
(
path
->
mnt
)
;
int
recurse
=
flag
&
MS_REC
;
int
type
;
int
err
=
0
;
...
...
@@ -1723,7 +1723,7 @@ static int do_change_type(struct path *path, int flag)
}
br_write_lock
(
vfsmount_lock
);
for
(
m
=
real_mount
(
mnt
);
m
;
m
=
(
recurse
?
next_mnt
(
m
,
mnt
)
:
NULL
))
for
(
m
=
mnt
;
m
;
m
=
(
recurse
?
next_mnt
(
m
,
&
mnt
->
mnt
)
:
NULL
))
change_mnt_propagation
(
&
m
->
mnt
,
type
);
br_write_unlock
(
vfsmount_lock
);
...
...
fs/pnode.c
浏览文件 @
4b8b21f4
...
...
@@ -83,7 +83,7 @@ static int do_make_slave(struct vfsmount *mnt)
peer_mnt
=
NULL
;
}
if
(
IS_MNT_SHARED
(
mnt
)
&&
list_empty
(
&
mnt
->
mnt_share
))
mnt_release_group_id
(
mnt
);
mnt_release_group_id
(
real_mount
(
mnt
)
);
list_del_init
(
&
mnt
->
mnt_share
);
mnt
->
mnt_group_id
=
0
;
...
...
fs/pnode.h
浏览文件 @
4b8b21f4
...
...
@@ -34,7 +34,7 @@ int propagate_mnt(struct vfsmount *, struct dentry *, struct vfsmount *,
struct
list_head
*
);
int
propagate_umount
(
struct
list_head
*
);
int
propagate_mount_busy
(
struct
vfsmount
*
,
int
);
void
mnt_release_group_id
(
struct
vfs
mount
*
);
void
mnt_release_group_id
(
struct
mount
*
);
int
get_dominating_id
(
struct
vfsmount
*
mnt
,
const
struct
path
*
root
);
unsigned
int
mnt_get_count
(
struct
vfsmount
*
mnt
);
void
mnt_set_mountpoint
(
struct
vfsmount
*
,
struct
dentry
*
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录