Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
16b1f05d
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
16b1f05d
编写于
3月 04, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ext4: switch the guts of ->direct_IO() to iov_iter
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
619d30b4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
18 deletion
+15
-18
fs/ext4/ext4.h
fs/ext4/ext4.h
+1
-2
fs/ext4/indirect.c
fs/ext4/indirect.c
+7
-8
fs/ext4/inode.c
fs/ext4/inode.c
+7
-8
未找到文件。
fs/ext4/ext4.h
浏览文件 @
16b1f05d
...
...
@@ -2150,8 +2150,7 @@ extern void ext4_da_update_reserve_space(struct inode *inode,
extern
int
ext4_ind_map_blocks
(
handle_t
*
handle
,
struct
inode
*
inode
,
struct
ext4_map_blocks
*
map
,
int
flags
);
extern
ssize_t
ext4_ind_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
loff_t
offset
,
unsigned
long
nr_segs
);
struct
iov_iter
*
iter
,
loff_t
offset
);
extern
int
ext4_ind_calc_metadata_amount
(
struct
inode
*
inode
,
sector_t
lblock
);
extern
int
ext4_ind_trans_blocks
(
struct
inode
*
inode
,
int
nrblocks
);
extern
void
ext4_ind_truncate
(
handle_t
*
,
struct
inode
*
inode
);
...
...
fs/ext4/indirect.c
浏览文件 @
16b1f05d
...
...
@@ -639,8 +639,7 @@ int ext4_ind_map_blocks(handle_t *handle, struct inode *inode,
* VFS code falls back into buffered path in that case so we are safe.
*/
ssize_t
ext4_ind_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
loff_t
offset
,
unsigned
long
nr_segs
)
struct
iov_iter
*
iter
,
loff_t
offset
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
...
...
@@ -648,7 +647,7 @@ ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
handle_t
*
handle
;
ssize_t
ret
;
int
orphan
=
0
;
size_t
count
=
iov_length
(
i
ov
,
nr_segs
);
size_t
count
=
iov_length
(
i
ter
->
iov
,
iter
->
nr_segs
);
int
retries
=
0
;
if
(
rw
==
WRITE
)
{
...
...
@@ -687,18 +686,18 @@ ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
goto
locked
;
}
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iov
,
offset
,
nr_segs
,
inode
->
i_sb
->
s_bdev
,
i
ter
->
i
ov
,
offset
,
iter
->
nr_segs
,
ext4_get_block
,
NULL
,
NULL
,
0
);
inode_dio_done
(
inode
);
}
else
{
locked:
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iov
,
offset
,
nr_segs
,
ext4_get_block
);
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
i
ter
->
i
ov
,
offset
,
iter
->
nr_segs
,
ext4_get_block
);
if
(
unlikely
((
rw
&
WRITE
)
&&
ret
<
0
))
{
loff_t
isize
=
i_size_read
(
inode
);
loff_t
end
=
offset
+
iov_length
(
iov
,
nr_segs
)
;
loff_t
end
=
offset
+
count
;
if
(
end
>
isize
)
ext4_truncate_failed_write
(
inode
);
...
...
fs/ext4/inode.c
浏览文件 @
16b1f05d
...
...
@@ -3085,13 +3085,12 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
*
*/
static
ssize_t
ext4_ext_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
loff_t
offset
,
unsigned
long
nr_segs
)
struct
iov_iter
*
iter
,
loff_t
offset
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
ssize_t
ret
;
size_t
count
=
iov_length
(
i
ov
,
nr_segs
);
size_t
count
=
iov_length
(
i
ter
->
iov
,
iter
->
nr_segs
);
int
overwrite
=
0
;
get_block_t
*
get_block_func
=
NULL
;
int
dio_flags
=
0
;
...
...
@@ -3100,7 +3099,7 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
/* Use the old path for reads and writes beyond i_size. */
if
(
rw
!=
WRITE
||
final_size
>
inode
->
i_size
)
return
ext4_ind_direct_IO
(
rw
,
iocb
,
i
ov
,
offset
,
nr_segs
);
return
ext4_ind_direct_IO
(
rw
,
iocb
,
i
ter
,
offset
);
BUG_ON
(
iocb
->
private
==
NULL
);
...
...
@@ -3167,8 +3166,8 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
dio_flags
=
DIO_LOCKING
;
}
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iov
,
offset
,
nr_segs
,
inode
->
i_sb
->
s_bdev
,
i
ter
->
i
ov
,
offset
,
iter
->
nr_segs
,
get_block_func
,
ext4_end_io_dio
,
NULL
,
...
...
@@ -3240,9 +3239,9 @@ static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb,
trace_ext4_direct_IO_enter
(
inode
,
offset
,
iov_length
(
iter
->
iov
,
iter
->
nr_segs
),
rw
);
if
(
ext4_test_inode_flag
(
inode
,
EXT4_INODE_EXTENTS
))
ret
=
ext4_ext_direct_IO
(
rw
,
iocb
,
iter
->
iov
,
offset
,
iter
->
nr_segs
);
ret
=
ext4_ext_direct_IO
(
rw
,
iocb
,
iter
,
offset
);
else
ret
=
ext4_ind_direct_IO
(
rw
,
iocb
,
iter
->
iov
,
offset
,
iter
->
nr_segs
);
ret
=
ext4_ind_direct_IO
(
rw
,
iocb
,
iter
,
offset
);
trace_ext4_direct_IO_exit
(
inode
,
offset
,
iov_length
(
iter
->
iov
,
iter
->
nr_segs
),
rw
,
ret
);
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录