It is no longer needed to pass the pointer to cluster_limit.
exec_objcache = objcache_create_mbacked(
M_EXECARGS, PATH_MAX + ARG_MAX,
- &cluster_limit, 8,
+ cluster_limit, 8,
NULL, NULL, NULL);
}
SYSINIT(exec_objcache, SI_BOOT2_MACHDEP, SI_ORDER_ANY, exec_objcache_init, 0);
* Create an object cache.
*/
struct objcache *
-objcache_create(const char *name, int *cluster_limit0, int nom_cache,
+objcache_create(const char *name, int cluster_limit, int nom_cache,
objcache_ctor_fn *ctor, objcache_dtor_fn *dtor, void *privdata,
objcache_alloc_fn *alloc, objcache_free_fn *free,
void *allocator_args)
int nmagdepot;
int mag_capacity;
int i;
- int cluster_limit;
-
- if (cluster_limit0 == NULL)
- cluster_limit = 0;
- else
- cluster_limit = *cluster_limit0;
/*
* Allocate object cache structure
LIST_INSERT_HEAD(&allobjcaches, oc, oc_next);
spin_unlock(&objcachelist_spin);
- if (cluster_limit0 != NULL)
- *cluster_limit0 = cluster_limit;
return (oc);
}
margs = kmalloc(sizeof(*margs), M_OBJCACHE, M_WAITOK|M_ZERO);
margs->objsize = objsize;
margs->mtype = mtype;
- oc = objcache_create(mtype->ks_shortdesc, NULL, 0,
+ oc = objcache_create(mtype->ks_shortdesc, 0, 0,
NULL, NULL, NULL,
objcache_malloc_alloc, objcache_malloc_free,
margs);
struct objcache *
objcache_create_mbacked(malloc_type_t mtype, size_t objsize,
- int *cluster_limit, int nom_cache,
+ int cluster_limit, int nom_cache,
objcache_ctor_fn *ctor, objcache_dtor_fn *dtor,
void *privdata)
{
{
size_t n = sizeof(struct slmsg);
- sl_objcache_none = objcache_create_mbacked(M_SYSLINK, n, NULL, 64,
+ sl_objcache_none = objcache_create_mbacked(M_SYSLINK, n, 0, 64,
slmsg_ctor, slmsg_dtor,
&sl_objcache_none);
- sl_objcache_small= objcache_create_mbacked(M_SYSLINK, n, NULL, 64,
+ sl_objcache_small= objcache_create_mbacked(M_SYSLINK, n, 0, 64,
slmsg_ctor, slmsg_dtor,
&sl_objcache_small);
- sl_objcache_big = objcache_create_mbacked(M_SYSLINK, n, NULL, 16,
+ sl_objcache_big = objcache_create_mbacked(M_SYSLINK, n, 0, 16,
slmsg_ctor, slmsg_dtor,
&sl_objcache_big);
}
KKASSERT(srclass->mtype != NULL);
srclass->oc = objcache_create_mbacked(
srclass->mtype, srclass->objsize,
- NULL, srclass->nom_cache,
+ 0, srclass->nom_cache,
sysref_ctor, sysref_dtor, srclass);
}
}
thread_cache = objcache_create_mbacked(
M_THREAD, sizeof(struct thread),
- NULL, lwkt_cache_threads,
+ 0, lwkt_cache_threads,
_lwkt_thread_ctor, _lwkt_thread_dtor, NULL);
}
limit = nmbufs;
mbuf_cache = objcache_create("mbuf",
- &limit, 0,
+ limit, 0,
mbuf_ctor, NULL, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
limit = nmbufs;
mbufphdr_cache = objcache_create("mbuf pkt hdr",
- &limit, nmbufs / 4,
+ limit, nmbufs / 4,
mbufphdr_ctor, NULL, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
ncl_limit = nmbclusters;
mclmeta_cache = objcache_create("cluster mbuf",
- &ncl_limit, 0,
+ ncl_limit, 0,
mclmeta_ctor, mclmeta_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mclmeta_malloc_args);
cl_limit += ncl_limit;
jcl_limit = nmbjclusters;
mjclmeta_cache = objcache_create("jcluster mbuf",
- &jcl_limit, 0,
+ jcl_limit, 0,
mjclmeta_ctor, mclmeta_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mclmeta_malloc_args);
cl_limit += jcl_limit;
limit = nmbclusters;
mbufcluster_cache = objcache_create("mbuf + cluster",
- &limit, nmbclusters / mcl_cachefrac,
+ limit, nmbclusters / mcl_cachefrac,
mbufcluster_ctor, mbufcluster_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
limit = nmbclusters;
mbufphdrcluster_cache = objcache_create("mbuf pkt hdr + cluster",
- &limit, nmbclusters / mclph_cachefrac,
+ limit, nmbclusters / mclph_cachefrac,
mbufphdrcluster_ctor, mbufcluster_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
limit = nmbjclusters / 4; /* XXX really rarely used */
mbufjcluster_cache = objcache_create("mbuf + jcluster",
- &limit, 0,
+ limit, 0,
mbufjcluster_ctor, mbufcluster_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
limit = nmbjclusters;
mbufphdrjcluster_cache = objcache_create("mbuf pkt hdr + jcluster",
- &limit, nmbjclusters / 16,
+ limit, nmbjclusters / 16,
mbufphdrjcluster_ctor, mbufcluster_dtor, NULL,
objcache_malloc_alloc, objcache_malloc_free, &mbuf_malloc_args);
mb_limit += limit;
struct objcache;
struct objcache
- *objcache_create(const char *name, int *cluster_limit, int nom_cache,
+ *objcache_create(const char *name, int cluster_limit, int nom_cache,
objcache_ctor_fn *ctor, objcache_dtor_fn *dtor,
void *privdata,
objcache_alloc_fn *alloc, objcache_free_fn *free,
*objcache_create_simple(malloc_type_t mtype, size_t objsize);
struct objcache
*objcache_create_mbacked(malloc_type_t mtype, size_t objsize,
- int *cluster_limit, int nom_cache,
+ int cluster_limit, int nom_cache,
objcache_ctor_fn *ctor, objcache_dtor_fn *dtor,
void *privdata);
void *objcache_get(struct objcache *oc, int ocflags);
{
parkpc = objcache_create_mbacked(M_PUFFS, sizeof(struct puffs_msgpark),
- NULL, 0, makepark, nukepark, NULL);
+ 0, 0, makepark, nukepark, NULL);
}
void