Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
d366d398
Commit
d366d398
authored
Jun 01, 2007
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
splice: move inode size check into generic_file_splice_read()
Signed-off-by:
Jens Axboe
<
jens.axboe@oracle.com
>
parent
85f6038f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
fs/splice.c
fs/splice.c
+9
-10
No files found.
fs/splice.c
View file @
d366d398
...
...
@@ -478,10 +478,18 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
{
ssize_t
spliced
;
int
ret
;
loff_t
isize
,
left
;
isize
=
i_size_read
(
in
->
f_mapping
->
host
);
if
(
unlikely
(
*
ppos
>=
isize
))
return
0
;
left
=
isize
-
*
ppos
;
if
(
unlikely
(
left
<
len
))
len
=
left
;
ret
=
0
;
spliced
=
0
;
while
(
len
)
{
ret
=
__generic_file_splice_read
(
in
,
ppos
,
pipe
,
len
,
flags
);
...
...
@@ -922,7 +930,6 @@ static long do_splice_to(struct file *in, loff_t *ppos,
struct
pipe_inode_info
*
pipe
,
size_t
len
,
unsigned
int
flags
)
{
loff_t
isize
,
left
;
int
ret
;
if
(
unlikely
(
!
in
->
f_op
||
!
in
->
f_op
->
splice_read
))
...
...
@@ -935,14 +942,6 @@ static long do_splice_to(struct file *in, loff_t *ppos,
if
(
unlikely
(
ret
<
0
))
return
ret
;
isize
=
i_size_read
(
in
->
f_mapping
->
host
);
if
(
unlikely
(
*
ppos
>=
isize
))
return
0
;
left
=
isize
-
*
ppos
;
if
(
unlikely
(
left
<
len
))
len
=
left
;
return
in
->
f_op
->
splice_read
(
in
,
ppos
,
pipe
,
len
,
flags
);
}
...
...
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