diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-29 14:09:40 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-29 22:10:39 +0200 |
commit | 40ef92c6ec09bd8aaffccfa41a715d1df5625f95 (patch) | |
tree | 23f65f7f76323bef1a6110720ae0c97725fff893 /include/net/sctp | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klasse... (diff) | |
download | linux-40ef92c6ec09bd8aaffccfa41a715d1df5625f95.tar.xz linux-40ef92c6ec09bd8aaffccfa41a715d1df5625f95.zip |
sctp: add sctp_sock_set_nodelay
Add a helper to directly set the SCTP_NODELAY sockopt from kernel space
without going through a fake uaccess.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r-- | include/net/sctp/sctp.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 3ab5c6bbb90b..f8bcb75bb044 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -615,4 +615,11 @@ static inline bool sctp_newsk_ready(const struct sock *sk) return sock_flag(sk, SOCK_DEAD) || sk->sk_socket; } +static inline void sctp_sock_set_nodelay(struct sock *sk) +{ + lock_sock(sk); + sctp_sk(sk)->nodelay = true; + release_sock(sk); +} + #endif /* __net_sctp_h__ */ |