Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
a4a3bdd7
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a4a3bdd7
编写于
6月 10, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill opendata->{mnt,dentry}
->filp->f_path is there for purpose... Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
d9585277
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
14 deletion
+9
-14
fs/internal.h
fs/internal.h
+0
-2
fs/namei.c
fs/namei.c
+6
-9
fs/open.c
fs/open.c
+3
-3
未找到文件。
fs/internal.h
浏览文件 @
a4a3bdd7
...
@@ -83,8 +83,6 @@ extern struct super_block *user_get_super(dev_t);
...
@@ -83,8 +83,6 @@ extern struct super_block *user_get_super(dev_t);
* open.c
* open.c
*/
*/
struct
opendata
{
struct
opendata
{
struct
dentry
*
dentry
;
struct
vfsmount
*
mnt
;
struct
file
*
filp
;
struct
file
*
filp
;
};
};
struct
open_flags
{
struct
open_flags
{
...
...
fs/namei.c
浏览文件 @
a4a3bdd7
...
@@ -2269,14 +2269,11 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
...
@@ -2269,14 +2269,11 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
if
(
nd
->
flags
&
LOOKUP_DIRECTORY
)
if
(
nd
->
flags
&
LOOKUP_DIRECTORY
)
open_flag
|=
O_DIRECTORY
;
open_flag
|=
O_DIRECTORY
;
od
->
dentry
=
DENTRY_NOT_SET
;
od
->
filp
->
f_path
.
dentry
=
DENTRY_NOT_SET
;
od
->
mnt
=
nd
->
path
.
mnt
;
od
->
filp
->
f_path
.
mnt
=
nd
->
path
.
mnt
;
error
=
dir
->
i_op
->
atomic_open
(
dir
,
dentry
,
od
,
open_flag
,
mode
,
error
=
dir
->
i_op
->
atomic_open
(
dir
,
dentry
,
od
,
open_flag
,
mode
,
opened
);
opened
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
if
(
WARN_ON
(
od
->
dentry
!=
DENTRY_NOT_SET
))
dput
(
od
->
dentry
);
if
(
create_error
&&
error
==
-
ENOENT
)
if
(
create_error
&&
error
==
-
ENOENT
)
error
=
create_error
;
error
=
create_error
;
filp
=
ERR_PTR
(
error
);
filp
=
ERR_PTR
(
error
);
...
@@ -2290,13 +2287,13 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
...
@@ -2290,13 +2287,13 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
}
}
if
(
error
)
{
/* returned 1, that is */
if
(
error
)
{
/* returned 1, that is */
if
(
WARN_ON
(
od
->
dentry
==
DENTRY_NOT_SET
))
{
if
(
WARN_ON
(
od
->
filp
->
f_path
.
dentry
==
DENTRY_NOT_SET
))
{
filp
=
ERR_PTR
(
-
EIO
);
filp
=
ERR_PTR
(
-
EIO
);
goto
out
;
goto
out
;
}
}
if
(
od
->
dentry
)
{
if
(
od
->
filp
->
f_path
.
dentry
)
{
dput
(
dentry
);
dput
(
dentry
);
dentry
=
od
->
dentry
;
dentry
=
od
->
filp
->
f_path
.
dentry
;
}
}
goto
looked_up
;
goto
looked_up
;
}
}
...
@@ -2607,7 +2604,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
...
@@ -2607,7 +2604,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
error
=
may_open
(
&
nd
->
path
,
acc_mode
,
open_flag
);
error
=
may_open
(
&
nd
->
path
,
acc_mode
,
open_flag
);
if
(
error
)
if
(
error
)
goto
exit
;
goto
exit
;
od
->
mnt
=
nd
->
path
.
mnt
;
od
->
filp
->
f_path
.
mnt
=
nd
->
path
.
mnt
;
filp
=
finish_open
(
od
,
nd
->
path
.
dentry
,
NULL
,
opened
);
filp
=
finish_open
(
od
,
nd
->
path
.
dentry
,
NULL
,
opened
);
if
(
IS_ERR
(
filp
))
{
if
(
IS_ERR
(
filp
))
{
if
(
filp
==
ERR_PTR
(
-
EOPENSTALE
))
if
(
filp
==
ERR_PTR
(
-
EOPENSTALE
))
...
...
fs/open.c
浏览文件 @
a4a3bdd7
...
@@ -788,10 +788,10 @@ struct file *finish_open(struct opendata *od, struct dentry *dentry,
...
@@ -788,10 +788,10 @@ struct file *finish_open(struct opendata *od, struct dentry *dentry,
struct
file
*
res
;
struct
file
*
res
;
BUG_ON
(
*
opened
&
FILE_OPENED
);
/* once it's opened, it's opened */
BUG_ON
(
*
opened
&
FILE_OPENED
);
/* once it's opened, it's opened */
mntget
(
od
->
mnt
);
mntget
(
od
->
filp
->
f_path
.
mnt
);
dget
(
dentry
);
dget
(
dentry
);
res
=
do_dentry_open
(
dentry
,
od
->
mnt
,
od
->
filp
,
open
,
current_cred
());
res
=
do_dentry_open
(
dentry
,
od
->
filp
->
f_path
.
mnt
,
od
->
filp
,
open
,
current_cred
());
if
(
!
IS_ERR
(
res
))
if
(
!
IS_ERR
(
res
))
*
opened
|=
FILE_OPENED
;
*
opened
|=
FILE_OPENED
;
...
@@ -810,7 +810,7 @@ EXPORT_SYMBOL(finish_open);
...
@@ -810,7 +810,7 @@ EXPORT_SYMBOL(finish_open);
*/
*/
void
finish_no_open
(
struct
opendata
*
od
,
struct
dentry
*
dentry
)
void
finish_no_open
(
struct
opendata
*
od
,
struct
dentry
*
dentry
)
{
{
od
->
dentry
=
dentry
;
od
->
filp
->
f_path
.
dentry
=
dentry
;
}
}
EXPORT_SYMBOL
(
finish_no_open
);
EXPORT_SYMBOL
(
finish_no_open
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录