Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
25b7713a
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
25b7713a
编写于
7月 04, 2017
作者:
M
Miklos Szeredi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ovl: use i_private only as a key
Signed-off-by:
N
Miklos Szeredi
<
mszeredi@redhat.com
>
上级
e6d2ebdd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
20 deletion
+37
-20
fs/overlayfs/inode.c
fs/overlayfs/inode.c
+2
-2
fs/overlayfs/overlayfs.h
fs/overlayfs/overlayfs.h
+1
-12
fs/overlayfs/ovl_entry.h
fs/overlayfs/ovl_entry.h
+2
-0
fs/overlayfs/super.c
fs/overlayfs/super.c
+3
-0
fs/overlayfs/util.c
fs/overlayfs/util.c
+29
-6
未找到文件。
fs/overlayfs/inode.c
浏览文件 @
25b7713a
...
...
@@ -453,12 +453,12 @@ struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev)
static
int
ovl_inode_test
(
struct
inode
*
inode
,
void
*
data
)
{
return
ovl_inode_real
(
inode
,
NULL
)
==
data
;
return
inode
->
i_private
==
data
;
}
static
int
ovl_inode_set
(
struct
inode
*
inode
,
void
*
data
)
{
inode
->
i_private
=
(
void
*
)
(((
unsigned
long
)
data
)
|
OVL_ISUPPER_MASK
)
;
inode
->
i_private
=
data
;
return
0
;
}
...
...
fs/overlayfs/overlayfs.h
浏览文件 @
25b7713a
...
...
@@ -60,8 +60,6 @@ struct ovl_fh {
u8
fid
[
0
];
/* file identifier */
}
__packed
;
#define OVL_ISUPPER_MASK 1UL
static
inline
int
ovl_do_rmdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
int
err
=
vfs_rmdir
(
dir
,
dentry
);
...
...
@@ -175,16 +173,6 @@ static inline struct dentry *ovl_do_tmpfile(struct dentry *dentry, umode_t mode)
return
ret
;
}
static
inline
struct
inode
*
ovl_inode_real
(
struct
inode
*
inode
,
bool
*
is_upper
)
{
unsigned
long
x
=
(
unsigned
long
)
READ_ONCE
(
inode
->
i_private
);
if
(
is_upper
)
*
is_upper
=
x
&
OVL_ISUPPER_MASK
;
return
(
struct
inode
*
)
(
x
&
~
OVL_ISUPPER_MASK
);
}
/* util.c */
int
ovl_want_write
(
struct
dentry
*
dentry
);
void
ovl_drop_write
(
struct
dentry
*
dentry
);
...
...
@@ -201,6 +189,7 @@ enum ovl_path_type ovl_path_real(struct dentry *dentry, struct path *path);
struct
dentry
*
ovl_dentry_upper
(
struct
dentry
*
dentry
);
struct
dentry
*
ovl_dentry_lower
(
struct
dentry
*
dentry
);
struct
dentry
*
ovl_dentry_real
(
struct
dentry
*
dentry
);
struct
inode
*
ovl_inode_real
(
struct
inode
*
inode
,
bool
*
is_upper
);
struct
ovl_dir_cache
*
ovl_dir_cache
(
struct
dentry
*
dentry
);
void
ovl_set_dir_cache
(
struct
dentry
*
dentry
,
struct
ovl_dir_cache
*
cache
);
bool
ovl_dentry_is_opaque
(
struct
dentry
*
dentry
);
...
...
fs/overlayfs/ovl_entry.h
浏览文件 @
25b7713a
...
...
@@ -61,6 +61,8 @@ static inline struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe)
struct
ovl_inode
{
struct
inode
vfs_inode
;
struct
inode
*
upper
;
struct
inode
*
lower
;
};
static
inline
struct
ovl_inode
*
OVL_I
(
struct
inode
*
inode
)
...
...
fs/overlayfs/super.c
浏览文件 @
25b7713a
...
...
@@ -171,6 +171,9 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
{
struct
ovl_inode
*
oi
=
kmem_cache_alloc
(
ovl_inode_cachep
,
GFP_KERNEL
);
oi
->
upper
=
NULL
;
oi
->
lower
=
NULL
;
return
&
oi
->
vfs_inode
;
}
...
...
fs/overlayfs/util.c
浏览文件 @
25b7713a
...
...
@@ -155,6 +155,22 @@ struct dentry *ovl_dentry_real(struct dentry *dentry)
return
realdentry
;
}
struct
inode
*
ovl_inode_real
(
struct
inode
*
inode
,
bool
*
is_upper
)
{
struct
inode
*
realinode
=
lockless_dereference
(
OVL_I
(
inode
)
->
upper
);
bool
isup
=
false
;
if
(
!
realinode
)
realinode
=
OVL_I
(
inode
)
->
lower
;
else
isup
=
true
;
if
(
is_upper
)
*
is_upper
=
isup
;
return
realinode
;
}
struct
ovl_dir_cache
*
ovl_dir_cache
(
struct
dentry
*
dentry
)
{
struct
ovl_entry
*
oe
=
dentry
->
d_fsdata
;
...
...
@@ -233,10 +249,11 @@ void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry)
void
ovl_inode_init
(
struct
inode
*
inode
,
struct
dentry
*
dentry
)
{
struct
inode
*
realinode
=
d_inode
(
ovl_dentry_real
(
dentry
));
bool
is_upper
=
ovl_dentry_upper
(
dentry
);
WRITE_ONCE
(
inode
->
i_private
,
(
unsigned
long
)
realinode
|
(
is_upper
?
OVL_ISUPPER_MASK
:
0
));
if
(
ovl_dentry_upper
(
dentry
))
OVL_I
(
inode
)
->
upper
=
realinode
;
else
OVL_I
(
inode
)
->
lower
=
realinode
;
ovl_copyattr
(
realinode
,
inode
);
}
...
...
@@ -245,10 +262,16 @@ void ovl_inode_update(struct inode *inode, struct inode *upperinode)
{
WARN_ON
(
!
upperinode
);
WARN_ON
(
!
inode_unhashed
(
inode
));
WRITE_ONCE
(
inode
->
i_private
,
(
unsigned
long
)
upperinode
|
OVL_ISUPPER_MASK
);
if
(
!
S_ISDIR
(
upperinode
->
i_mode
))
/*
* Make sure upperinode is consistent before making it visible to
* ovl_inode_real();
*/
smp_wmb
();
OVL_I
(
inode
)
->
upper
=
upperinode
;
if
(
!
S_ISDIR
(
upperinode
->
i_mode
))
{
inode
->
i_private
=
upperinode
;
__insert_inode_hash
(
inode
,
(
unsigned
long
)
upperinode
);
}
}
void
ovl_dentry_version_inc
(
struct
dentry
*
dentry
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录