kernel - Add zero-on-instantiate objcache ctor
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 24 Jun 2015 05:59:15 +0000 (22:59 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 24 Jun 2015 05:59:15 +0000 (22:59 -0700)
commit7d4ac97cda38def7d38fbb3803e02f089ab5ef5f
tree841a0d1fe08489d226ada60da49e442e29fa2776
parent1fe61e9ccd451743793013781cd39b2a6362ab3f
kernel - Add zero-on-instantiate objcache ctor

* When creating kmalloc-backed pools, M_ZERO cannot be passed to
  objcache_get() because the underlying kmalloc only occurs when
  the objcache is not recycling a cached entry.

* Add a feature to the objcache whereby the allocation from backing
  store is zero'd.  The reuse case will not be zerod, so users of
  this type of objcache must properly reset/cleanup fields before
  disposing of the object.

* Used by HAMMER2.
sys/kern/kern_objcache.c
sys/sys/objcache.h