unix: Support peeking offset for datagram and seqpacket sockets
authorPavel Emelyanov <xemul@parallels.com>
Tue, 21 Feb 2012 07:31:51 +0000 (07:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2012 20:03:58 +0000 (15:03 -0500)
commitf55bb7f9cb82dec2f2e803d7bd0fc5929248e4d8
tree25b5f83aa834490eb6a07e52db93b972e16e498f
parentef64a54f6e558155b4f149bb10666b9e914b6c54
unix: Support peeking offset for datagram and seqpacket sockets

The sk_peek_off manipulations are protected with the unix_sk->readlock mutex.
This mutex is enough since all we need is to syncronize setting the offset
vs reading the queue head. The latter is fully covered with the mentioned lock.

The recently added __skb_recv_datagram's offset is used to pick the skb to
read the data from.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c