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
d63d271c
Commit
d63d271c
authored
Sep 20, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smc: switch to sock_recvmsg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7edffd25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
net/smc/smc_clc.c
net/smc/smc_clc.c
+10
-8
No files found.
net/smc/smc_clc.c
View file @
d63d271c
...
@@ -35,7 +35,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
...
@@ -35,7 +35,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
struct
smc_clc_msg_hdr
*
clcm
=
buf
;
struct
smc_clc_msg_hdr
*
clcm
=
buf
;
struct
msghdr
msg
=
{
NULL
,
0
};
struct
msghdr
msg
=
{
NULL
,
0
};
int
reason_code
=
0
;
int
reason_code
=
0
;
struct
kvec
vec
;
struct
kvec
vec
=
{
buf
,
buflen
}
;
int
len
,
datlen
;
int
len
,
datlen
;
int
krflags
;
int
krflags
;
...
@@ -43,12 +43,15 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
...
@@ -43,12 +43,15 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
* so we don't consume any subsequent CLC message or payload data
* so we don't consume any subsequent CLC message or payload data
* in the TCP byte stream
* in the TCP byte stream
*/
*/
vec
.
iov_base
=
buf
;
/*
vec
.
iov_len
=
buflen
;
* Caller must make sure that buflen is no less than
* sizeof(struct smc_clc_msg_hdr)
*/
krflags
=
MSG_PEEK
|
MSG_WAITALL
;
krflags
=
MSG_PEEK
|
MSG_WAITALL
;
smc
->
clcsock
->
sk
->
sk_rcvtimeo
=
CLC_WAIT_TIME
;
smc
->
clcsock
->
sk
->
sk_rcvtimeo
=
CLC_WAIT_TIME
;
len
=
kernel_recvmsg
(
smc
->
clcsock
,
&
msg
,
&
vec
,
1
,
iov_iter_kvec
(
&
msg
.
msg_iter
,
READ
|
ITER_KVEC
,
&
vec
,
1
,
sizeof
(
struct
smc_clc_msg_hdr
),
krflags
);
sizeof
(
struct
smc_clc_msg_hdr
));
len
=
sock_recvmsg
(
smc
->
clcsock
,
&
msg
,
krflags
);
if
(
signal_pending
(
current
))
{
if
(
signal_pending
(
current
))
{
reason_code
=
-
EINTR
;
reason_code
=
-
EINTR
;
clc_sk
->
sk_err
=
EINTR
;
clc_sk
->
sk_err
=
EINTR
;
...
@@ -83,12 +86,11 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
...
@@ -83,12 +86,11 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
}
}
/* receive the complete CLC message */
/* receive the complete CLC message */
vec
.
iov_base
=
buf
;
vec
.
iov_len
=
buflen
;
memset
(
&
msg
,
0
,
sizeof
(
struct
msghdr
));
memset
(
&
msg
,
0
,
sizeof
(
struct
msghdr
));
iov_iter_kvec
(
&
msg
.
msg_iter
,
READ
|
ITER_KVEC
,
&
vec
,
1
,
buflen
);
krflags
=
MSG_WAITALL
;
krflags
=
MSG_WAITALL
;
smc
->
clcsock
->
sk
->
sk_rcvtimeo
=
CLC_WAIT_TIME
;
smc
->
clcsock
->
sk
->
sk_rcvtimeo
=
CLC_WAIT_TIME
;
len
=
kernel_recvmsg
(
smc
->
clcsock
,
&
msg
,
&
vec
,
1
,
datlen
,
krflags
);
len
=
sock_recvmsg
(
smc
->
clcsock
,
&
msg
,
krflags
);
if
(
len
<
datlen
)
{
if
(
len
<
datlen
)
{
smc
->
sk
.
sk_err
=
EPROTO
;
smc
->
sk
.
sk_err
=
EPROTO
;
reason_code
=
-
EPROTO
;
reason_code
=
-
EPROTO
;
...
...
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