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
fb9096a3
Commit
fb9096a3
authored
Apr 02, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pipe: switch to ->read_iter()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e6a7bcb4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
fs/pipe.c
fs/pipe.c
+5
-11
No files found.
fs/pipe.c
View file @
fb9096a3
...
...
@@ -271,24 +271,18 @@ static const struct pipe_buf_operations packet_pipe_buf_ops = {
};
static
ssize_t
pipe_read
(
struct
kiocb
*
iocb
,
const
struct
iovec
*
_iov
,
unsigned
long
nr_segs
,
loff_t
pos
)
pipe_read
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
to
)
{
size_t
total_len
=
iov_iter_count
(
to
);
struct
file
*
filp
=
iocb
->
ki_filp
;
struct
pipe_inode_info
*
pipe
=
filp
->
private_data
;
int
do_wakeup
;
ssize_t
ret
;
struct
iovec
*
iov
=
(
struct
iovec
*
)
_iov
;
size_t
total_len
;
struct
iov_iter
iter
;
total_len
=
iov_length
(
iov
,
nr_segs
);
/* Null read succeeds. */
if
(
unlikely
(
total_len
==
0
))
return
0
;
iov_iter_init
(
&
iter
,
READ
,
iov
,
nr_segs
,
total_len
);
do_wakeup
=
0
;
ret
=
0
;
__pipe_lock
(
pipe
);
...
...
@@ -312,7 +306,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
break
;
}
written
=
copy_page_to_iter
(
buf
->
page
,
buf
->
offset
,
chars
,
&
iter
);
written
=
copy_page_to_iter
(
buf
->
page
,
buf
->
offset
,
chars
,
to
);
if
(
unlikely
(
written
<
chars
))
{
if
(
!
ret
)
ret
=
-
EFAULT
;
...
...
@@ -1044,8 +1038,8 @@ static int fifo_open(struct inode *inode, struct file *filp)
const
struct
file_operations
pipefifo_fops
=
{
.
open
=
fifo_open
,
.
llseek
=
no_llseek
,
.
read
=
do
_sync_read
,
.
aio_read
=
pipe_read
,
.
read
=
new
_sync_read
,
.
read_iter
=
pipe_read
,
.
write
=
do_sync_write
,
.
aio_write
=
pipe_write
,
.
poll
=
pipe_poll
,
...
...
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