Hi,

this removes the currently unused arguments *warnmess and ratecap from
pool_sethardlimit().

ok?

diff --git share/man/man9/pool.9 share/man/man9/pool.9
index 75742cf12ab..27226e14a25 100644
--- share/man/man9/pool.9
+++ share/man/man9/pool.9
@@ -72,8 +72,6 @@
 .Fo pool_sethardlimit
 .Fa "struct pool *pp"
 .Fa "unsigned n"
-.Fa "const char *warnmess"
-.Fa "int ratecap"
 .Fc
 .Sh DESCRIPTION
 These utility routines provide management of pools of fixed-sized
@@ -286,11 +284,6 @@ The function
 sets a hard limit on the pool to
 .Fa n
 items.
-If the hard limit is reached
-.Fa warnmess
-will be printed to the console, but no more than every
-.Fa ratecap
-seconds.
 Upon successful completion, a value of 0 is returned.
 The value EINVAL is returned when the current size of the pool
 already exceeds the requested hard limit.
diff --git sys/kern/subr_pool.c sys/kern/subr_pool.c
index 54688dfe0ea..1c8af82b851 100644
--- sys/kern/subr_pool.c
+++ sys/kern/subr_pool.c
@@ -427,11 +427,6 @@ pool_init(struct pool *pp, size_t size, u_int align, int 
ipl, int flags,
        pp->pr_nitems = 0;
        pp->pr_nout = 0;
        pp->pr_hardlimit = UINT_MAX;
-       pp->pr_hardlimit_warning = NULL;
-       pp->pr_hardlimit_ratecap.tv_sec = 0;
-       pp->pr_hardlimit_ratecap.tv_usec = 0;
-       pp->pr_hardlimit_warning_last.tv_sec = 0;
-       pp->pr_hardlimit_warning_last.tv_usec = 0;
        RBT_INIT(phtree, &pp->pr_phtree);
 
        /*
@@ -1074,7 +1069,7 @@ pool_sethiwat(struct pool *pp, int n)
 }
 
 int
-pool_sethardlimit(struct pool *pp, u_int n, const char *warnmsg, int ratecap)
+pool_sethardlimit(struct pool *pp, u_int n)
 {
        int error = 0;
 
@@ -1084,10 +1079,6 @@ pool_sethardlimit(struct pool *pp, u_int n, const char 
*warnmsg, int ratecap)
        }
 
        pp->pr_hardlimit = n;
-       pp->pr_hardlimit_warning = warnmsg;
-       pp->pr_hardlimit_ratecap.tv_sec = ratecap;
-       pp->pr_hardlimit_warning_last.tv_sec = 0;
-       pp->pr_hardlimit_warning_last.tv_usec = 0;
 
 done:
        return (error);
diff --git sys/net/pf_ioctl.c sys/net/pf_ioctl.c
index ece193752a8..87f097dac6f 100644
--- sys/net/pf_ioctl.c
+++ sys/net/pf_ioctl.c
@@ -175,7 +175,7 @@ pfattach(int num)
        pf_osfp_initialize();
 
        pool_sethardlimit(pf_pool_limits[PF_LIMIT_STATES].pp,
-           pf_pool_limits[PF_LIMIT_STATES].limit, NULL, 0);
+           pf_pool_limits[PF_LIMIT_STATES].limit);
 
        if (physmem <= atop(100*1024*1024))
                pf_pool_limits[PF_LIMIT_TABLE_ENTRIES].limit =
@@ -2448,7 +2448,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, 
struct proc *p)
                        if (pf_pool_limits[i].limit_new !=
                            pf_pool_limits[i].limit &&
                            pool_sethardlimit(pf_pool_limits[i].pp,
-                           pf_pool_limits[i].limit_new, NULL, 0) != 0) {
+                           pf_pool_limits[i].limit_new) != 0) {
                                free(table, M_TEMP, sizeof(*table));
                                free(ioe, M_TEMP, sizeof(*ioe));
                                error = EBUSY;
diff --git sys/net/pf_norm.c sys/net/pf_norm.c
index 68308b027d3..de1eeab612b 100644
--- sys/net/pf_norm.c
+++ sys/net/pf_norm.c
@@ -166,7 +166,7 @@ pf_normalize_init(void)
            IPL_SOFTNET, 0, "pfstscr", NULL);
 
        pool_sethiwat(&pf_frag_pl, PFFRAG_FRAG_HIWAT);
-       pool_sethardlimit(&pf_frent_pl, PFFRAG_FRENT_HIWAT, NULL, 0);
+       pool_sethardlimit(&pf_frent_pl, PFFRAG_FRENT_HIWAT);
 
        TAILQ_INIT(&pf_fragqueue);
 
diff --git sys/netinet/tcp_subr.c sys/netinet/tcp_subr.c
index 67e8c1a80a1..e142df36525 100644
--- sys/netinet/tcp_subr.c
+++ sys/netinet/tcp_subr.c
@@ -141,10 +141,10 @@ tcp_init(void)
            "tcpcb", NULL);
        pool_init(&tcpqe_pool, sizeof(struct tcpqent), 0, IPL_SOFTNET, 0,
            "tcpqe", NULL);
-       pool_sethardlimit(&tcpqe_pool, tcp_reass_limit, NULL, 0);
+       pool_sethardlimit(&tcpqe_pool, tcp_reass_limit);
        pool_init(&sackhl_pool, sizeof(struct sackhole), 0, IPL_SOFTNET, 0,
            "sackhl", NULL);
-       pool_sethardlimit(&sackhl_pool, tcp_sackhole_limit, NULL, 0);
+       pool_sethardlimit(&sackhl_pool, tcp_sackhole_limit);
        in_pcbinit(&tcbtable, TCB_INITIAL_HASH_SIZE);
        tcpcounters = counters_alloc(tcps_ncounters);
 
diff --git sys/netinet/tcp_usrreq.c sys/netinet/tcp_usrreq.c
index cc2b23e0661..1570eca653f 100644
--- sys/netinet/tcp_usrreq.c
+++ sys/netinet/tcp_usrreq.c
@@ -1043,7 +1043,7 @@ tcp_sysctl(int *name, u_int namelen, void *oldp, size_t 
*oldlenp, void *newp,
                nval = tcp_reass_limit;
                error = sysctl_int(oldp, oldlenp, newp, newlen, &nval);
                if (!error && nval != tcp_reass_limit) {
-                       error = pool_sethardlimit(&tcpqe_pool, nval, NULL, 0);
+                       error = pool_sethardlimit(&tcpqe_pool, nval);
                        if (!error)
                                tcp_reass_limit = nval;
                }
@@ -1055,7 +1055,7 @@ tcp_sysctl(int *name, u_int namelen, void *oldp, size_t 
*oldlenp, void *newp,
                nval = tcp_sackhole_limit;
                error = sysctl_int(oldp, oldlenp, newp, newlen, &nval);
                if (!error && nval != tcp_sackhole_limit) {
-                       error = pool_sethardlimit(&sackhl_pool, nval, NULL, 0);
+                       error = pool_sethardlimit(&sackhl_pool, nval);
                        if (!error)
                                tcp_sackhole_limit = nval;
                }
diff --git sys/sys/pool.h sys/sys/pool.h
index d2f05227b7a..922be95ab04 100644
--- sys/sys/pool.h
+++ sys/sys/pool.h
@@ -209,14 +209,6 @@ struct pool {
        u_int           pr_maxcolors;   /* Cache coloring */
        int             pr_phoffset;    /* Offset in page of page header */
 
-       /*
-        * Warning message to be issued, and a per-time-delta rate cap,
-        * if the hard limit is reached.
-        */
-       const char      *pr_hardlimit_warning;
-       struct timeval  pr_hardlimit_ratecap;
-       struct timeval  pr_hardlimit_warning_last;
-
        /*
         * pool item requests queue
         */
@@ -261,7 +253,7 @@ void                pool_cache_init(struct pool *);
 void           pool_destroy(struct pool *);
 void           pool_setlowat(struct pool *, int);
 void           pool_sethiwat(struct pool *, int);
-int            pool_sethardlimit(struct pool *, u_int, const char *, int);
+int            pool_sethardlimit(struct pool *, u_int);
 struct uvm_constraint_range; /* XXX */
 void           pool_set_constraints(struct pool *,
                    const struct kmem_pa_mode *mode);

Reply via email to