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
7eab8d9e
Commit
7eab8d9e
authored
Apr 06, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new helper: memcpy_to_msg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e1693718
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
9 deletions
+13
-9
crypto/algif_hash.c
crypto/algif_hash.c
+1
-1
include/linux/skbuff.h
include/linux/skbuff.h
+5
-0
net/caif/caif_socket.c
net/caif/caif_socket.c
+1
-1
net/can/bcm.c
net/can/bcm.c
+1
-1
net/can/raw.c
net/can/raw.c
+1
-1
net/decnet/af_decnet.c
net/decnet/af_decnet.c
+1
-1
net/ipv4/tcp.c
net/ipv4/tcp.c
+1
-1
net/irda/af_irda.c
net/irda/af_irda.c
+1
-1
net/packet/af_packet.c
net/packet/af_packet.c
+1
-2
No files found.
crypto/algif_hash.c
View file @
7eab8d9e
...
...
@@ -174,7 +174,7 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,
goto
unlock
;
}
err
=
memcpy_to
iovec
(
msg
->
msg_iov
,
ctx
->
result
,
len
);
err
=
memcpy_to
_msg
(
msg
,
ctx
->
result
,
len
);
unlock:
release_sock
(
sk
);
...
...
include/linux/skbuff.h
View file @
7eab8d9e
...
...
@@ -2692,6 +2692,11 @@ static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
return
memcpy_fromiovec
(
data
,
msg
->
msg_iov
,
len
);
}
static
inline
int
memcpy_to_msg
(
struct
msghdr
*
msg
,
void
*
data
,
int
len
)
{
return
memcpy_toiovec
(
msg
->
msg_iov
,
data
,
len
);
}
struct
skb_checksum_ops
{
__wsum
(
*
update
)(
const
void
*
mem
,
int
len
,
__wsum
wsum
);
__wsum
(
*
combine
)(
__wsum
csum
,
__wsum
csum2
,
int
offset
,
int
len
);
...
...
net/caif/caif_socket.c
View file @
7eab8d9e
...
...
@@ -418,7 +418,7 @@ static int caif_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
}
release_sock
(
sk
);
chunk
=
min_t
(
unsigned
int
,
skb
->
len
,
size
);
if
(
memcpy_to
iovec
(
msg
->
msg_iov
,
skb
->
data
,
chunk
))
{
if
(
memcpy_to
_msg
(
msg
,
skb
->
data
,
chunk
))
{
skb_queue_head
(
&
sk
->
sk_receive_queue
,
skb
);
if
(
copied
==
0
)
copied
=
-
EFAULT
;
...
...
net/can/bcm.c
View file @
7eab8d9e
...
...
@@ -1555,7 +1555,7 @@ static int bcm_recvmsg(struct kiocb *iocb, struct socket *sock,
if
(
skb
->
len
<
size
)
size
=
skb
->
len
;
err
=
memcpy_to
iovec
(
msg
->
msg_iov
,
skb
->
data
,
size
);
err
=
memcpy_to
_msg
(
msg
,
skb
->
data
,
size
);
if
(
err
<
0
)
{
skb_free_datagram
(
sk
,
skb
);
return
err
;
...
...
net/can/raw.c
View file @
7eab8d9e
...
...
@@ -750,7 +750,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct socket *sock,
else
size
=
skb
->
len
;
err
=
memcpy_to
iovec
(
msg
->
msg_iov
,
skb
->
data
,
size
);
err
=
memcpy_to
_msg
(
msg
,
skb
->
data
,
size
);
if
(
err
<
0
)
{
skb_free_datagram
(
sk
,
skb
);
return
err
;
...
...
net/decnet/af_decnet.c
View file @
7eab8d9e
...
...
@@ -1760,7 +1760,7 @@ static int dn_recvmsg(struct kiocb *iocb, struct socket *sock,
if
((
chunk
+
copied
)
>
size
)
chunk
=
size
-
copied
;
if
(
memcpy_to
iovec
(
msg
->
msg_iov
,
skb
->
data
,
chunk
))
{
if
(
memcpy_to
_msg
(
msg
,
skb
->
data
,
chunk
))
{
rv
=
-
EFAULT
;
break
;
}
...
...
net/ipv4/tcp.c
View file @
7eab8d9e
...
...
@@ -1349,7 +1349,7 @@ static int tcp_recv_urg(struct sock *sk, struct msghdr *msg, int len, int flags)
if
(
len
>
0
)
{
if
(
!
(
flags
&
MSG_TRUNC
))
err
=
memcpy_to
iovec
(
msg
->
msg_iov
,
&
c
,
1
);
err
=
memcpy_to
_msg
(
msg
,
&
c
,
1
);
len
=
1
;
}
else
msg
->
msg_flags
|=
MSG_TRUNC
;
...
...
net/irda/af_irda.c
View file @
7eab8d9e
...
...
@@ -1466,7 +1466,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock,
}
chunk
=
min_t
(
unsigned
int
,
skb
->
len
,
size
);
if
(
memcpy_to
iovec
(
msg
->
msg_iov
,
skb
->
data
,
chunk
))
{
if
(
memcpy_to
_msg
(
msg
,
skb
->
data
,
chunk
))
{
skb_queue_head
(
&
sk
->
sk_receive_queue
,
skb
);
if
(
copied
==
0
)
copied
=
-
EFAULT
;
...
...
net/packet/af_packet.c
View file @
7eab8d9e
...
...
@@ -2949,8 +2949,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
vnet_hdr
.
flags
=
VIRTIO_NET_HDR_F_DATA_VALID
;
}
/* else everything is zero */
err
=
memcpy_toiovec
(
msg
->
msg_iov
,
(
void
*
)
&
vnet_hdr
,
vnet_hdr_len
);
err
=
memcpy_to_msg
(
msg
,
(
void
*
)
&
vnet_hdr
,
vnet_hdr_len
);
if
(
err
<
0
)
goto
out_free
;
}
...
...
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