diff options
author | Stefan Raspl <stefan.raspl@linux.ibm.com> | 2018-05-03 18:12:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-04 17:45:06 +0200 |
commit | b51fa1b135fbfc89e34d90b5bab563745d94186f (patch) | |
tree | ce5c2803d4f55f65f6d1514621c5da520ae89f45 /net/smc/smc_rx.h | |
parent | smc: simplify abort logic (diff) | |
download | linux-b51fa1b135fbfc89e34d90b5bab563745d94186f.tar.xz linux-b51fa1b135fbfc89e34d90b5bab563745d94186f.zip |
smc: make smc_rx_wait_data() generic
Turn smc_rx_wait_data into a generic function that can be used at various
instances to wait on traffic to complete with varying criteria.
Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com><
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_rx.h')
-rw-r--r-- | net/smc/smc_rx.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/smc/smc_rx.h b/net/smc/smc_rx.h index 0b75a6b470e6..8f9f00997641 100644 --- a/net/smc/smc_rx.h +++ b/net/smc/smc_rx.h @@ -20,6 +20,12 @@ void smc_rx_init(struct smc_sock *smc); int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, size_t len, int flags); -int smc_rx_wait_data(struct smc_sock *smc, long *timeo); +int smc_rx_wait(struct smc_sock *smc, long *timeo, + int (*fcrit)(struct smc_connection *conn)); +static inline int smc_rx_data_available(struct smc_connection *conn) +{ + return atomic_read(&conn->bytes_to_rcv); +} + #endif /* SMC_RX_H */ |