net: add sock_set_priority
Add a helper to directly set the SO_PRIORITY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c433594c07
commit
6e43496745
@@ -729,6 +729,14 @@ void sock_no_linger(struct sock *sk)
|
||||
}
|
||||
EXPORT_SYMBOL(sock_no_linger);
|
||||
|
||||
void sock_set_priority(struct sock *sk, u32 priority)
|
||||
{
|
||||
lock_sock(sk);
|
||||
sk->sk_priority = priority;
|
||||
release_sock(sk);
|
||||
}
|
||||
EXPORT_SYMBOL(sock_set_priority);
|
||||
|
||||
/*
|
||||
* This is meant for all protocols to use and covers goings on
|
||||
* at the socket level. Everything here is generic.
|
||||
|
Reference in New Issue
Block a user