Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
15316263
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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,发现更多精彩内容 >>
提交
15316263
编写于
3月 30, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fuse: switch fuse_direct_io_file_operations to ->{read,write}_iter()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
cfa86a74
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
17 deletion
+12
-17
fs/fuse/file.c
fs/fuse/file.c
+12
-17
未找到文件。
fs/fuse/file.c
浏览文件 @
15316263
...
...
@@ -1401,14 +1401,10 @@ static ssize_t __fuse_direct_read(struct fuse_io_priv *io,
return
res
;
}
static
ssize_t
fuse_direct_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
fuse_direct_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
struct
fuse_io_priv
io
=
{
.
async
=
0
,
.
file
=
file
};
struct
iovec
iov
=
{
.
iov_base
=
buf
,
.
iov_len
=
count
};
struct
iov_iter
ii
;
iov_iter_init
(
&
ii
,
READ
,
&
iov
,
1
,
count
);
return
__fuse_direct_read
(
&
io
,
&
ii
,
ppos
);
struct
fuse_io_priv
io
=
{
.
async
=
0
,
.
file
=
iocb
->
ki_filp
};
return
__fuse_direct_read
(
&
io
,
to
,
&
iocb
->
ki_pos
);
}
static
ssize_t
__fuse_direct_write
(
struct
fuse_io_priv
*
io
,
...
...
@@ -1432,24 +1428,21 @@ static ssize_t __fuse_direct_write(struct fuse_io_priv *io,
return
res
;
}
static
ssize_t
fuse_direct_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
fuse_direct_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
struct
iovec
iov
=
{
.
iov_base
=
(
void
__user
*
)
buf
,
.
iov_len
=
count
}
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file_inode
(
file
);
ssize_t
res
;
struct
fuse_io_priv
io
=
{
.
async
=
0
,
.
file
=
file
};
struct
iov_iter
ii
;
iov_iter_init
(
&
ii
,
WRITE
,
&
iov
,
1
,
count
);
ssize_t
res
;
if
(
is_bad_inode
(
inode
))
return
-
EIO
;
/* Don't allow parallel writes to the same file */
mutex_lock
(
&
inode
->
i_mutex
);
res
=
__fuse_direct_write
(
&
io
,
&
ii
,
p
pos
);
res
=
__fuse_direct_write
(
&
io
,
from
,
&
iocb
->
ki_
pos
);
if
(
res
>
0
)
fuse_write_update_size
(
inode
,
*
p
pos
);
fuse_write_update_size
(
inode
,
iocb
->
ki_
pos
);
mutex_unlock
(
&
inode
->
i_mutex
);
return
res
;
...
...
@@ -2988,8 +2981,10 @@ static const struct file_operations fuse_file_operations = {
static
const
struct
file_operations
fuse_direct_io_file_operations
=
{
.
llseek
=
fuse_file_llseek
,
.
read
=
fuse_direct_read
,
.
write
=
fuse_direct_write
,
.
read
=
new_sync_read
,
.
read_iter
=
fuse_direct_read_iter
,
.
write
=
new_sync_write
,
.
write_iter
=
fuse_direct_write_iter
,
.
mmap
=
fuse_direct_mmap
,
.
open
=
fuse_open
,
.
flush
=
fuse_flush
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录