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
61ff6e9b
Commit
61ff6e9b
authored
Jan 09, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph_tcp_sendpage(): use ITER_BVEC sendmsg
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
39c6acea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
net/ceph/messenger.c
net/ceph/messenger.c
+15
-5
No files found.
net/ceph/messenger.c
View file @
61ff6e9b
...
...
@@ -583,18 +583,28 @@ static int __ceph_tcp_sendpage(struct socket *sock, struct page *page,
static
int
ceph_tcp_sendpage
(
struct
socket
*
sock
,
struct
page
*
page
,
int
offset
,
size_t
size
,
bool
more
)
{
struct
msghdr
msg
=
{
.
msg_flags
=
MSG_DONTWAIT
|
MSG_NOSIGNAL
};
struct
bio_vec
bvec
;
int
ret
;
struct
kvec
iov
;
/* sendpage cannot properly handle pages with page_count == 0,
* we need to fallback to sendmsg if that's the case */
if
(
page_count
(
page
)
>=
1
)
return
__ceph_tcp_sendpage
(
sock
,
page
,
offset
,
size
,
more
);
iov
.
iov_base
=
kmap
(
page
)
+
offset
;
iov
.
iov_len
=
size
;
ret
=
ceph_tcp_sendmsg
(
sock
,
&
iov
,
1
,
size
,
more
);
kunmap
(
page
);
bvec
.
bv_page
=
page
;
bvec
.
bv_offset
=
offset
;
bvec
.
bv_len
=
size
;
if
(
more
)
msg
.
msg_flags
|=
MSG_MORE
;
else
msg
.
msg_flags
|=
MSG_EOR
;
/* superfluous, but what the hell */
iov_iter_bvec
(
&
msg
.
msg_iter
,
WRITE
|
ITER_BVEC
,
&
bvec
,
1
,
size
);
ret
=
sock_sendmsg
(
sock
,
&
msg
);
if
(
ret
==
-
EAGAIN
)
ret
=
0
;
return
ret
;
}
...
...
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