Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
15169fe7
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看板
提交
15169fe7
编写于
11月 25, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: mnt_id/mnt_group_id moved
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
143c8c91
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
20 deletion
+22
-20
fs/fhandle.c
fs/fhandle.c
+3
-1
fs/mount.h
fs/mount.h
+2
-0
fs/namespace.c
fs/namespace.c
+15
-15
fs/pnode.c
fs/pnode.c
+2
-2
include/linux/mount.h
include/linux/mount.h
+0
-2
未找到文件。
fs/fhandle.c
浏览文件 @
15169fe7
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include <linux/personality.h>
#include <linux/personality.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include "internal.h"
#include "internal.h"
#include "mount.h"
static
long
do_sys_name_to_handle
(
struct
path
*
path
,
static
long
do_sys_name_to_handle
(
struct
path
*
path
,
struct
file_handle
__user
*
ufh
,
struct
file_handle
__user
*
ufh
,
...
@@ -66,7 +67,8 @@ static long do_sys_name_to_handle(struct path *path,
...
@@ -66,7 +67,8 @@ static long do_sys_name_to_handle(struct path *path,
}
else
}
else
retval
=
0
;
retval
=
0
;
/* copy the mount id */
/* copy the mount id */
if
(
copy_to_user
(
mnt_id
,
&
path
->
mnt
->
mnt_id
,
sizeof
(
*
mnt_id
))
||
if
(
copy_to_user
(
mnt_id
,
&
real_mount
(
path
->
mnt
)
->
mnt_id
,
sizeof
(
*
mnt_id
))
||
copy_to_user
(
ufh
,
handle
,
copy_to_user
(
ufh
,
handle
,
sizeof
(
struct
file_handle
)
+
handle_bytes
))
sizeof
(
struct
file_handle
)
+
handle_bytes
))
retval
=
-
EFAULT
;
retval
=
-
EFAULT
;
...
...
fs/mount.h
浏览文件 @
15169fe7
...
@@ -26,6 +26,8 @@ struct mount {
...
@@ -26,6 +26,8 @@ struct mount {
struct
list_head
mnt_slave
;
/* slave list entry */
struct
list_head
mnt_slave
;
/* slave list entry */
struct
mount
*
mnt_master
;
/* slave is on master->mnt_slave_list */
struct
mount
*
mnt_master
;
/* slave is on master->mnt_slave_list */
struct
mnt_namespace
*
mnt_ns
;
/* containing namespace */
struct
mnt_namespace
*
mnt_ns
;
/* containing namespace */
int
mnt_id
;
/* mount identifier */
int
mnt_group_id
;
/* peer group identifier */
};
};
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
...
...
fs/namespace.c
浏览文件 @
15169fe7
...
@@ -85,9 +85,9 @@ static int mnt_alloc_id(struct mount *mnt)
...
@@ -85,9 +85,9 @@ static int mnt_alloc_id(struct mount *mnt)
retry:
retry:
ida_pre_get
(
&
mnt_id_ida
,
GFP_KERNEL
);
ida_pre_get
(
&
mnt_id_ida
,
GFP_KERNEL
);
spin_lock
(
&
mnt_id_lock
);
spin_lock
(
&
mnt_id_lock
);
res
=
ida_get_new_above
(
&
mnt_id_ida
,
mnt_id_start
,
&
mnt
->
mnt
.
mnt
_id
);
res
=
ida_get_new_above
(
&
mnt_id_ida
,
mnt_id_start
,
&
mnt
->
mnt_id
);
if
(
!
res
)
if
(
!
res
)
mnt_id_start
=
mnt
->
mnt
.
mnt
_id
+
1
;
mnt_id_start
=
mnt
->
mnt_id
+
1
;
spin_unlock
(
&
mnt_id_lock
);
spin_unlock
(
&
mnt_id_lock
);
if
(
res
==
-
EAGAIN
)
if
(
res
==
-
EAGAIN
)
goto
retry
;
goto
retry
;
...
@@ -97,7 +97,7 @@ static int mnt_alloc_id(struct mount *mnt)
...
@@ -97,7 +97,7 @@ static int mnt_alloc_id(struct mount *mnt)
static
void
mnt_free_id
(
struct
mount
*
mnt
)
static
void
mnt_free_id
(
struct
mount
*
mnt
)
{
{
int
id
=
mnt
->
mnt
.
mnt
_id
;
int
id
=
mnt
->
mnt_id
;
spin_lock
(
&
mnt_id_lock
);
spin_lock
(
&
mnt_id_lock
);
ida_remove
(
&
mnt_id_ida
,
id
);
ida_remove
(
&
mnt_id_ida
,
id
);
if
(
mnt_id_start
>
id
)
if
(
mnt_id_start
>
id
)
...
@@ -119,9 +119,9 @@ static int mnt_alloc_group_id(struct mount *mnt)
...
@@ -119,9 +119,9 @@ static int mnt_alloc_group_id(struct mount *mnt)
res
=
ida_get_new_above
(
&
mnt_group_ida
,
res
=
ida_get_new_above
(
&
mnt_group_ida
,
mnt_group_start
,
mnt_group_start
,
&
mnt
->
mnt
.
mnt
_group_id
);
&
mnt
->
mnt_group_id
);
if
(
!
res
)
if
(
!
res
)
mnt_group_start
=
mnt
->
mnt
.
mnt
_group_id
+
1
;
mnt_group_start
=
mnt
->
mnt_group_id
+
1
;
return
res
;
return
res
;
}
}
...
@@ -131,11 +131,11 @@ static int mnt_alloc_group_id(struct mount *mnt)
...
@@ -131,11 +131,11 @@ static int mnt_alloc_group_id(struct mount *mnt)
*/
*/
void
mnt_release_group_id
(
struct
mount
*
mnt
)
void
mnt_release_group_id
(
struct
mount
*
mnt
)
{
{
int
id
=
mnt
->
mnt
.
mnt
_group_id
;
int
id
=
mnt
->
mnt_group_id
;
ida_remove
(
&
mnt_group_ida
,
id
);
ida_remove
(
&
mnt_group_ida
,
id
);
if
(
mnt_group_start
>
id
)
if
(
mnt_group_start
>
id
)
mnt_group_start
=
id
;
mnt_group_start
=
id
;
mnt
->
mnt
.
mnt
_group_id
=
0
;
mnt
->
mnt_group_id
=
0
;
}
}
/*
/*
...
@@ -696,11 +696,11 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
...
@@ -696,11 +696,11 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
if
(
mnt
)
{
if
(
mnt
)
{
if
(
flag
&
(
CL_SLAVE
|
CL_PRIVATE
))
if
(
flag
&
(
CL_SLAVE
|
CL_PRIVATE
))
mnt
->
mnt
.
mnt
_group_id
=
0
;
/* not a peer of original */
mnt
->
mnt_group_id
=
0
;
/* not a peer of original */
else
else
mnt
->
mnt
.
mnt_group_id
=
old
->
mnt
.
mnt_group_id
;
mnt
->
mnt
_group_id
=
old
->
mnt_group_id
;
if
((
flag
&
CL_MAKE_SHARED
)
&&
!
mnt
->
mnt
.
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
(
mnt
);
if
(
err
)
if
(
err
)
goto
out_free
;
goto
out_free
;
...
@@ -1029,7 +1029,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
...
@@ -1029,7 +1029,7 @@ static int show_mountinfo(struct seq_file *m, void *v)
struct
path
root
=
p
->
root
;
struct
path
root
=
p
->
root
;
int
err
=
0
;
int
err
=
0
;
seq_printf
(
m
,
"%i %i %u:%u "
,
mnt
->
mnt_id
,
r
->
mnt_parent
->
mnt
.
mnt_id
,
seq_printf
(
m
,
"%i %i %u:%u "
,
r
->
mnt_id
,
r
->
mnt_parent
->
mnt_id
,
MAJOR
(
sb
->
s_dev
),
MINOR
(
sb
->
s_dev
));
MAJOR
(
sb
->
s_dev
),
MINOR
(
sb
->
s_dev
));
if
(
sb
->
s_op
->
show_path
)
if
(
sb
->
s_op
->
show_path
)
err
=
sb
->
s_op
->
show_path
(
m
,
mnt
);
err
=
sb
->
s_op
->
show_path
(
m
,
mnt
);
...
@@ -1049,9 +1049,9 @@ static int show_mountinfo(struct seq_file *m, void *v)
...
@@ -1049,9 +1049,9 @@ static int show_mountinfo(struct seq_file *m, void *v)
/* Tagged fields ("foo:X" or "bar") */
/* Tagged fields ("foo:X" or "bar") */
if
(
IS_MNT_SHARED
(
mnt
))
if
(
IS_MNT_SHARED
(
mnt
))
seq_printf
(
m
,
" shared:%i"
,
mnt
->
mnt_group_id
);
seq_printf
(
m
,
" shared:%i"
,
r
->
mnt_group_id
);
if
(
IS_MNT_SLAVE
(
r
))
{
if
(
IS_MNT_SLAVE
(
r
))
{
int
master
=
r
->
mnt_master
->
mnt
.
mnt
_group_id
;
int
master
=
r
->
mnt_master
->
mnt_group_id
;
int
dom
=
get_dominating_id
(
r
,
&
p
->
root
);
int
dom
=
get_dominating_id
(
r
,
&
p
->
root
);
seq_printf
(
m
,
" master:%i"
,
master
);
seq_printf
(
m
,
" master:%i"
,
master
);
if
(
dom
&&
dom
!=
master
)
if
(
dom
&&
dom
!=
master
)
...
@@ -1507,7 +1507,7 @@ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
...
@@ -1507,7 +1507,7 @@ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
struct
mount
*
p
;
struct
mount
*
p
;
for
(
p
=
mnt
;
p
!=
end
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
{
for
(
p
=
mnt
;
p
!=
end
;
p
=
next_mnt
(
p
,
&
mnt
->
mnt
))
{
if
(
p
->
mnt
.
mnt
_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
if
(
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
mnt_release_group_id
(
p
);
mnt_release_group_id
(
p
);
}
}
}
}
...
@@ -1517,7 +1517,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
...
@@ -1517,7 +1517,7 @@ static int invent_group_ids(struct mount *mnt, bool recurse)
struct
mount
*
p
;
struct
mount
*
p
;
for
(
p
=
mnt
;
p
;
p
=
recurse
?
next_mnt
(
p
,
&
mnt
->
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
))
{
if
(
!
p
->
mnt_group_id
&&
!
IS_MNT_SHARED
(
&
p
->
mnt
))
{
int
err
=
mnt_alloc_group_id
(
p
);
int
err
=
mnt_alloc_group_id
(
p
);
if
(
err
)
{
if
(
err
)
{
cleanup_group_ids
(
mnt
,
p
);
cleanup_group_ids
(
mnt
,
p
);
...
...
fs/pnode.c
浏览文件 @
15169fe7
...
@@ -58,7 +58,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
...
@@ -58,7 +58,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root)
for
(
m
=
mnt
->
mnt_master
;
m
!=
NULL
;
m
=
m
->
mnt_master
)
{
for
(
m
=
mnt
->
mnt_master
;
m
!=
NULL
;
m
=
m
->
mnt_master
)
{
struct
mount
*
d
=
get_peer_under_root
(
m
,
mnt
->
mnt_ns
,
root
);
struct
mount
*
d
=
get_peer_under_root
(
m
,
mnt
->
mnt_ns
,
root
);
if
(
d
)
if
(
d
)
return
d
->
mnt
.
mnt
_group_id
;
return
d
->
mnt_group_id
;
}
}
return
0
;
return
0
;
...
@@ -86,7 +86,7 @@ static int do_make_slave(struct mount *mnt)
...
@@ -86,7 +86,7 @@ static int do_make_slave(struct mount *mnt)
mnt_release_group_id
(
mnt
);
mnt_release_group_id
(
mnt
);
list_del_init
(
&
mnt
->
mnt_share
);
list_del_init
(
&
mnt
->
mnt_share
);
mnt
->
mnt
.
mnt
_group_id
=
0
;
mnt
->
mnt_group_id
=
0
;
if
(
peer_mnt
)
if
(
peer_mnt
)
master
=
peer_mnt
;
master
=
peer_mnt
;
...
...
include/linux/mount.h
浏览文件 @
15169fe7
...
@@ -58,8 +58,6 @@ struct vfsmount {
...
@@ -58,8 +58,6 @@ struct vfsmount {
#endif
#endif
const
char
*
mnt_devname
;
/* Name of device e.g. /dev/dsk/hda1 */
const
char
*
mnt_devname
;
/* Name of device e.g. /dev/dsk/hda1 */
struct
list_head
mnt_list
;
struct
list_head
mnt_list
;
int
mnt_id
;
/* mount identifier */
int
mnt_group_id
;
/* peer group identifier */
int
mnt_expiry_mark
;
/* true if marked for expiry */
int
mnt_expiry_mark
;
/* true if marked for expiry */
int
mnt_pinned
;
int
mnt_pinned
;
int
mnt_ghosts
;
int
mnt_ghosts
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录