diff options
author | Wen Gu <guwen@linux.alibaba.com> | 2022-01-13 16:36:41 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-13 13:14:53 +0000 |
commit | ea89c6c0983c39702a4a52ccaa4702e0cb71179b (patch) | |
tree | 9e8c99b82d0eeaee64d464df07eacc135608cfcf /net/smc/smc_core.h | |
parent | 91341fa0003befd097e190ec2a4bf63ad957c49a (diff) |
net/smc: Introduce a new conn->lgr validity check helper
It is no longer suitable to identify whether a smc connection
is registered in a link group through checking if conn->lgr
is NULL, because conn->lgr won't be reset even the connection
is unregistered from a link group.
So this patch introduces a new helper smc_conn_lgr_valid() and
replaces all the check of conn->lgr in original implementation
with the new helper to judge if conn->lgr is valid to use.
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.h')
-rw-r--r-- | net/smc/smc_core.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h index f8b5397a9dbe..599455d00020 100644 --- a/net/smc/smc_core.h +++ b/net/smc/smc_core.h @@ -410,6 +410,11 @@ static inline struct smc_connection *smc_lgr_find_conn( return res; } +static inline bool smc_conn_lgr_valid(struct smc_connection *conn) +{ + return conn->lgr && conn->alert_token_local; +} + /* * Returns true if the specified link is usable. * |