mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 15:39:42 -04:00
netfilter: conntrack: move ecache dwork to net_generic infra
dwork struct is large (>128 byte) and not needed when conntrack module is not loaded. Place it in net_generic data instead. The struct net dwork member is now obsolete and will be removed in a followup patch. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
7b5974709f
commit
1379940bf8
@@ -50,6 +50,10 @@ struct nf_conntrack_net {
|
||||
#ifdef CONFIG_SYSCTL
|
||||
struct ctl_table_header *sysctl_header;
|
||||
#endif
|
||||
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
||||
struct delayed_work ecache_dwork;
|
||||
struct netns_ct *ct_net;
|
||||
#endif
|
||||
};
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -171,12 +171,18 @@ void nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
|
||||
struct nf_conntrack_expect *exp,
|
||||
u32 portid, int report);
|
||||
|
||||
void nf_conntrack_ecache_work(struct net *net, enum nf_ct_ecache_state state);
|
||||
|
||||
void nf_conntrack_ecache_pernet_init(struct net *net);
|
||||
void nf_conntrack_ecache_pernet_fini(struct net *net);
|
||||
|
||||
int nf_conntrack_ecache_init(void);
|
||||
void nf_conntrack_ecache_fini(void);
|
||||
|
||||
static inline bool nf_conntrack_ecache_dwork_pending(const struct net *net)
|
||||
{
|
||||
return net->ct.ecache_dwork_pending;
|
||||
}
|
||||
#else /* CONFIG_NF_CONNTRACK_EVENTS */
|
||||
|
||||
static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e,
|
||||
@@ -186,6 +192,11 @@ static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e,
|
||||
{
|
||||
}
|
||||
|
||||
static inline void nf_conntrack_ecache_work(struct net *net,
|
||||
enum nf_ct_ecache_state s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void nf_conntrack_ecache_pernet_init(struct net *net)
|
||||
{
|
||||
}
|
||||
@@ -203,26 +214,6 @@ static inline void nf_conntrack_ecache_fini(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool nf_conntrack_ecache_dwork_pending(const struct net *net) { return false; }
|
||||
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
|
||||
|
||||
static inline void nf_conntrack_ecache_delayed_work(struct net *net)
|
||||
{
|
||||
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
||||
if (!delayed_work_pending(&net->ct.ecache_dwork)) {
|
||||
schedule_delayed_work(&net->ct.ecache_dwork, HZ);
|
||||
net->ct.ecache_dwork_pending = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nf_conntrack_ecache_work(struct net *net)
|
||||
{
|
||||
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
||||
if (net->ct.ecache_dwork_pending) {
|
||||
net->ct.ecache_dwork_pending = false;
|
||||
mod_delayed_work(system_wq, &net->ct.ecache_dwork, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /*_NF_CONNTRACK_ECACHE_H*/
|
||||
|
||||
Reference in New Issue
Block a user