Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a886038b
Commit
a886038b
authored
Apr 02, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/block_dev.c: switch to ->read_iter()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
2ba5bbed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
fs/block_dev.c
fs/block_dev.c
+6
-10
No files found.
fs/block_dev.c
View file @
a886038b
...
...
@@ -1532,23 +1532,19 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
EXPORT_SYMBOL_GPL
(
blkdev_aio_write
);
static
ssize_t
blkdev_aio_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
static
ssize_t
blkdev_read_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
bd_inode
=
file
->
f_mapping
->
host
;
loff_t
size
=
i_size_read
(
bd_inode
);
size_t
count
=
iocb
->
ki_nbytes
;
struct
iov_iter
to
;
iov_iter_init
(
&
to
,
READ
,
iov
,
nr_segs
,
count
);
loff_t
pos
=
iocb
->
ki_pos
;
if
(
pos
>=
size
)
return
0
;
size
-=
pos
;
iov_iter_truncate
(
&
to
,
size
);
return
generic_file_read_iter
(
iocb
,
&
to
);
iov_iter_truncate
(
to
,
size
);
return
generic_file_read_iter
(
iocb
,
to
);
}
/*
...
...
@@ -1580,9 +1576,9 @@ const struct file_operations def_blk_fops = {
.
open
=
blkdev_open
,
.
release
=
blkdev_close
,
.
llseek
=
block_llseek
,
.
read
=
do
_sync_read
,
.
read
=
new
_sync_read
,
.
write
=
do_sync_write
,
.
aio_read
=
blkdev_aio_read
,
.
read_iter
=
blkdev_read_iter
,
.
aio_write
=
blkdev_aio_write
,
.
mmap
=
generic_file_mmap
,
.
fsync
=
blkdev_fsync
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment