File tree Expand file tree Collapse file tree 3 files changed +7
-22
lines changed Expand file tree Collapse file tree 3 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,11 @@ struct mr_table {
262262 int mroute_reg_vif_num ;
263263};
264264
265+ static inline bool mr_can_free_table (struct net * net )
266+ {
267+ return !check_net (net ) || !net_initialized (net );
268+ }
269+
265270#ifdef CONFIG_IP_MROUTE_COMMON
266271void vif_device_init (struct vif_device * v ,
267272 struct net_device * dev ,
Original file line number Diff line number Diff line change @@ -120,11 +120,6 @@ static void ipmr_expire_process(struct timer_list *t);
120120 lockdep_rtnl_is_held() || \
121121 list_empty(&net->ipv4.mr_tables))
122122
123- static bool ipmr_can_free_table (struct net * net )
124- {
125- return !check_net (net ) || !net_initialized (net );
126- }
127-
128123static struct mr_table * ipmr_mr_table_iter (struct net * net ,
129124 struct mr_table * mrt )
130125{
@@ -317,11 +312,6 @@ EXPORT_SYMBOL(ipmr_rule_default);
317312#define ipmr_for_each_table (mrt , net ) \
318313 for (mrt = net->ipv4.mrt; mrt; mrt = NULL)
319314
320- static bool ipmr_can_free_table (struct net * net )
321- {
322- return !check_net (net );
323- }
324-
325315static struct mr_table * ipmr_mr_table_iter (struct net * net ,
326316 struct mr_table * mrt )
327317{
@@ -437,7 +427,7 @@ static void ipmr_free_table(struct mr_table *mrt)
437427{
438428 struct net * net = read_pnet (& mrt -> net );
439429
440- WARN_ON_ONCE (!ipmr_can_free_table (net ));
430+ WARN_ON_ONCE (!mr_can_free_table (net ));
441431
442432 timer_shutdown_sync (& mrt -> ipmr_expire_timer );
443433 mroute_clean_tables (mrt , MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC |
Original file line number Diff line number Diff line change @@ -108,11 +108,6 @@ static void ipmr_expire_process(struct timer_list *t);
108108 lockdep_rtnl_is_held() || \
109109 list_empty(&net->ipv6.mr6_tables))
110110
111- static bool ip6mr_can_free_table (struct net * net )
112- {
113- return !check_net (net ) || !net_initialized (net );
114- }
115-
116111static struct mr_table * ip6mr_mr_table_iter (struct net * net ,
117112 struct mr_table * mrt )
118113{
@@ -306,11 +301,6 @@ EXPORT_SYMBOL(ip6mr_rule_default);
306301#define ip6mr_for_each_table (mrt , net ) \
307302 for (mrt = net->ipv6.mrt6; mrt; mrt = NULL)
308303
309- static bool ip6mr_can_free_table (struct net * net )
310- {
311- return !check_net (net );
312- }
313-
314304static struct mr_table * ip6mr_mr_table_iter (struct net * net ,
315305 struct mr_table * mrt )
316306{
@@ -416,7 +406,7 @@ static void ip6mr_free_table(struct mr_table *mrt)
416406{
417407 struct net * net = read_pnet (& mrt -> net );
418408
419- WARN_ON_ONCE (!ip6mr_can_free_table (net ));
409+ WARN_ON_ONCE (!mr_can_free_table (net ));
420410
421411 timer_shutdown_sync (& mrt -> ipmr_expire_timer );
422412 mroute_clean_tables (mrt , MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC |
You can’t perform that action at this time.
0 commit comments