Commit f643b803 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

mptcp: rename addr_signal and the related functions

This patch renamed addr_signal and the related functions with the explicit
word "add".
Suggested-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 075c1568
...@@ -571,7 +571,7 @@ static u64 add_addr6_generate_hmac(u64 key1, u64 key2, u8 addr_id, ...@@ -571,7 +571,7 @@ static u64 add_addr6_generate_hmac(u64 key1, u64 key2, u8 addr_id,
} }
#endif #endif
static bool mptcp_established_options_addr(struct sock *sk, static bool mptcp_established_options_add_addr(struct sock *sk,
unsigned int *size, unsigned int *size,
unsigned int remaining, unsigned int remaining,
struct mptcp_out_options *opts) struct mptcp_out_options *opts)
...@@ -581,8 +581,8 @@ static bool mptcp_established_options_addr(struct sock *sk, ...@@ -581,8 +581,8 @@ static bool mptcp_established_options_addr(struct sock *sk,
struct mptcp_addr_info saddr; struct mptcp_addr_info saddr;
int len; int len;
if (!mptcp_pm_should_signal(msk) || if (!mptcp_pm_should_add_signal(msk) ||
!(mptcp_pm_addr_signal(msk, remaining, &saddr))) !(mptcp_pm_add_addr_signal(msk, remaining, &saddr)))
return false; return false;
len = mptcp_add_addr_len(saddr.family); len = mptcp_add_addr_len(saddr.family);
...@@ -640,7 +640,7 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb, ...@@ -640,7 +640,7 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
*size += opt_size; *size += opt_size;
remaining -= opt_size; remaining -= opt_size;
if (mptcp_established_options_addr(sk, &opt_size, remaining, opts)) { if (mptcp_established_options_add_addr(sk, &opt_size, remaining, opts)) {
*size += opt_size; *size += opt_size;
remaining -= opt_size; remaining -= opt_size;
ret = true; ret = true;
......
...@@ -18,7 +18,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, ...@@ -18,7 +18,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
pr_debug("msk=%p, local_id=%d", msk, addr->id); pr_debug("msk=%p, local_id=%d", msk, addr->id);
msk->pm.local = *addr; msk->pm.local = *addr;
WRITE_ONCE(msk->pm.addr_signal, true); WRITE_ONCE(msk->pm.add_addr_signal, true);
return 0; return 0;
} }
...@@ -151,7 +151,7 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk, ...@@ -151,7 +151,7 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk,
/* path manager helpers */ /* path manager helpers */
bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
struct mptcp_addr_info *saddr) struct mptcp_addr_info *saddr)
{ {
int ret = false; int ret = false;
...@@ -159,14 +159,14 @@ bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, ...@@ -159,14 +159,14 @@ bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
spin_lock_bh(&msk->pm.lock); spin_lock_bh(&msk->pm.lock);
/* double check after the lock is acquired */ /* double check after the lock is acquired */
if (!mptcp_pm_should_signal(msk)) if (!mptcp_pm_should_add_signal(msk))
goto out_unlock; goto out_unlock;
if (remaining < mptcp_add_addr_len(msk->pm.local.family)) if (remaining < mptcp_add_addr_len(msk->pm.local.family))
goto out_unlock; goto out_unlock;
*saddr = msk->pm.local; *saddr = msk->pm.local;
WRITE_ONCE(msk->pm.addr_signal, false); WRITE_ONCE(msk->pm.add_addr_signal, false);
ret = true; ret = true;
out_unlock: out_unlock:
...@@ -186,7 +186,7 @@ void mptcp_pm_data_init(struct mptcp_sock *msk) ...@@ -186,7 +186,7 @@ void mptcp_pm_data_init(struct mptcp_sock *msk)
msk->pm.local_addr_used = 0; msk->pm.local_addr_used = 0;
msk->pm.subflows = 0; msk->pm.subflows = 0;
WRITE_ONCE(msk->pm.work_pending, false); WRITE_ONCE(msk->pm.work_pending, false);
WRITE_ONCE(msk->pm.addr_signal, false); WRITE_ONCE(msk->pm.add_addr_signal, false);
WRITE_ONCE(msk->pm.accept_addr, false); WRITE_ONCE(msk->pm.accept_addr, false);
WRITE_ONCE(msk->pm.accept_subflow, false); WRITE_ONCE(msk->pm.accept_subflow, false);
msk->pm.status = 0; msk->pm.status = 0;
......
...@@ -162,7 +162,7 @@ struct mptcp_pm_data { ...@@ -162,7 +162,7 @@ struct mptcp_pm_data {
spinlock_t lock; /*protects the whole PM data */ spinlock_t lock; /*protects the whole PM data */
bool addr_signal; bool add_addr_signal;
bool server_side; bool server_side;
bool work_pending; bool work_pending;
bool accept_addr; bool accept_addr;
...@@ -438,9 +438,9 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, ...@@ -438,9 +438,9 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
int mptcp_pm_remove_addr(struct mptcp_sock *msk, u8 local_id); int mptcp_pm_remove_addr(struct mptcp_sock *msk, u8 local_id);
int mptcp_pm_remove_subflow(struct mptcp_sock *msk, u8 remote_id); int mptcp_pm_remove_subflow(struct mptcp_sock *msk, u8 remote_id);
static inline bool mptcp_pm_should_signal(struct mptcp_sock *msk) static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk)
{ {
return READ_ONCE(msk->pm.addr_signal); return READ_ONCE(msk->pm.add_addr_signal);
} }
static inline unsigned int mptcp_add_addr_len(int family) static inline unsigned int mptcp_add_addr_len(int family)
...@@ -450,7 +450,7 @@ static inline unsigned int mptcp_add_addr_len(int family) ...@@ -450,7 +450,7 @@ static inline unsigned int mptcp_add_addr_len(int family)
return TCPOLEN_MPTCP_ADD_ADDR6; return TCPOLEN_MPTCP_ADD_ADDR6;
} }
bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, bool mptcp_pm_add_addr_signal(struct mptcp_sock *msk, unsigned int remaining,
struct mptcp_addr_info *saddr); struct mptcp_addr_info *saddr);
int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment