Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
6dc8bc0f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
12 个月 前同步成功
通知
152
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6dc8bc0f
编写于
4月 05, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ocfs2: switch to iter_file_splice_write()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8d020765
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
2 addition
and
80 deletion
+2
-80
fs/ocfs2/file.c
fs/ocfs2/file.c
+2
-80
未找到文件。
fs/ocfs2/file.c
浏览文件 @
6dc8bc0f
...
...
@@ -2430,84 +2430,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
return
ret
;
}
static
int
ocfs2_splice_to_file
(
struct
pipe_inode_info
*
pipe
,
struct
file
*
out
,
struct
splice_desc
*
sd
)
{
int
ret
;
ret
=
ocfs2_prepare_inode_for_write
(
out
,
&
sd
->
pos
,
sd
->
total_len
,
0
,
NULL
,
NULL
);
if
(
ret
<
0
)
{
mlog_errno
(
ret
);
return
ret
;
}
return
splice_from_pipe_feed
(
pipe
,
sd
,
pipe_to_file
);
}
static
ssize_t
ocfs2_file_splice_write
(
struct
pipe_inode_info
*
pipe
,
struct
file
*
out
,
loff_t
*
ppos
,
size_t
len
,
unsigned
int
flags
)
{
int
ret
;
struct
address_space
*
mapping
=
out
->
f_mapping
;
struct
inode
*
inode
=
mapping
->
host
;
struct
splice_desc
sd
=
{
.
total_len
=
len
,
.
flags
=
flags
,
.
pos
=
*
ppos
,
.
u
.
file
=
out
,
};
trace_ocfs2_file_splice_write
(
inode
,
out
,
out
->
f_path
.
dentry
,
(
unsigned
long
long
)
OCFS2_I
(
inode
)
->
ip_blkno
,
out
->
f_path
.
dentry
->
d_name
.
len
,
out
->
f_path
.
dentry
->
d_name
.
name
,
len
);
pipe_lock
(
pipe
);
splice_from_pipe_begin
(
&
sd
);
do
{
ret
=
splice_from_pipe_next
(
pipe
,
&
sd
);
if
(
ret
<=
0
)
break
;
mutex_lock_nested
(
&
inode
->
i_mutex
,
I_MUTEX_CHILD
);
ret
=
ocfs2_rw_lock
(
inode
,
1
);
if
(
ret
<
0
)
mlog_errno
(
ret
);
else
{
ret
=
ocfs2_splice_to_file
(
pipe
,
out
,
&
sd
);
ocfs2_rw_unlock
(
inode
,
1
);
}
mutex_unlock
(
&
inode
->
i_mutex
);
}
while
(
ret
>
0
);
splice_from_pipe_end
(
pipe
,
&
sd
);
pipe_unlock
(
pipe
);
if
(
sd
.
num_spliced
)
ret
=
sd
.
num_spliced
;
if
(
ret
>
0
)
{
int
err
;
err
=
generic_write_sync
(
out
,
*
ppos
,
ret
);
if
(
err
)
ret
=
err
;
else
*
ppos
+=
ret
;
balance_dirty_pages_ratelimited
(
mapping
);
}
return
ret
;
}
static
ssize_t
ocfs2_file_splice_read
(
struct
file
*
in
,
loff_t
*
ppos
,
struct
pipe_inode_info
*
pipe
,
...
...
@@ -2708,7 +2630,7 @@ const struct file_operations ocfs2_fops = {
.
lock
=
ocfs2_lock
,
.
flock
=
ocfs2_flock
,
.
splice_read
=
ocfs2_file_splice_read
,
.
splice_write
=
ocfs2
_file_splice_write
,
.
splice_write
=
iter
_file_splice_write
,
.
fallocate
=
ocfs2_fallocate
,
};
...
...
@@ -2755,7 +2677,7 @@ const struct file_operations ocfs2_fops_no_plocks = {
#endif
.
flock
=
ocfs2_flock
,
.
splice_read
=
ocfs2_file_splice_read
,
.
splice_write
=
ocfs2
_file_splice_write
,
.
splice_write
=
iter
_file_splice_write
,
.
fallocate
=
ocfs2_fallocate
,
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录