summaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-29 14:09:40 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-29 13:10:39 -0700
commit40ef92c6ec09bd8aaffccfa41a715d1df5625f95 (patch)
tree23f65f7f76323bef1a6110720ae0c97725fff893 /include/net/sctp
parentf26e9b2c0bf3a7a515b2e92763182bcd81628a5f (diff)
downloadlinux-40ef92c6ec09bd8aaffccfa41a715d1df5625f95.tar.bz2
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.h7
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__ */