Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a457ac28
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
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)
...
@@ -144,36 +144,32 @@ static int hypfs_open(struct inode *inode, struct file *filp)
return
nonseekable_open
(
inode
,
filp
);
return
nonseekable_open
(
inode
,
filp
);
}
}
static
ssize_t
hypfs_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
static
ssize_t
hypfs_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
unsigned
long
nr_segs
,
loff_t
offset
)
{
{
char
*
data
;
struct
file
*
file
=
iocb
->
ki_filp
;
ssize_t
ret
;
char
*
data
=
file
->
private_data
;
struct
file
*
filp
=
iocb
->
ki_filp
;
size_t
available
=
strlen
(
data
);
/* XXX: temporary */
loff_t
pos
=
iocb
->
ki_pos
;
char
__user
*
buf
=
iov
[
0
].
iov_base
;
size_t
count
;
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
;
iocb
->
ki_pos
+=
ret
;
if
(
pos
<
0
)
file_accessed
(
filp
);
return
-
EINVAL
;
if
(
pos
>=
available
||
!
iov_iter_count
(
to
))
return
ret
;
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
;
int
rc
;
struct
super_block
*
sb
=
file_inode
(
iocb
->
ki_filp
)
->
i_sb
;
struct
super_block
*
sb
=
file_inode
(
iocb
->
ki_filp
)
->
i_sb
;
struct
hypfs_sb_info
*
fs_info
=
sb
->
s_fs_info
;
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:
* 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,
...
@@ -202,6 +198,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
}
hypfs_update_update
(
sb
);
hypfs_update_update
(
sb
);
rc
=
count
;
rc
=
count
;
iov_iter_advance
(
from
,
count
);
out:
out:
mutex_unlock
(
&
fs_info
->
lock
);
mutex_unlock
(
&
fs_info
->
lock
);
return
rc
;
return
rc
;
...
@@ -440,10 +437,10 @@ struct dentry *hypfs_create_str(struct dentry *dir,
...
@@ -440,10 +437,10 @@ struct dentry *hypfs_create_str(struct dentry *dir,
static
const
struct
file_operations
hypfs_file_ops
=
{
static
const
struct
file_operations
hypfs_file_ops
=
{
.
open
=
hypfs_open
,
.
open
=
hypfs_open
,
.
release
=
hypfs_release
,
.
release
=
hypfs_release
,
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do
_sync_write
,
.
write
=
new
_sync_write
,
.
aio_read
=
hypfs_aio_read
,
.
read_iter
=
hypfs_read_iter
,
.
aio_write
=
hypfs_aio_write
,
.
write_iter
=
hypfs_write_iter
,
.
llseek
=
no_llseek
,
.
llseek
=
no_llseek
,
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录