net: Rename ->stream_memory_read to ->sock_is_readable
The proto ops ->stream_memory_read() is currently only used by TCP to check whether psock queue is empty or not. We need to rename it before reusing it for non-TCP protocols, and adjust the exsiting users accordingly. Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20211008203306.37525-2-xiyou.wangcong@gmail.com
This commit is contained in:
committed by
Alexei Starovoitov
parent
cd9733f5d7
commit
7b50ecfcc6
@@ -1208,7 +1208,7 @@ struct proto {
|
||||
#endif
|
||||
|
||||
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);
|
||||
@@ -2820,4 +2820,10 @@ void sock_set_sndtimeo(struct sock *sk, s64 secs);
|
||||
|
||||
int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len);
|
||||
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user