aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-28 10:43:58 -0700
committerJakub Kicinski <kuba@kernel.org>2021-10-28 10:43:58 -0700
commit7df621a3eea6761bc83e641aaca6963210c7290d (patch)
tree65ab9d0d1894153ceefcb6b5a1c25b8d17c466fd /include/net/sock.h
parentf2edaa4ad5d51371709196f2c258fbe875962dee (diff)
parent411a44c24a561e449b592ff631b7ae321f1eb559 (diff)
downloadlinux-7df621a3eea6761bc83e641aaca6963210c7290d.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
include/net/sock.h 7b50ecfcc6cd ("net: Rename ->stream_memory_read to ->sock_is_readable") 4c1e34c0dbff ("vsock: Enable y2038 safe timeval for timeout") drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c 0daa55d033b0 ("octeontx2-af: cn10k: debugfs for dumping LMTST map table") e77bcdd1f639 ("octeontx2-af: Display all enabled PF VF rsrc_alloc entries.") Adjacent code addition in both cases, keep both. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index fb70d8553fae7f..620de053002d71 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1213,7 +1213,7 @@ struct proto {
int (*forward_alloc_get)(const struct sock *sk);
bool (*stream_memory_free)(const struct sock *sk, int wake);
- bool (*stream_memory_read)(const struct sock *sk);
+ bool (*sock_is_readable)(struct sock *sk);
/* Memory pressure */
void (*enter_memory_pressure)(struct sock *sk);
void (*leave_memory_pressure)(struct sock *sk);
@@ -2854,4 +2854,10 @@ int sock_get_timeout(long timeo, void *optval, bool old_timeval);
int sock_copy_user_timeval(struct __kernel_sock_timeval *tv,
sockptr_t optval, int optlen, bool old_timeval);
+static inline bool sk_is_readable(struct sock *sk)
+{
+ if (sk->sk_prot->sock_is_readable)
+ return sk->sk_prot->sock_is_readable(sk);
+ return false;
+}
#endif /* _SOCK_H */