mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mptcp: cleanup sysctl data and helpers
Reorder the data in mptcp_pernet to avoid wasting space with no reasons and constify the access helpers. No functional changes intended. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1e1d9d6f11
commit
6da14d74e2
2 changed files with 10 additions and 10 deletions
|
@ -21,33 +21,33 @@ struct mptcp_pernet {
|
||||||
struct ctl_table_header *ctl_table_hdr;
|
struct ctl_table_header *ctl_table_hdr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u8 mptcp_enabled;
|
|
||||||
unsigned int add_addr_timeout;
|
unsigned int add_addr_timeout;
|
||||||
|
u8 mptcp_enabled;
|
||||||
u8 checksum_enabled;
|
u8 checksum_enabled;
|
||||||
u8 allow_join_initial_addr_port;
|
u8 allow_join_initial_addr_port;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct mptcp_pernet *mptcp_get_pernet(struct net *net)
|
static struct mptcp_pernet *mptcp_get_pernet(const struct net *net)
|
||||||
{
|
{
|
||||||
return net_generic(net, mptcp_pernet_id);
|
return net_generic(net, mptcp_pernet_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mptcp_is_enabled(struct net *net)
|
int mptcp_is_enabled(const struct net *net)
|
||||||
{
|
{
|
||||||
return mptcp_get_pernet(net)->mptcp_enabled;
|
return mptcp_get_pernet(net)->mptcp_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int mptcp_get_add_addr_timeout(struct net *net)
|
unsigned int mptcp_get_add_addr_timeout(const struct net *net)
|
||||||
{
|
{
|
||||||
return mptcp_get_pernet(net)->add_addr_timeout;
|
return mptcp_get_pernet(net)->add_addr_timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mptcp_is_checksum_enabled(struct net *net)
|
int mptcp_is_checksum_enabled(const struct net *net)
|
||||||
{
|
{
|
||||||
return mptcp_get_pernet(net)->checksum_enabled;
|
return mptcp_get_pernet(net)->checksum_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mptcp_allow_join_id0(struct net *net)
|
int mptcp_allow_join_id0(const struct net *net)
|
||||||
{
|
{
|
||||||
return mptcp_get_pernet(net)->allow_join_initial_addr_port;
|
return mptcp_get_pernet(net)->allow_join_initial_addr_port;
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,10 +556,10 @@ static inline void mptcp_subflow_delegated_done(struct mptcp_subflow_context *su
|
||||||
clear_bit(MPTCP_DELEGATE_SEND, &subflow->delegated_status);
|
clear_bit(MPTCP_DELEGATE_SEND, &subflow->delegated_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mptcp_is_enabled(struct net *net);
|
int mptcp_is_enabled(const struct net *net);
|
||||||
unsigned int mptcp_get_add_addr_timeout(struct net *net);
|
unsigned int mptcp_get_add_addr_timeout(const struct net *net);
|
||||||
int mptcp_is_checksum_enabled(struct net *net);
|
int mptcp_is_checksum_enabled(const struct net *net);
|
||||||
int mptcp_allow_join_id0(struct net *net);
|
int mptcp_allow_join_id0(const struct net *net);
|
||||||
void mptcp_subflow_fully_established(struct mptcp_subflow_context *subflow,
|
void mptcp_subflow_fully_established(struct mptcp_subflow_context *subflow,
|
||||||
struct mptcp_options_received *mp_opt);
|
struct mptcp_options_received *mp_opt);
|
||||||
bool __mptcp_retransmit_pending_data(struct sock *sk);
|
bool __mptcp_retransmit_pending_data(struct sock *sk);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue