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
40a86061
Commit
40a86061
authored
Jul 29, 2022
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of unlikely() on page_copy_sane() calls
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
eb708140
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
lib/iov_iter.c
lib/iov_iter.c
+5
-6
No files found.
lib/iov_iter.c
View file @
40a86061
...
...
@@ -703,17 +703,16 @@ static inline bool page_copy_sane(struct page *page, size_t offset, size_t n)
head
=
compound_head
(
page
);
v
+=
(
page
-
head
)
<<
PAGE_SHIFT
;
if
(
likely
(
n
<=
v
&&
v
<=
(
page_size
(
head
))))
return
true
;
WARN_ON
(
1
);
return
false
;
if
(
WARN_ON
(
n
>
v
||
v
>
page_size
(
head
)))
return
false
;
return
true
;
}
size_t
copy_page_to_iter
(
struct
page
*
page
,
size_t
offset
,
size_t
bytes
,
struct
iov_iter
*
i
)
{
size_t
res
=
0
;
if
(
unlikely
(
!
page_copy_sane
(
page
,
offset
,
bytes
)
))
if
(
!
page_copy_sane
(
page
,
offset
,
bytes
))
return
0
;
if
(
unlikely
(
iov_iter_is_pipe
(
i
)))
return
copy_page_to_iter_pipe
(
page
,
offset
,
bytes
,
i
);
...
...
@@ -808,7 +807,7 @@ size_t copy_page_from_iter_atomic(struct page *page, unsigned offset, size_t byt
struct
iov_iter
*
i
)
{
char
*
kaddr
=
kmap_atomic
(
page
),
*
p
=
kaddr
+
offset
;
if
(
unlikely
(
!
page_copy_sane
(
page
,
offset
,
bytes
)
))
{
if
(
!
page_copy_sane
(
page
,
offset
,
bytes
))
{
kunmap_atomic
(
kaddr
);
return
0
;
}
...
...
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