Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
2de5f059
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2de5f059
编写于
5月 22, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[readdir] convert ecryptfs
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e924f251
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
20 deletion
+15
-20
fs/ecryptfs/file.c
fs/ecryptfs/file.c
+15
-20
未找到文件。
fs/ecryptfs/file.c
浏览文件 @
2de5f059
...
@@ -69,9 +69,8 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
...
@@ -69,9 +69,8 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
struct
ecryptfs_getdents_callback
{
struct
ecryptfs_getdents_callback
{
struct
dir_context
ctx
;
struct
dir_context
ctx
;
void
*
dirent
;
struct
dir_context
*
caller
;
struct
dentry
*
dentry
;
struct
dentry
*
dentry
;
filldir_t
filldir
;
int
filldir_called
;
int
filldir_called
;
int
entries_written
;
int
entries_written
;
};
};
...
@@ -97,9 +96,10 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
...
@@ -97,9 +96,10 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
rc
);
rc
);
goto
out
;
goto
out
;
}
}
rc
=
buf
->
filldir
(
buf
->
dirent
,
name
,
name_size
,
offset
,
ino
,
d_type
);
buf
->
caller
->
pos
=
buf
->
ctx
.
pos
;
rc
=
!
dir_emit
(
buf
->
caller
,
name
,
name_size
,
ino
,
d_type
);
kfree
(
name
);
kfree
(
name
);
if
(
rc
>=
0
)
if
(
!
rc
)
buf
->
entries_written
++
;
buf
->
entries_written
++
;
out:
out:
return
rc
;
return
rc
;
...
@@ -108,28 +108,23 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
...
@@ -108,28 +108,23 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
/**
/**
* ecryptfs_readdir
* ecryptfs_readdir
* @file: The eCryptfs directory file
* @file: The eCryptfs directory file
* @dirent: Directory entry handle
* @ctx: The actor to feed the entries to
* @filldir: The filldir callback function
*/
*/
static
int
ecryptfs_readdir
(
struct
file
*
file
,
void
*
dirent
,
filldir_t
filldir
)
static
int
ecryptfs_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
{
{
int
rc
;
int
rc
;
struct
file
*
lower_file
;
struct
file
*
lower_file
;
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
ecryptfs_getdents_callback
buf
;
struct
ecryptfs_getdents_callback
buf
=
{
.
ctx
.
actor
=
ecryptfs_filldir
,
.
caller
=
ctx
,
.
dentry
=
file
->
f_path
.
dentry
};
lower_file
=
ecryptfs_file_to_lower
(
file
);
lower_file
=
ecryptfs_file_to_lower
(
file
);
lower_file
->
f_pos
=
file
->
f_
pos
;
lower_file
->
f_pos
=
ctx
->
pos
;
inode
=
file_inode
(
file
);
inode
=
file_inode
(
file
);
memset
(
&
buf
,
0
,
sizeof
(
buf
));
buf
.
dirent
=
dirent
;
buf
.
dentry
=
file
->
f_path
.
dentry
;
buf
.
filldir
=
filldir
;
buf
.
filldir_called
=
0
;
buf
.
entries_written
=
0
;
buf
.
ctx
.
actor
=
ecryptfs_filldir
;
rc
=
iterate_dir
(
lower_file
,
&
buf
.
ctx
);
rc
=
iterate_dir
(
lower_file
,
&
buf
.
ctx
);
file
->
f_pos
=
lower_file
->
f_
pos
;
ctx
->
pos
=
buf
.
ctx
.
pos
;
if
(
rc
<
0
)
if
(
rc
<
0
)
goto
out
;
goto
out
;
if
(
buf
.
filldir_called
&&
!
buf
.
entries_written
)
if
(
buf
.
filldir_called
&&
!
buf
.
entries_written
)
...
@@ -346,7 +341,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -346,7 +341,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
#endif
#endif
const
struct
file_operations
ecryptfs_dir_fops
=
{
const
struct
file_operations
ecryptfs_dir_fops
=
{
.
readdir
=
ecryptfs_readdir
,
.
iterate
=
ecryptfs_readdir
,
.
read
=
generic_read_dir
,
.
read
=
generic_read_dir
,
.
unlocked_ioctl
=
ecryptfs_unlocked_ioctl
,
.
unlocked_ioctl
=
ecryptfs_unlocked_ioctl
,
#ifdef CONFIG_COMPAT
#ifdef CONFIG_COMPAT
...
@@ -367,7 +362,7 @@ const struct file_operations ecryptfs_main_fops = {
...
@@ -367,7 +362,7 @@ const struct file_operations ecryptfs_main_fops = {
.
aio_read
=
ecryptfs_read_update_atime
,
.
aio_read
=
ecryptfs_read_update_atime
,
.
write
=
do_sync_write
,
.
write
=
do_sync_write
,
.
aio_write
=
generic_file_aio_write
,
.
aio_write
=
generic_file_aio_write
,
.
readdir
=
ecryptfs_readdir
,
.
iterate
=
ecryptfs_readdir
,
.
unlocked_ioctl
=
ecryptfs_unlocked_ioctl
,
.
unlocked_ioctl
=
ecryptfs_unlocked_ioctl
,
#ifdef CONFIG_COMPAT
#ifdef CONFIG_COMPAT
.
compat_ioctl
=
ecryptfs_compat_ioctl
,
.
compat_ioctl
=
ecryptfs_compat_ioctl
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录