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

Function aggsum_init

freebsd/contrib/openzfs/module/zfs/aggsum.c:87–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85static uint_t aggsum_borrow_multiplier = 10;
86
87void
88aggsum_init(aggsum_t *as, uint64_t value)
89{
90 bzero(as, sizeof (*as));
91 as->as_lower_bound = as->as_upper_bound = value;
92 mutex_init(&as->as_lock, NULL, MUTEX_DEFAULT, NULL);
93 as->as_numbuckets = boot_ncpus;
94 as->as_buckets = kmem_zalloc(boot_ncpus * sizeof (aggsum_bucket_t),
95 KM_SLEEP);
96 for (int i = 0; i < as->as_numbuckets; i++) {
97 mutex_init(&as->as_buckets[i].asc_lock,
98 NULL, MUTEX_DEFAULT, NULL);
99 }
100}
101
102void
103aggsum_fini(aggsum_t *as)

Callers 2

arc_state_initFunction · 0.85
dataset_kstats_createFunction · 0.85

Calls 2

bzeroFunction · 0.85
mutex_initFunction · 0.50

Tested by

no test coverage detected