Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a457ac28
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看板
提交
a457ac28
编写于
2月 04, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hypfs: switch to read_iter/write_iter
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
db671a8e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
27 deletion
+24
-27
arch/s390/hypfs/inode.c
arch/s390/hypfs/inode.c
+24
-27
未找到文件。
arch/s390/hypfs/inode.c
浏览文件 @
a457ac28
...
...
@@ -144,36 +144,32 @@ static int hypfs_open(struct inode *inode, struct file *filp)
return
nonseekable_open
(
inode
,
filp
);
}
static
ssize_t
hypfs_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
offset
)
static
ssize_t
hypfs_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
char
*
data
;
ssize_t
ret
;
struct
file
*
filp
=
iocb
->
ki_filp
;
/* XXX: temporary */
char
__user
*
buf
=
iov
[
0
].
iov_base
;
size_t
count
=
iov
[
0
].
iov_len
;
if
(
nr_segs
!=
1
)
return
-
EINVAL
;
data
=
filp
->
private_data
;
ret
=
simple_read_from_buffer
(
buf
,
count
,
&
offset
,
data
,
strlen
(
data
));
if
(
ret
<=
0
)
return
ret
;
struct
file
*
file
=
iocb
->
ki_filp
;
char
*
data
=
file
->
private_data
;
size_t
available
=
strlen
(
data
);
loff_t
pos
=
iocb
->
ki_pos
;
size_t
count
;
iocb
->
ki_pos
+=
ret
;
file_accessed
(
filp
);
return
ret
;
if
(
pos
<
0
)
return
-
EINVAL
;
if
(
pos
>=
available
||
!
iov_iter_count
(
to
))
return
0
;
count
=
copy_to_iter
(
data
+
pos
,
available
-
pos
,
to
);
if
(
!
count
)
return
-
EFAULT
;
iocb
->
ki_pos
=
pos
+
count
;
file_accessed
(
file
);
return
count
;
}
static
ssize_t
hypfs_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
offset
)
static
ssize_t
hypfs_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
int
rc
;
struct
super_block
*
sb
=
file_inode
(
iocb
->
ki_filp
)
->
i_sb
;
struct
hypfs_sb_info
*
fs_info
=
sb
->
s_fs_info
;
size_t
count
=
iov_
length
(
iov
,
nr_segs
);
size_t
count
=
iov_
iter_count
(
from
);
/*
* Currently we only allow one update per second for two reasons:
...
...
@@ -202,6 +198,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
hypfs_update_update
(
sb
);
rc
=
count
;
iov_iter_advance
(
from
,
count
);
out:
mutex_unlock
(
&
fs_info
->
lock
);
return
rc
;
...
...
@@ -440,10 +437,10 @@ struct dentry *hypfs_create_str(struct dentry *dir,
static
const
struct
file_operations
hypfs_file_ops
=
{
.
open
=
hypfs_open
,
.
release
=
hypfs_release
,
.
read
=
do
_sync_read
,
.
write
=
do
_sync_write
,
.
aio_read
=
hypfs_aio_read
,
.
aio_write
=
hypfs_aio_write
,
.
read
=
new
_sync_read
,
.
write
=
new
_sync_write
,
.
read_iter
=
hypfs_read_iter
,
.
write_iter
=
hypfs_write_iter
,
.
llseek
=
no_llseek
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录