4 * This file and its contents are supplied under the terms of the
5 * Common Development and Distribution License ("CDDL"), version 1.0.
6 * You may only use this file in accordance with the terms of version
9 * A full copy of the text of the CDDL should have accompanied this
10 * source. A copy of the CDDL is also available via the Internet at
11 * http://www.illumos.org/license/CDDL.
16 * Copyright (c) 2017 by Delphix. All rights reserved.
22 #include <sys/zfs_context.h>
28 typedef struct aggsum_bucket aggsum_bucket_t
;
30 struct aggsum_bucket
{
33 uint64_t asc_borrowed
;
34 } ____cacheline_aligned
;
37 * Fan out over FANOUT cpus.
39 typedef struct aggsum
{
41 int64_t as_lower_bound
;
42 uint64_t as_upper_bound
;
43 aggsum_bucket_t
*as_buckets ____cacheline_aligned
;
45 uint_t as_bucketshift
;
48 void aggsum_init(aggsum_t
*, uint64_t);
49 void aggsum_fini(aggsum_t
*);
50 int64_t aggsum_lower_bound(aggsum_t
*);
51 uint64_t aggsum_upper_bound(aggsum_t
*);
52 int aggsum_compare(aggsum_t
*, uint64_t);
53 uint64_t aggsum_value(aggsum_t
*);
54 void aggsum_add(aggsum_t
*, int64_t);
60 #endif /* _SYS_AGGSUM_H */