mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix KMC_OFFSLAB type caches
Because spl_slab_size() was always returning -ENOSPC for caches of type KMC_OFFSLAB the cache could never be created. Additionally the slab size is rounded up to a page which is what kv_alloc() expects. The kv_alloc() code will minimally allocate a page, in the KMC_OFFSLAB case this could be reduced. The basic regression tests kmem:slab_small, kmem:slab_large, and kmem:slab_align regression were updated to test KMC_OFFSLAB. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ying Zhu <casualfisher@gmail.com> Closes #266
This commit is contained in:
@@ -1368,7 +1368,8 @@ spl_slab_size(spl_kmem_cache_t *skc, uint32_t *objs, uint32_t *size)
|
||||
|
||||
if (skc->skc_flags & KMC_OFFSLAB) {
|
||||
*objs = SPL_KMEM_CACHE_OBJ_PER_SLAB;
|
||||
*size = sizeof(spl_kmem_slab_t);
|
||||
*size = P2ROUNDUP(sizeof(spl_kmem_slab_t), PAGE_SIZE);
|
||||
SRETURN(0);
|
||||
} else {
|
||||
sks_size = spl_sks_size(skc);
|
||||
obj_size = spl_obj_size(skc);
|
||||
|
||||
Reference in New Issue
Block a user