Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
84c3d55c
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看板
提交
84c3d55c
编写于
4月 03, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fuse: switch to ->write_iter()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b30ac0fc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
16 deletion
+11
-16
fs/fuse/file.c
fs/fuse/file.c
+11
-16
未找到文件。
fs/fuse/file.c
浏览文件 @
84c3d55c
...
...
@@ -1182,18 +1182,17 @@ static ssize_t fuse_perform_write(struct file *file,
return
res
>
0
?
res
:
err
;
}
static
ssize_t
fuse_file_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
static
ssize_t
fuse_file_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
address_space
*
mapping
=
file
->
f_mapping
;
size_t
count
;
size_t
count
=
iov_iter_count
(
from
)
;
ssize_t
written
=
0
;
ssize_t
written_buffered
=
0
;
struct
inode
*
inode
=
mapping
->
host
;
ssize_t
err
;
struct
iov_iter
i
;
loff_t
endbyte
=
0
;
loff_t
pos
=
iocb
->
ki_pos
;
if
(
get_fuse_conn
(
inode
)
->
writeback_cache
)
{
/* Update size (EOF optimization) and mode (SUID clearing) */
...
...
@@ -1201,13 +1200,9 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
if
(
err
)
return
err
;
return
generic_file_
aio_write
(
iocb
,
iov
,
nr_segs
,
pos
);
return
generic_file_
write_iter
(
iocb
,
from
);
}
WARN_ON
(
iocb
->
ki_pos
!=
pos
);
count
=
iov_length
(
iov
,
nr_segs
);
iov_iter_init
(
&
i
,
WRITE
,
iov
,
nr_segs
,
count
);
mutex_lock
(
&
inode
->
i_mutex
);
/* We can write back this queue in page reclaim */
...
...
@@ -1220,7 +1215,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
if
(
count
==
0
)
goto
out
;
iov_iter_truncate
(
&
i
,
count
);
iov_iter_truncate
(
from
,
count
);
err
=
file_remove_suid
(
file
);
if
(
err
)
goto
out
;
...
...
@@ -1230,13 +1225,13 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
goto
out
;
if
(
file
->
f_flags
&
O_DIRECT
)
{
written
=
generic_file_direct_write
(
iocb
,
&
i
,
pos
);
if
(
written
<
0
||
!
iov_iter_count
(
&
i
))
written
=
generic_file_direct_write
(
iocb
,
from
,
pos
);
if
(
written
<
0
||
!
iov_iter_count
(
from
))
goto
out
;
pos
+=
written
;
written_buffered
=
fuse_perform_write
(
file
,
mapping
,
&
i
,
pos
);
written_buffered
=
fuse_perform_write
(
file
,
mapping
,
from
,
pos
);
if
(
written_buffered
<
0
)
{
err
=
written_buffered
;
goto
out
;
...
...
@@ -1255,7 +1250,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
written
+=
written_buffered
;
iocb
->
ki_pos
=
pos
+
written_buffered
;
}
else
{
written
=
fuse_perform_write
(
file
,
mapping
,
&
i
,
pos
);
written
=
fuse_perform_write
(
file
,
mapping
,
from
,
pos
);
if
(
written
>=
0
)
iocb
->
ki_pos
=
pos
+
written
;
}
...
...
@@ -3039,8 +3034,8 @@ static const struct file_operations fuse_file_operations = {
.
llseek
=
fuse_file_llseek
,
.
read
=
new_sync_read
,
.
read_iter
=
fuse_file_read_iter
,
.
write
=
do
_sync_write
,
.
aio_write
=
fuse_file_aio_write
,
.
write
=
new
_sync_write
,
.
write_iter
=
fuse_file_write_iter
,
.
mmap
=
fuse_file_mmap
,
.
open
=
fuse_open
,
.
flush
=
fuse_flush
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录