MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zstd_mempool_init

Function zstd_mempool_init

freebsd/contrib/openzfs/module/zstd/zfs_zstd.c:654–668  ·  view source on GitHub ↗

Initialize memory pool barrier mutexes */

Source from the content-addressed store, hash-verified

652
653/* Initialize memory pool barrier mutexes */
654static void __init
655zstd_mempool_init(void)
656{
657 zstd_mempool_cctx = (struct zstd_pool *)
658 kmem_zalloc(ZSTD_POOL_MAX * sizeof (struct zstd_pool), KM_SLEEP);
659 zstd_mempool_dctx = (struct zstd_pool *)
660 kmem_zalloc(ZSTD_POOL_MAX * sizeof (struct zstd_pool), KM_SLEEP);
661
662 for (int i = 0; i < ZSTD_POOL_MAX; i++) {
663 mutex_init(&zstd_mempool_cctx[i].barrier, NULL,
664 MUTEX_DEFAULT, NULL);
665 mutex_init(&zstd_mempool_dctx[i].barrier, NULL,
666 MUTEX_DEFAULT, NULL);
667 }
668}
669
670/* Initialize zstd-related memory handling */
671static int __init

Callers 1

zstd_meminitFunction · 0.85

Calls 1

mutex_initFunction · 0.50

Tested by

no test coverage detected