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
Kirill Smelkov
linux
Commits
37938463
Commit
37938463
authored
Mar 22, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blkdev_aio_read(): switch to generic_file_read_iter(), get rid of iov_shorten()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0c949334
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
fs/block_dev.c
fs/block_dev.c
+6
-3
No files found.
fs/block_dev.c
View file @
37938463
...
@@ -1538,14 +1538,17 @@ static ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
...
@@ -1538,14 +1538,17 @@ static ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
bd_inode
=
file
->
f_mapping
->
host
;
struct
inode
*
bd_inode
=
file
->
f_mapping
->
host
;
loff_t
size
=
i_size_read
(
bd_inode
);
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
);
if
(
pos
>=
size
)
if
(
pos
>=
size
)
return
0
;
return
0
;
size
-=
pos
;
size
-=
pos
;
if
(
size
<
iocb
->
ki_nbytes
)
iov_iter_truncate
(
&
to
,
size
);
nr_segs
=
iov_shorten
((
struct
iovec
*
)
iov
,
nr_segs
,
size
);
return
generic_file_read_iter
(
iocb
,
&
to
);
return
generic_file_aio_read
(
iocb
,
iov
,
nr_segs
,
pos
);
}
}
/*
/*
...
...
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