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
3995d161
Commit
3995d161
authored
Dec 21, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usbip_recv(): switch to sock_recvmsg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4113e47b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
21 deletions
+11
-21
drivers/usb/usbip/usbip_common.c
drivers/usb/usbip/usbip_common.c
+11
-21
No files found.
drivers/usb/usbip/usbip_common.c
View file @
3995d161
...
...
@@ -327,13 +327,11 @@ EXPORT_SYMBOL_GPL(usbip_dump_header);
int
usbip_recv
(
struct
socket
*
sock
,
void
*
buf
,
int
size
)
{
int
result
;
struct
msghdr
msg
;
struct
kvec
iov
;
struct
kvec
iov
=
{.
iov_base
=
buf
,
.
iov_len
=
size
}
;
struct
msghdr
msg
=
{.
msg_flags
=
MSG_NOSIGNAL
}
;
int
total
=
0
;
/* for blocks of if (usbip_dbg_flag_xmit) */
char
*
bp
=
buf
;
int
osize
=
size
;
iov_iter_kvec
(
&
msg
.
msg_iter
,
READ
|
ITER_KVEC
,
&
iov
,
1
,
size
);
usbip_dbg_xmit
(
"enter
\n
"
);
...
...
@@ -344,26 +342,18 @@ int usbip_recv(struct socket *sock, void *buf, int size)
}
do
{
int
sz
=
msg_data_left
(
&
msg
);
sock
->
sk
->
sk_allocation
=
GFP_NOIO
;
iov
.
iov_base
=
buf
;
iov
.
iov_len
=
size
;
msg
.
msg_name
=
NULL
;
msg
.
msg_namelen
=
0
;
msg
.
msg_control
=
NULL
;
msg
.
msg_controllen
=
0
;
msg
.
msg_flags
=
MSG_NOSIGNAL
;
result
=
kernel_recvmsg
(
sock
,
&
msg
,
&
iov
,
1
,
size
,
MSG_WAITALL
);
result
=
sock_recvmsg
(
sock
,
&
msg
,
MSG_WAITALL
);
if
(
result
<=
0
)
{
pr_debug
(
"receive sock %p buf %p size %u ret %d total %d
\n
"
,
sock
,
buf
,
size
,
result
,
total
);
sock
,
buf
+
total
,
sz
,
result
,
total
);
goto
err
;
}
size
-=
result
;
buf
+=
result
;
total
+=
result
;
}
while
(
size
>
0
);
}
while
(
msg_data_left
(
&
msg
)
);
if
(
usbip_dbg_flag_xmit
)
{
if
(
!
in_interrupt
())
...
...
@@ -372,9 +362,9 @@ int usbip_recv(struct socket *sock, void *buf, int size)
pr_debug
(
"interrupt :"
);
pr_debug
(
"receiving....
\n
"
);
usbip_dump_buffer
(
b
p
,
o
size
);
pr_debug
(
"received, osize %d ret %d size %d total %d
\n
"
,
osize
,
result
,
size
,
total
);
usbip_dump_buffer
(
b
uf
,
size
);
pr_debug
(
"received, osize %d ret %d size %
z
d total %d
\n
"
,
size
,
result
,
msg_data_left
(
&
msg
)
,
total
);
}
return
total
;
...
...
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