Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
31b14039
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
31b14039
编写于
3月 05, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch {__,}blockdev_direct_IO() to iov_iter
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
a6cbcd4a
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
49 addition
and
60 deletion
+49
-60
fs/block_dev.c
fs/block_dev.c
+2
-2
fs/btrfs/inode.c
fs/btrfs/inode.c
+1
-2
fs/direct-io.c
fs/direct-io.c
+16
-17
fs/ext2/inode.c
fs/ext2/inode.c
+1
-2
fs/ext3/inode.c
fs/ext3/inode.c
+1
-2
fs/ext4/indirect.c
fs/ext4/indirect.c
+3
-4
fs/ext4/inode.c
fs/ext4/inode.c
+2
-2
fs/f2fs/data.c
fs/f2fs/data.c
+2
-2
fs/fat/inode.c
fs/fat/inode.c
+1
-2
fs/gfs2/aops.c
fs/gfs2/aops.c
+1
-1
fs/hfs/inode.c
fs/hfs/inode.c
+1
-2
fs/hfsplus/inode.c
fs/hfsplus/inode.c
+1
-1
fs/jfs/inode.c
fs/jfs/inode.c
+1
-2
fs/nilfs2/inode.c
fs/nilfs2/inode.c
+2
-2
fs/ocfs2/aops.c
fs/ocfs2/aops.c
+1
-1
fs/reiserfs/inode.c
fs/reiserfs/inode.c
+2
-2
fs/udf/inode.c
fs/udf/inode.c
+1
-2
fs/xfs/xfs_aops.c
fs/xfs/xfs_aops.c
+4
-6
include/linux/fs.h
include/linux/fs.h
+6
-6
未找到文件。
fs/block_dev.c
浏览文件 @
31b14039
...
@@ -171,8 +171,8 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
...
@@ -171,8 +171,8 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
struct
inode
*
inode
=
file
->
f_mapping
->
host
;
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
I_BDEV
(
inode
),
iter
->
iov
,
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
I_BDEV
(
inode
),
iter
,
offset
,
iter
->
nr_segs
,
blkdev_get_block
,
offset
,
blkdev_get_block
,
NULL
,
NULL
,
0
);
NULL
,
NULL
,
0
);
}
}
...
...
fs/btrfs/inode.c
浏览文件 @
31b14039
...
@@ -7483,8 +7483,7 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
...
@@ -7483,8 +7483,7 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
BTRFS_I
(
inode
)
->
root
->
fs_info
->
fs_devices
->
latest_bdev
,
BTRFS_I
(
inode
)
->
root
->
fs_info
->
fs_devices
->
latest_bdev
,
iter
->
iov
,
offset
,
iter
->
nr_segs
,
iter
,
offset
,
btrfs_get_blocks_direct
,
NULL
,
btrfs_get_blocks_direct
,
NULL
,
btrfs_submit_direct
,
flags
);
btrfs_submit_direct
,
flags
);
if
(
rw
&
WRITE
)
{
if
(
rw
&
WRITE
)
{
if
(
ret
<
0
&&
ret
!=
-
EIOCBQUEUED
)
if
(
ret
<
0
&&
ret
!=
-
EIOCBQUEUED
)
...
...
fs/direct-io.c
浏览文件 @
31b14039
...
@@ -1107,8 +1107,8 @@ static inline int drop_refcount(struct dio *dio)
...
@@ -1107,8 +1107,8 @@ static inline int drop_refcount(struct dio *dio)
*/
*/
static
inline
ssize_t
static
inline
ssize_t
do_blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
do_blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
struct
block_device
*
bdev
,
const
struct
iovec
*
iov
,
loff_t
offset
,
struct
block_device
*
bdev
,
struct
iov_iter
*
iter
,
loff_t
offset
,
unsigned
long
nr_segs
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
dio_submit_t
submit_io
,
int
flags
)
dio_submit_t
submit_io
,
int
flags
)
{
{
int
seg
;
int
seg
;
...
@@ -1143,9 +1143,9 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
...
@@ -1143,9 +1143,9 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
}
}
/* Check the memory alignment. Blocks cannot straddle pages */
/* Check the memory alignment. Blocks cannot straddle pages */
for
(
seg
=
0
;
seg
<
nr_segs
;
seg
++
)
{
for
(
seg
=
0
;
seg
<
iter
->
nr_segs
;
seg
++
)
{
addr
=
(
unsigned
long
)
iov
[
seg
].
iov_base
;
addr
=
(
unsigned
long
)
i
ter
->
i
ov
[
seg
].
iov_base
;
size
=
iov
[
seg
].
iov_len
;
size
=
i
ter
->
i
ov
[
seg
].
iov_len
;
end
+=
size
;
end
+=
size
;
if
(
unlikely
((
addr
&
blocksize_mask
)
||
if
(
unlikely
((
addr
&
blocksize_mask
)
||
(
size
&
blocksize_mask
)))
{
(
size
&
blocksize_mask
)))
{
...
@@ -1256,18 +1256,18 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
...
@@ -1256,18 +1256,18 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
if
(
unlikely
(
sdio
.
blkfactor
))
if
(
unlikely
(
sdio
.
blkfactor
))
sdio
.
pages_in_io
=
2
;
sdio
.
pages_in_io
=
2
;
for
(
seg
=
0
;
seg
<
nr_segs
;
seg
++
)
{
for
(
seg
=
0
;
seg
<
iter
->
nr_segs
;
seg
++
)
{
user_addr
=
(
unsigned
long
)
iov
[
seg
].
iov_base
;
user_addr
=
(
unsigned
long
)
i
ter
->
i
ov
[
seg
].
iov_base
;
sdio
.
pages_in_io
+=
sdio
.
pages_in_io
+=
((
user_addr
+
iov
[
seg
].
iov_len
+
PAGE_SIZE
-
1
)
/
((
user_addr
+
i
ter
->
i
ov
[
seg
].
iov_len
+
PAGE_SIZE
-
1
)
/
PAGE_SIZE
-
user_addr
/
PAGE_SIZE
);
PAGE_SIZE
-
user_addr
/
PAGE_SIZE
);
}
}
blk_start_plug
(
&
plug
);
blk_start_plug
(
&
plug
);
for
(
seg
=
0
;
seg
<
nr_segs
;
seg
++
)
{
for
(
seg
=
0
;
seg
<
iter
->
nr_segs
;
seg
++
)
{
user_addr
=
(
unsigned
long
)
iov
[
seg
].
iov_base
;
user_addr
=
(
unsigned
long
)
i
ter
->
i
ov
[
seg
].
iov_base
;
sdio
.
size
+=
bytes
=
iov
[
seg
].
iov_len
;
sdio
.
size
+=
bytes
=
i
ter
->
i
ov
[
seg
].
iov_len
;
/* Index into the first page of the first block */
/* Index into the first page of the first block */
sdio
.
first_block_in_page
=
(
user_addr
&
~
PAGE_MASK
)
>>
blkbits
;
sdio
.
first_block_in_page
=
(
user_addr
&
~
PAGE_MASK
)
>>
blkbits
;
...
@@ -1288,7 +1288,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
...
@@ -1288,7 +1288,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
retval
=
do_direct_IO
(
dio
,
&
sdio
,
&
map_bh
);
retval
=
do_direct_IO
(
dio
,
&
sdio
,
&
map_bh
);
dio
->
result
+=
iov
[
seg
].
iov_len
-
dio
->
result
+=
i
ter
->
i
ov
[
seg
].
iov_len
-
((
sdio
.
final_block_in_request
-
sdio
.
block_in_file
)
<<
((
sdio
.
final_block_in_request
-
sdio
.
block_in_file
)
<<
blkbits
);
blkbits
);
...
@@ -1365,8 +1365,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
...
@@ -1365,8 +1365,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
ssize_t
ssize_t
__blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
__blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
struct
block_device
*
bdev
,
const
struct
iovec
*
iov
,
loff_t
offset
,
struct
block_device
*
bdev
,
struct
iov_iter
*
iter
,
loff_t
offset
,
unsigned
long
nr_segs
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
dio_submit_t
submit_io
,
int
flags
)
dio_submit_t
submit_io
,
int
flags
)
{
{
/*
/*
...
@@ -1381,9 +1381,8 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
...
@@ -1381,9 +1381,8 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
prefetch
(
bdev
->
bd_queue
);
prefetch
(
bdev
->
bd_queue
);
prefetch
((
char
*
)
bdev
->
bd_queue
+
SMP_CACHE_BYTES
);
prefetch
((
char
*
)
bdev
->
bd_queue
+
SMP_CACHE_BYTES
);
return
do_blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iov
,
offset
,
return
do_blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iter
,
offset
,
nr_segs
,
get_block
,
end_io
,
get_block
,
end_io
,
submit_io
,
flags
);
submit_io
,
flags
);
}
}
EXPORT_SYMBOL
(
__blockdev_direct_IO
);
EXPORT_SYMBOL
(
__blockdev_direct_IO
);
...
...
fs/ext2/inode.c
浏览文件 @
31b14039
...
@@ -859,8 +859,7 @@ ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
...
@@ -859,8 +859,7 @@ ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
ext2_get_block
);
iter
->
nr_segs
,
ext2_get_block
);
if
(
ret
<
0
&&
(
rw
&
WRITE
))
if
(
ret
<
0
&&
(
rw
&
WRITE
))
ext2_write_failed
(
mapping
,
offset
+
count
);
ext2_write_failed
(
mapping
,
offset
+
count
);
return
ret
;
return
ret
;
...
...
fs/ext3/inode.c
浏览文件 @
31b14039
...
@@ -1855,8 +1855,7 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
...
@@ -1855,8 +1855,7 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
}
}
retry:
retry:
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
ext3_get_block
);
iter
->
nr_segs
,
ext3_get_block
);
/*
/*
* In case of error extending write may have instantiated a few
* In case of error extending write may have instantiated a few
* blocks outside i_size. Trim these off again.
* blocks outside i_size. Trim these off again.
...
...
fs/ext4/indirect.c
浏览文件 @
31b14039
...
@@ -686,14 +686,13 @@ ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
...
@@ -686,14 +686,13 @@ ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb,
goto
locked
;
goto
locked
;
}
}
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iter
->
iov
,
inode
->
i_sb
->
s_bdev
,
iter
,
offset
,
offset
,
iter
->
nr_segs
,
ext4_get_block
,
NULL
,
NULL
,
0
);
ext4_get_block
,
NULL
,
NULL
,
0
);
inode_dio_done
(
inode
);
inode_dio_done
(
inode
);
}
else
{
}
else
{
locked:
locked:
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
iter
->
nr_segs
,
ext4_get_block
);
offset
,
ext4_get_block
);
if
(
unlikely
((
rw
&
WRITE
)
&&
ret
<
0
))
{
if
(
unlikely
((
rw
&
WRITE
)
&&
ret
<
0
))
{
loff_t
isize
=
i_size_read
(
inode
);
loff_t
isize
=
i_size_read
(
inode
);
...
...
fs/ext4/inode.c
浏览文件 @
31b14039
...
@@ -3166,8 +3166,8 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
...
@@ -3166,8 +3166,8 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
dio_flags
=
DIO_LOCKING
;
dio_flags
=
DIO_LOCKING
;
}
}
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iter
->
iov
,
inode
->
i_sb
->
s_bdev
,
iter
,
offset
,
iter
->
nr_segs
,
offset
,
get_block_func
,
get_block_func
,
ext4_end_io_dio
,
ext4_end_io_dio
,
NULL
,
NULL
,
...
...
fs/f2fs/data.c
浏览文件 @
31b14039
...
@@ -1022,8 +1022,8 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
...
@@ -1022,8 +1022,8 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
if
(
check_direct_IO
(
inode
,
rw
,
iter
->
iov
,
offset
,
iter
->
nr_segs
))
if
(
check_direct_IO
(
inode
,
rw
,
iter
->
iov
,
offset
,
iter
->
nr_segs
))
return
0
;
return
0
;
return
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
return
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
iter
->
nr_segs
,
get_data_block
);
get_data_block
);
}
}
static
void
f2fs_invalidate_data_page
(
struct
page
*
page
,
unsigned
int
offset
,
static
void
f2fs_invalidate_data_page
(
struct
page
*
page
,
unsigned
int
offset
,
...
...
fs/fat/inode.c
浏览文件 @
31b14039
...
@@ -213,8 +213,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
...
@@ -213,8 +213,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
* FAT need to use the DIO_LOCKING for avoiding the race
* FAT need to use the DIO_LOCKING for avoiding the race
* condition of fat_get_block() and ->truncate().
* condition of fat_get_block() and ->truncate().
*/
*/
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
fat_get_block
);
iter
->
nr_segs
,
fat_get_block
);
if
(
ret
<
0
&&
(
rw
&
WRITE
))
if
(
ret
<
0
&&
(
rw
&
WRITE
))
fat_write_failed
(
mapping
,
offset
+
count
);
fat_write_failed
(
mapping
,
offset
+
count
);
...
...
fs/gfs2/aops.c
浏览文件 @
31b14039
...
@@ -1097,7 +1097,7 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
...
@@ -1097,7 +1097,7 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
}
}
rv
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
rv
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iter
->
iov
,
offset
,
iter
->
nr_segs
,
iter
,
offset
,
gfs2_get_block_direct
,
NULL
,
NULL
,
0
);
gfs2_get_block_direct
,
NULL
,
NULL
,
0
);
out:
out:
gfs2_glock_dq
(
&
gh
);
gfs2_glock_dq
(
&
gh
);
...
...
fs/hfs/inode.c
浏览文件 @
31b14039
...
@@ -133,8 +133,7 @@ static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb,
...
@@ -133,8 +133,7 @@ static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
hfs_get_block
);
iter
->
nr_segs
,
hfs_get_block
);
/*
/*
* In case of error extending write may have instantiated a few
* In case of error extending write may have instantiated a few
...
...
fs/hfsplus/inode.c
浏览文件 @
31b14039
...
@@ -131,7 +131,7 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb,
...
@@ -131,7 +131,7 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
iter
->
nr_segs
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
hfsplus_get_block
);
hfsplus_get_block
);
/*
/*
...
...
fs/jfs/inode.c
浏览文件 @
31b14039
...
@@ -339,8 +339,7 @@ static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
...
@@ -339,8 +339,7 @@ static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
jfs_get_block
);
iter
->
nr_segs
,
jfs_get_block
);
/*
/*
* In case of error extending write may have instantiated a few
* In case of error extending write may have instantiated a few
...
...
fs/nilfs2/inode.c
浏览文件 @
31b14039
...
@@ -311,8 +311,8 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
...
@@ -311,8 +311,8 @@ nilfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
return
0
;
return
0
;
/* Needs synchronization with the cleaner */
/* Needs synchronization with the cleaner */
size
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
size
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
iter
->
nr_segs
,
nilfs_get_block
);
nilfs_get_block
);
/*
/*
* In case of error extending write may have instantiated a few
* In case of error extending write may have instantiated a few
...
...
fs/ocfs2/aops.c
浏览文件 @
31b14039
...
@@ -617,7 +617,7 @@ static ssize_t ocfs2_direct_IO(int rw,
...
@@ -617,7 +617,7 @@ static ssize_t ocfs2_direct_IO(int rw,
return
0
;
return
0
;
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
iter
->
iov
,
offset
,
iter
->
nr_segs
,
iter
,
offset
,
ocfs2_direct_IO_get_blocks
,
ocfs2_direct_IO_get_blocks
,
ocfs2_dio_end_io
,
NULL
,
0
);
ocfs2_dio_end_io
,
NULL
,
0
);
}
}
...
...
fs/reiserfs/inode.c
浏览文件 @
31b14039
...
@@ -3090,8 +3090,8 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
...
@@ -3090,8 +3090,8 @@ static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
iter
->
nr_segs
,
reiserfs_get_blocks_direct_io
);
reiserfs_get_blocks_direct_io
);
/*
/*
* In case of error extending write may have instantiated a few
* In case of error extending write may have instantiated a few
...
...
fs/udf/inode.c
浏览文件 @
31b14039
...
@@ -226,8 +226,7 @@ static ssize_t udf_direct_IO(int rw, struct kiocb *iocb,
...
@@ -226,8 +226,7 @@ static ssize_t udf_direct_IO(int rw, struct kiocb *iocb,
size_t
count
=
iov_iter_count
(
iter
);
size_t
count
=
iov_iter_count
(
iter
);
ssize_t
ret
;
ssize_t
ret
;
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
->
iov
,
offset
,
iter
->
nr_segs
,
ret
=
blockdev_direct_IO
(
rw
,
iocb
,
inode
,
iter
,
offset
,
udf_get_block
);
udf_get_block
);
if
(
unlikely
(
ret
<
0
&&
(
rw
&
WRITE
)))
if
(
unlikely
(
ret
<
0
&&
(
rw
&
WRITE
)))
udf_write_failed
(
mapping
,
offset
+
count
);
udf_write_failed
(
mapping
,
offset
+
count
);
return
ret
;
return
ret
;
...
...
fs/xfs/xfs_aops.c
浏览文件 @
31b14039
...
@@ -1470,17 +1470,15 @@ xfs_vm_direct_IO(
...
@@ -1470,17 +1470,15 @@ xfs_vm_direct_IO(
if
(
offset
+
size
>
XFS_I
(
inode
)
->
i_d
.
di_size
)
if
(
offset
+
size
>
XFS_I
(
inode
)
->
i_d
.
di_size
)
ioend
->
io_isdirect
=
1
;
ioend
->
io_isdirect
=
1
;
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iter
->
iov
,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iter
,
offset
,
iter
->
nr_segs
,
offset
,
xfs_get_blocks_direct
,
xfs_get_blocks_direct
,
xfs_end_io_direct_write
,
NULL
,
xfs_end_io_direct_write
,
NULL
,
DIO_ASYNC_EXTEND
);
DIO_ASYNC_EXTEND
);
if
(
ret
!=
-
EIOCBQUEUED
&&
iocb
->
private
)
if
(
ret
!=
-
EIOCBQUEUED
&&
iocb
->
private
)
goto
out_destroy_ioend
;
goto
out_destroy_ioend
;
}
else
{
}
else
{
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iter
->
iov
,
ret
=
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
bdev
,
iter
,
offset
,
iter
->
nr_segs
,
offset
,
xfs_get_blocks_direct
,
xfs_get_blocks_direct
,
NULL
,
NULL
,
0
);
NULL
,
NULL
,
0
);
}
}
...
...
include/linux/fs.h
浏览文件 @
31b14039
...
@@ -2474,16 +2474,16 @@ enum {
...
@@ -2474,16 +2474,16 @@ enum {
void
dio_end_io
(
struct
bio
*
bio
,
int
error
);
void
dio_end_io
(
struct
bio
*
bio
,
int
error
);
ssize_t
__blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
ssize_t
__blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
struct
block_device
*
bdev
,
const
struct
iovec
*
iov
,
loff_t
offset
,
struct
block_device
*
bdev
,
struct
iov_iter
*
iter
,
loff_t
offset
,
unsigned
long
nr_segs
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
get_block_t
get_block
,
dio_iodone_t
end_io
,
dio_submit_t
submit_io
,
int
flags
);
dio_submit_t
submit_io
,
int
flags
);
static
inline
ssize_t
blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
static
inline
ssize_t
blockdev_direct_IO
(
int
rw
,
struct
kiocb
*
iocb
,
struct
inode
*
inode
,
const
struct
iovec
*
iov
,
loff_t
offset
,
struct
inode
*
inode
,
struct
iov_iter
*
iter
,
loff_t
offset
,
unsigned
long
nr_segs
,
get_block_t
get_block
)
get_block_t
get_block
)
{
{
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
i
ov
,
return
__blockdev_direct_IO
(
rw
,
iocb
,
inode
,
inode
->
i_sb
->
s_bdev
,
i
ter
,
offset
,
nr_segs
,
get_block
,
NULL
,
NULL
,
offset
,
get_block
,
NULL
,
NULL
,
DIO_LOCKING
|
DIO_SKIP_HOLES
);
DIO_LOCKING
|
DIO_SKIP_HOLES
);
}
}
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录