Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9e6697e2
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看板
提交
9e6697e2
编写于
12月 05, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
namei.c: fold set_root_rcu() into set_root()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0e81ba23
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
24 deletion
+20
-24
fs/namei.c
fs/namei.c
+20
-24
未找到文件。
fs/namei.c
浏览文件 @
9e6697e2
...
...
@@ -806,20 +806,20 @@ static int complete_walk(struct nameidata *nd)
}
static
void
set_root
(
struct
nameidata
*
nd
)
{
get_fs_root
(
current
->
fs
,
&
nd
->
root
);
}
static
void
set_root_rcu
(
struct
nameidata
*
nd
)
{
struct
fs_struct
*
fs
=
current
->
fs
;
unsigned
seq
;
do
{
seq
=
read_seqcount_begin
(
&
fs
->
seq
);
nd
->
root
=
fs
->
root
;
nd
->
root_seq
=
__read_seqcount_begin
(
&
nd
->
root
.
dentry
->
d_seq
);
}
while
(
read_seqcount_retry
(
&
fs
->
seq
,
seq
));
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
unsigned
seq
;
do
{
seq
=
read_seqcount_begin
(
&
fs
->
seq
);
nd
->
root
=
fs
->
root
;
nd
->
root_seq
=
__read_seqcount_begin
(
&
nd
->
root
.
dentry
->
d_seq
);
}
while
(
read_seqcount_retry
(
&
fs
->
seq
,
seq
));
}
else
{
get_fs_root
(
fs
,
&
nd
->
root
);
}
}
static
void
path_put_conditional
(
struct
path
*
path
,
struct
nameidata
*
nd
)
...
...
@@ -1015,10 +1015,10 @@ const char *get_link(struct nameidata *nd)
}
}
if
(
*
res
==
'/'
)
{
if
(
!
nd
->
root
.
mnt
)
set_root
(
nd
);
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
struct
dentry
*
d
;
if
(
!
nd
->
root
.
mnt
)
set_root_rcu
(
nd
);
nd
->
path
=
nd
->
root
;
d
=
nd
->
path
.
dentry
;
nd
->
inode
=
d
->
d_inode
;
...
...
@@ -1026,8 +1026,6 @@ const char *get_link(struct nameidata *nd)
if
(
unlikely
(
read_seqcount_retry
(
&
d
->
d_seq
,
nd
->
seq
)))
return
ERR_PTR
(
-
ECHILD
);
}
else
{
if
(
!
nd
->
root
.
mnt
)
set_root
(
nd
);
path_put
(
&
nd
->
path
);
nd
->
path
=
nd
->
root
;
path_get
(
&
nd
->
root
);
...
...
@@ -1294,8 +1292,6 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
static
int
follow_dotdot_rcu
(
struct
nameidata
*
nd
)
{
struct
inode
*
inode
=
nd
->
inode
;
if
(
!
nd
->
root
.
mnt
)
set_root_rcu
(
nd
);
while
(
1
)
{
if
(
path_equal
(
&
nd
->
path
,
&
nd
->
root
))
...
...
@@ -1415,9 +1411,6 @@ static void follow_mount(struct path *path)
static
int
follow_dotdot
(
struct
nameidata
*
nd
)
{
if
(
!
nd
->
root
.
mnt
)
set_root
(
nd
);
while
(
1
)
{
struct
dentry
*
old
=
nd
->
path
.
dentry
;
...
...
@@ -1655,6 +1648,8 @@ static inline int may_lookup(struct nameidata *nd)
static
inline
int
handle_dots
(
struct
nameidata
*
nd
,
int
type
)
{
if
(
type
==
LAST_DOTDOT
)
{
if
(
!
nd
->
root
.
mnt
)
set_root
(
nd
);
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
return
follow_dotdot_rcu
(
nd
);
}
else
...
...
@@ -2023,15 +2018,16 @@ static const char *path_init(struct nameidata *nd, unsigned flags)
nd
->
m_seq
=
read_seqbegin
(
&
mount_lock
);
if
(
*
s
==
'/'
)
{
if
(
flags
&
LOOKUP_RCU
)
{
if
(
flags
&
LOOKUP_RCU
)
rcu_read_lock
();
set_root_rcu
(
nd
);
set_root
(
nd
);
if
(
flags
&
LOOKUP_RCU
)
{
nd
->
seq
=
nd
->
root_seq
;
nd
->
path
=
nd
->
root
;
}
else
{
set_root
(
nd
);
path_get
(
&
nd
->
root
);
nd
->
path
=
nd
->
root
;
}
nd
->
path
=
nd
->
root
;
}
else
if
(
nd
->
dfd
==
AT_FDCWD
)
{
if
(
flags
&
LOOKUP_RCU
)
{
struct
fs_struct
*
fs
=
current
->
fs
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录