Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
b30ac0fc
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看板
提交
b30ac0fc
编写于
4月 03, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
btrfs: switch to ->write_iter()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
3ef045c3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
14 deletion
+10
-14
fs/btrfs/file.c
fs/btrfs/file.c
+10
-14
未找到文件。
fs/btrfs/file.c
浏览文件 @
b30ac0fc
...
...
@@ -447,7 +447,7 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages,
write_bytes
-=
copied
;
total_copied
+=
copied
;
/* Return to btrfs_file_
aio_write
to fault page */
/* Return to btrfs_file_
write_iter
to fault page */
if
(
unlikely
(
copied
==
0
))
break
;
...
...
@@ -1708,9 +1708,8 @@ static void update_time_for_write(struct inode *inode)
inode_inc_iversion
(
inode
);
}
static
ssize_t
btrfs_file_aio_write
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
static
ssize_t
btrfs_file_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file_inode
(
file
);
...
...
@@ -1719,15 +1718,12 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
u64
end_pos
;
ssize_t
num_written
=
0
;
ssize_t
err
=
0
;
size_t
count
;
size_t
count
=
iov_iter_count
(
from
)
;
bool
sync
=
(
file
->
f_flags
&
O_DSYNC
)
||
IS_SYNC
(
file
->
f_mapping
->
host
);
struct
iov_iter
i
;
loff_t
pos
=
iocb
->
ki_pos
;
mutex_lock
(
&
inode
->
i_mutex
);
count
=
iov_length
(
iov
,
nr_segs
);
iov_iter_init
(
&
i
,
WRITE
,
iov
,
nr_segs
,
count
);
current
->
backing_dev_info
=
inode
->
i_mapping
->
backing_dev_info
;
err
=
generic_write_checks
(
file
,
&
pos
,
&
count
,
S_ISBLK
(
inode
->
i_mode
));
if
(
err
)
{
...
...
@@ -1740,7 +1736,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb,
goto
out
;
}
iov_iter_truncate
(
&
i
,
count
);
iov_iter_truncate
(
from
,
count
);
err
=
file_remove_suid
(
file
);
if
(
err
)
{
...
...
@@ -1783,9 +1779,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
,
&
i
,
pos
);
num_written
=
__btrfs_direct_write
(
iocb
,
from
,
pos
);
}
else
{
num_written
=
__btrfs_buffered_write
(
file
,
&
i
,
pos
);
num_written
=
__btrfs_buffered_write
(
file
,
from
,
pos
);
if
(
num_written
>
0
)
iocb
->
ki_pos
=
pos
+
num_written
;
}
...
...
@@ -2623,10 +2619,10 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
const
struct
file_operations
btrfs_file_operations
=
{
.
llseek
=
btrfs_file_llseek
,
.
read
=
new_sync_read
,
.
write
=
do
_sync_write
,
.
write
=
new
_sync_write
,
.
read_iter
=
generic_file_read_iter
,
.
splice_read
=
generic_file_splice_read
,
.
aio_write
=
btrfs_file_aio_write
,
.
write_iter
=
btrfs_file_write_iter
,
.
mmap
=
btrfs_file_mmap
,
.
open
=
generic_file_open
,
.
release
=
btrfs_release_file
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录