Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0f7ff2da
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看板
提交
0f7ff2da
编写于
12月 06, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ovl: get rid of the dead code left from broken (and disabled) optimizations
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
acff81ec
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
26 deletion
+11
-26
fs/overlayfs/copy_up.c
fs/overlayfs/copy_up.c
+6
-17
fs/overlayfs/inode.c
fs/overlayfs/inode.c
+4
-7
fs/overlayfs/overlayfs.h
fs/overlayfs/overlayfs.h
+1
-2
未找到文件。
fs/overlayfs/copy_up.c
浏览文件 @
0f7ff2da
...
...
@@ -195,8 +195,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat)
static
int
ovl_copy_up_locked
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
iattr
*
attr
,
const
char
*
link
)
struct
kstat
*
stat
,
const
char
*
link
)
{
struct
inode
*
wdir
=
workdir
->
d_inode
;
struct
inode
*
udir
=
upperdir
->
d_inode
;
...
...
@@ -240,8 +239,6 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
mutex_lock
(
&
newdentry
->
d_inode
->
i_mutex
);
err
=
ovl_set_attr
(
newdentry
,
stat
);
if
(
!
err
&&
attr
)
err
=
notify_change
(
newdentry
,
attr
,
NULL
);
mutex_unlock
(
&
newdentry
->
d_inode
->
i_mutex
);
if
(
err
)
goto
out_cleanup
;
...
...
@@ -286,8 +283,7 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
* that point the file will have already been copied up anyway.
*/
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
iattr
*
attr
)
struct
path
*
lowerpath
,
struct
kstat
*
stat
)
{
struct
dentry
*
workdir
=
ovl_workdir
(
dentry
);
int
err
;
...
...
@@ -345,26 +341,19 @@ int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
}
upperdentry
=
ovl_dentry_upper
(
dentry
);
if
(
upperdentry
)
{
unlock_rename
(
workdir
,
upperdir
);
/* Raced with another copy-up? Nothing to do, then... */
err
=
0
;
/* Raced with another copy-up? Do the setattr here */
if
(
attr
)
{
mutex_lock
(
&
upperdentry
->
d_inode
->
i_mutex
);
err
=
notify_change
(
upperdentry
,
attr
,
NULL
);
mutex_unlock
(
&
upperdentry
->
d_inode
->
i_mutex
);
}
goto
out_put_cred
;
goto
out_unlock
;
}
err
=
ovl_copy_up_locked
(
workdir
,
upperdir
,
dentry
,
lowerpath
,
stat
,
attr
,
link
);
stat
,
link
);
if
(
!
err
)
{
/* Restore timestamps on parent (best effort) */
ovl_set_timestamps
(
upperdir
,
&
pstat
);
}
out_unlock:
unlock_rename
(
workdir
,
upperdir
);
out_put_cred:
revert_creds
(
old_cred
);
put_cred
(
override_cred
);
...
...
@@ -406,7 +395,7 @@ int ovl_copy_up(struct dentry *dentry)
ovl_path_lower
(
next
,
&
lowerpath
);
err
=
vfs_getattr
(
&
lowerpath
,
&
stat
);
if
(
!
err
)
err
=
ovl_copy_up_one
(
parent
,
next
,
&
lowerpath
,
&
stat
,
NULL
);
err
=
ovl_copy_up_one
(
parent
,
next
,
&
lowerpath
,
&
stat
);
dput
(
parent
);
dput
(
next
);
...
...
fs/overlayfs/inode.c
浏览文件 @
0f7ff2da
...
...
@@ -12,8 +12,7 @@
#include <linux/xattr.h>
#include "overlayfs.h"
static
int
ovl_copy_up_last
(
struct
dentry
*
dentry
,
struct
iattr
*
attr
,
bool
no_data
)
static
int
ovl_copy_up_truncate
(
struct
dentry
*
dentry
)
{
int
err
;
struct
dentry
*
parent
;
...
...
@@ -30,10 +29,8 @@ static int ovl_copy_up_last(struct dentry *dentry, struct iattr *attr,
if
(
err
)
goto
out_dput_parent
;
if
(
no_data
)
stat
.
size
=
0
;
err
=
ovl_copy_up_one
(
parent
,
dentry
,
&
lowerpath
,
&
stat
,
attr
);
stat
.
size
=
0
;
err
=
ovl_copy_up_one
(
parent
,
dentry
,
&
lowerpath
,
&
stat
);
out_dput_parent:
dput
(
parent
);
...
...
@@ -353,7 +350,7 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, unsigned file_flags)
return
ERR_PTR
(
err
);
if
(
file_flags
&
O_TRUNC
)
err
=
ovl_copy_up_
last
(
dentry
,
NULL
,
true
);
err
=
ovl_copy_up_
truncate
(
dentry
);
else
err
=
ovl_copy_up
(
dentry
);
ovl_drop_write
(
dentry
);
...
...
fs/overlayfs/overlayfs.h
浏览文件 @
0f7ff2da
...
...
@@ -194,7 +194,6 @@ void ovl_cleanup(struct inode *dir, struct dentry *dentry);
/* copy_up.c */
int
ovl_copy_up
(
struct
dentry
*
dentry
);
int
ovl_copy_up_one
(
struct
dentry
*
parent
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
struct
iattr
*
attr
);
struct
path
*
lowerpath
,
struct
kstat
*
stat
);
int
ovl_copy_xattr
(
struct
dentry
*
old
,
struct
dentry
*
new
);
int
ovl_set_attr
(
struct
dentry
*
upper
,
struct
kstat
*
stat
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录