the hfsc pools are only used in hfsc.c, so move the init of them
authordlg <dlg@openbsd.org>
Sat, 11 Apr 2015 13:00:12 +0000 (13:00 +0000)
committerdlg <dlg@openbsd.org>
Sat, 11 Apr 2015 13:00:12 +0000 (13:00 +0000)
there instead of pf_ioctl.c.

ok henning@

sys/net/hfsc.c
sys/net/hfsc.h
sys/net/pf.c
sys/net/pf_ioctl.c
sys/net/pfvar.h

index 4036fe4..00dafb8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: hfsc.c,v 1.16 2015/03/03 11:14:00 henning Exp $       */
+/*     $OpenBSD: hfsc.c,v 1.17 2015/04/11 13:00:12 dlg Exp $   */
 
 /*
  * Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org>
@@ -121,6 +121,8 @@ struct hfsc_class   *hfsc_clh2cph(struct hfsc_if *, u_int32_t);
 
 #define        HFSC_HT_INFINITY        0xffffffffffffffffLL /* infinite time value */
 
+struct pool    hfsc_class_pl, hfsc_classq_pl, hfsc_internal_sc_pl;
+
 u_int64_t
 hfsc_microuptime(void)
 {
@@ -155,6 +157,17 @@ hfsc_grow_class_tbl(struct hfsc_if *hif, u_int howmany)
        free(old, M_DEVBUF, 0);
 }
 
+void
+hfsc_initialize(void)
+{
+       pool_init(&hfsc_class_pl, sizeof(struct hfsc_class), 0, 0, PR_WAITOK,
+           "hfscclass", NULL);
+       pool_init(&hfsc_classq_pl, sizeof(struct hfsc_classq), 0, 0, PR_WAITOK,
+           "hfscclassq", NULL);
+       pool_init(&hfsc_internal_sc_pl, sizeof(struct hfsc_internal_sc), 0, 0,
+           PR_WAITOK, "hfscintsc", NULL);
+}
+
 int
 hfsc_attach(struct ifnet *ifp)
 {
index 8cbef7d..722c93d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: hfsc.h,v 1.6 2014/04/19 16:02:17 henning Exp $        */
+/*     $OpenBSD: hfsc.h,v 1.7 2015/04/11 13:00:12 dlg Exp $    */
 
 /*
  * Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org>
@@ -258,6 +258,7 @@ struct hfsc_if {
 
 struct ifnet; struct ifqueue; struct pf_queuespec;
 
+void            hfsc_initialize(void);
 int             hfsc_attach(struct ifnet *);
 int             hfsc_detach(struct ifnet *);
 void            hfsc_purge(struct ifqueue *);
index e6a395a..3ad4278 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf.c,v 1.910 2015/04/08 12:50:21 mikeb Exp $ */
+/*     $OpenBSD: pf.c,v 1.911 2015/04/11 13:00:12 dlg Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -135,7 +135,6 @@ union pf_headers {
 struct pool             pf_src_tree_pl, pf_rule_pl, pf_queue_pl;
 struct pool             pf_state_pl, pf_state_key_pl, pf_state_item_pl;
 struct pool             pf_rule_item_pl, pf_sn_item_pl;
-struct pool             hfsc_class_pl, hfsc_classq_pl, hfsc_internal_sc_pl;
 
 void                    pf_init_threshold(struct pf_threshold *, u_int32_t,
                            u_int32_t);
index fbed2e3..857ad21 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf_ioctl.c,v 1.284 2015/03/14 03:38:51 jsg Exp $ */
+/*     $OpenBSD: pf_ioctl.c,v 1.285 2015/04/11 13:00:12 dlg Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -155,12 +155,7 @@ pfattach(int num)
            "pfruleitem", NULL);
        pool_init(&pf_queue_pl, sizeof(struct pf_queuespec), 0, 0, 0, 
            "pfqueue", NULL);
-       pool_init(&hfsc_class_pl, sizeof(struct hfsc_class), 0, 0, PR_WAITOK,
-           "hfscclass", NULL);
-       pool_init(&hfsc_classq_pl, sizeof(struct hfsc_classq), 0, 0, PR_WAITOK,
-           "hfscclassq", NULL);
-       pool_init(&hfsc_internal_sc_pl, sizeof(struct hfsc_internal_sc), 0, 0,
-           PR_WAITOK, "hfscintsc", NULL);
+       hfsc_initialize();
        pfr_initialize();
        pfi_initialize();
        pf_osfp_initialize();
index a0423b1..2a26374 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pfvar.h,v 1.413 2015/02/15 10:40:53 sthen Exp $ */
+/*     $OpenBSD: pfvar.h,v 1.414 2015/04/11 13:00:12 dlg Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -1760,8 +1760,6 @@ extern struct pool                 pf_src_tree_pl, pf_sn_item_pl, pf_rule_pl;
 extern struct pool              pf_state_pl, pf_state_key_pl, pf_state_item_pl,
                                    pf_rule_item_pl, pf_queue_pl;
 extern struct pool              pf_state_scrub_pl;
-extern struct pool              hfsc_class_pl, hfsc_classq_pl,
-                                   hfsc_internal_sc_pl;
 extern void                     pf_purge_thread(void *);
 extern void                     pf_purge_expired_src_nodes(int);
 extern void                     pf_purge_expired_states(u_int32_t);