Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
0ae5e4d3
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看板
提交
0ae5e4d3
编写于
3月 03, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
__btrfs_direct_write(): switch to iov_iter
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
f8579f86
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
8 addition
and
11 deletion
+8
-11
fs/btrfs/file.c
fs/btrfs/file.c
+8
-11
未找到文件。
fs/btrfs/file.c
浏览文件 @
0ae5e4d3
...
...
@@ -1658,25 +1658,23 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
}
static
ssize_t
__btrfs_direct_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
,
struct
iov_iter
*
from
,
loff_t
pos
,
size_t
count
,
size_t
ocount
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
iov_iter
i
;
ssize_t
written
;
ssize_t
written_buffered
;
loff_t
endbyte
;
int
err
;
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
count
,
0
);
written
=
generic_file_direct_write
(
iocb
,
&
i
,
pos
,
count
,
ocount
);
written
=
generic_file_direct_write
(
iocb
,
from
,
pos
,
count
,
ocount
);
if
(
written
<
0
||
written
==
count
)
return
written
;
pos
+=
written
;
written_buffered
=
__btrfs_buffered_write
(
file
,
&
i
,
pos
);
written_buffered
=
__btrfs_buffered_write
(
file
,
from
,
pos
);
if
(
written_buffered
<
0
)
{
err
=
written_buffered
;
goto
out
;
...
...
@@ -1724,6 +1722,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
ssize_t
err
=
0
;
size_t
count
,
ocount
;
bool
sync
=
(
file
->
f_flags
&
O_DSYNC
)
||
IS_SYNC
(
file
->
f_mapping
->
host
);
struct
iov_iter
i
;
mutex_lock
(
&
inode
->
i_mutex
);
...
...
@@ -1746,6 +1745,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
goto
out
;
}
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
count
,
0
);
err
=
file_remove_suid
(
file
);
if
(
err
)
{
mutex_unlock
(
&
inode
->
i_mutex
);
...
...
@@ -1787,13 +1788,9 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
atomic_inc
(
&
BTRFS_I
(
inode
)
->
sync_writers
);
if
(
unlikely
(
file
->
f_flags
&
O_DIRECT
))
{
num_written
=
__btrfs_direct_write
(
iocb
,
iov
,
nr_segs
,
num_written
=
__btrfs_direct_write
(
iocb
,
&
i
,
pos
,
count
,
ocount
);
}
else
{
struct
iov_iter
i
;
iov_iter_init
(
&
i
,
iov
,
nr_segs
,
count
,
num_written
);
num_written
=
__btrfs_buffered_write
(
file
,
&
i
,
pos
);
if
(
num_written
>
0
)
iocb
->
ki_pos
=
pos
+
num_written
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录