Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
94e92a6e
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
94e92a6e
编写于
10月 01, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move taking vfsmount_lock down into prepend_path()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
474279dc
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
2 addition
and
9 deletion
+2
-9
fs/dcache.c
fs/dcache.c
+2
-9
未找到文件。
fs/dcache.c
浏览文件 @
94e92a6e
...
@@ -2889,6 +2889,7 @@ static int prepend_path(const struct path *path,
...
@@ -2889,6 +2889,7 @@ static int prepend_path(const struct path *path,
char
*
bptr
;
char
*
bptr
;
int
blen
;
int
blen
;
br_read_lock
(
&
vfsmount_lock
);
rcu_read_lock
();
rcu_read_lock
();
restart:
restart:
bptr
=
*
buffer
;
bptr
=
*
buffer
;
...
@@ -2935,6 +2936,7 @@ static int prepend_path(const struct path *path,
...
@@ -2935,6 +2936,7 @@ static int prepend_path(const struct path *path,
goto
restart
;
goto
restart
;
}
}
done_seqretry
(
&
rename_lock
,
seq
);
done_seqretry
(
&
rename_lock
,
seq
);
br_read_unlock
(
&
vfsmount_lock
);
if
(
error
>=
0
&&
bptr
==
*
buffer
)
{
if
(
error
>=
0
&&
bptr
==
*
buffer
)
{
if
(
--
blen
<
0
)
if
(
--
blen
<
0
)
...
@@ -2971,9 +2973,7 @@ char *__d_path(const struct path *path,
...
@@ -2971,9 +2973,7 @@ char *__d_path(const struct path *path,
int
error
;
int
error
;
prepend
(
&
res
,
&
buflen
,
"
\0
"
,
1
);
prepend
(
&
res
,
&
buflen
,
"
\0
"
,
1
);
br_read_lock
(
&
vfsmount_lock
);
error
=
prepend_path
(
path
,
root
,
&
res
,
&
buflen
);
error
=
prepend_path
(
path
,
root
,
&
res
,
&
buflen
);
br_read_unlock
(
&
vfsmount_lock
);
if
(
error
<
0
)
if
(
error
<
0
)
return
ERR_PTR
(
error
);
return
ERR_PTR
(
error
);
...
@@ -2990,9 +2990,7 @@ char *d_absolute_path(const struct path *path,
...
@@ -2990,9 +2990,7 @@ char *d_absolute_path(const struct path *path,
int
error
;
int
error
;
prepend
(
&
res
,
&
buflen
,
"
\0
"
,
1
);
prepend
(
&
res
,
&
buflen
,
"
\0
"
,
1
);
br_read_lock
(
&
vfsmount_lock
);
error
=
prepend_path
(
path
,
&
root
,
&
res
,
&
buflen
);
error
=
prepend_path
(
path
,
&
root
,
&
res
,
&
buflen
);
br_read_unlock
(
&
vfsmount_lock
);
if
(
error
>
1
)
if
(
error
>
1
)
error
=
-
EINVAL
;
error
=
-
EINVAL
;
...
@@ -3067,9 +3065,7 @@ char *d_path(const struct path *path, char *buf, int buflen)
...
@@ -3067,9 +3065,7 @@ char *d_path(const struct path *path, char *buf, int buflen)
rcu_read_lock
();
rcu_read_lock
();
get_fs_root_rcu
(
current
->
fs
,
&
root
);
get_fs_root_rcu
(
current
->
fs
,
&
root
);
br_read_lock
(
&
vfsmount_lock
);
error
=
path_with_deleted
(
path
,
&
root
,
&
res
,
&
buflen
);
error
=
path_with_deleted
(
path
,
&
root
,
&
res
,
&
buflen
);
br_read_unlock
(
&
vfsmount_lock
);
rcu_read_unlock
();
rcu_read_unlock
();
if
(
error
<
0
)
if
(
error
<
0
)
...
@@ -3224,7 +3220,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
...
@@ -3224,7 +3220,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
get_fs_root_and_pwd_rcu
(
current
->
fs
,
&
root
,
&
pwd
);
get_fs_root_and_pwd_rcu
(
current
->
fs
,
&
root
,
&
pwd
);
error
=
-
ENOENT
;
error
=
-
ENOENT
;
br_read_lock
(
&
vfsmount_lock
);
if
(
!
d_unlinked
(
pwd
.
dentry
))
{
if
(
!
d_unlinked
(
pwd
.
dentry
))
{
unsigned
long
len
;
unsigned
long
len
;
char
*
cwd
=
page
+
PATH_MAX
;
char
*
cwd
=
page
+
PATH_MAX
;
...
@@ -3232,7 +3227,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
...
@@ -3232,7 +3227,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
prepend
(
&
cwd
,
&
buflen
,
"
\0
"
,
1
);
prepend
(
&
cwd
,
&
buflen
,
"
\0
"
,
1
);
error
=
prepend_path
(
&
pwd
,
&
root
,
&
cwd
,
&
buflen
);
error
=
prepend_path
(
&
pwd
,
&
root
,
&
cwd
,
&
buflen
);
br_read_unlock
(
&
vfsmount_lock
);
rcu_read_unlock
();
rcu_read_unlock
();
if
(
error
<
0
)
if
(
error
<
0
)
...
@@ -3253,7 +3247,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
...
@@ -3253,7 +3247,6 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
error
=
-
EFAULT
;
error
=
-
EFAULT
;
}
}
}
else
{
}
else
{
br_read_unlock
(
&
vfsmount_lock
);
rcu_read_unlock
();
rcu_read_unlock
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录