4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * The 512-byte leaf is broken into 32 16-byte chunks.
30 * chunk number n means l_chunk[n], even though the header precedes it.
31 * the names are stored null-terminated.
34 #include <sys/zfs_context.h>
36 #include <sys/zap_impl.h>
37 #include <sys/zap_leaf.h>
41 #define CHAIN_END 0xffff /* end of the chunk chain */
43 /* half the (current) minimum block size */
44 #define MAX_ARRAY_BYTES (8<<10)
46 #define LEAF_HASH(l, h) \
47 ((ZAP_LEAF_HASH_NUMENTRIES(l)-1) & \
48 ((h) >> (64 - ZAP_LEAF_HASH_SHIFT(l)-(l)->l_phys->l_hdr.lh_prefix_len)))
50 #define LEAF_HASH_ENTPTR(l, h) (&(l)->l_phys->l_hash[LEAF_HASH(l, h)])
54 zap_memset(void *a, int c, size_t n)
64 stv(int len, void *addr, uint64_t value)
68 *(uint8_t *)addr = value;
71 *(uint16_t *)addr = value;
74 *(uint32_t *)addr = value;
77 *(uint64_t *)addr = value;
80 ASSERT(!"bad int len");
84 ldv(int len, const void *addr)
88 return (*(uint8_t *)addr);
90 return (*(uint16_t *)addr);
92 return (*(uint32_t *)addr);
94 return (*(uint64_t *)addr);
96 ASSERT(!"bad int len");
97 return (0xFEEDFACEDEADBEEFULL);
101 zap_leaf_byteswap(zap_leaf_phys_t *buf, int size)
105 l.l_bs = highbit(size)-1;
108 buf->l_hdr.lh_block_type = BSWAP_64(buf->l_hdr.lh_block_type);
109 buf->l_hdr.lh_prefix = BSWAP_64(buf->l_hdr.lh_prefix);
110 buf->l_hdr.lh_magic = BSWAP_32(buf->l_hdr.lh_magic);
111 buf->l_hdr.lh_nfree = BSWAP_16(buf->l_hdr.lh_nfree);
112 buf->l_hdr.lh_nentries = BSWAP_16(buf->l_hdr.lh_nentries);
113 buf->l_hdr.lh_prefix_len = BSWAP_16(buf->l_hdr.lh_prefix_len);
114 buf->l_hdr.lh_freelist = BSWAP_16(buf->l_hdr.lh_freelist);
116 for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(&l); i++)
117 buf->l_hash[i] = BSWAP_16(buf->l_hash[i]);
119 for (i = 0; i < ZAP_LEAF_NUMCHUNKS(&l); i++) {
120 zap_leaf_chunk_t *lc = &ZAP_LEAF_CHUNK(&l, i);
121 struct zap_leaf_entry *le;
123 switch (lc->l_free.lf_type) {
124 case ZAP_CHUNK_ENTRY:
127 le->le_type = BSWAP_8(le->le_type);
128 le->le_int_size = BSWAP_8(le->le_int_size);
129 le->le_next = BSWAP_16(le->le_next);
130 le->le_name_chunk = BSWAP_16(le->le_name_chunk);
131 le->le_name_length = BSWAP_16(le->le_name_length);
132 le->le_value_chunk = BSWAP_16(le->le_value_chunk);
133 le->le_value_length = BSWAP_16(le->le_value_length);
134 le->le_cd = BSWAP_32(le->le_cd);
135 le->le_hash = BSWAP_64(le->le_hash);
138 lc->l_free.lf_type = BSWAP_8(lc->l_free.lf_type);
139 lc->l_free.lf_next = BSWAP_16(lc->l_free.lf_next);
141 case ZAP_CHUNK_ARRAY:
142 lc->l_array.la_type = BSWAP_8(lc->l_array.la_type);
143 lc->l_array.la_next = BSWAP_16(lc->l_array.la_next);
144 /* la_array doesn't need swapping */
147 ASSERT(!"bad leaf type");
153 zap_leaf_init(zap_leaf_t *l)
157 l->l_bs = highbit(l->l_dbuf->db_size)-1;
158 zap_memset(&l->l_phys->l_hdr, 0, sizeof (struct zap_leaf_header));
159 zap_memset(l->l_phys->l_hash, CHAIN_END, 2*ZAP_LEAF_HASH_NUMENTRIES(l));
160 for (i = 0; i < ZAP_LEAF_NUMCHUNKS(l); i++) {
161 ZAP_LEAF_CHUNK(l, i).l_free.lf_type = ZAP_CHUNK_FREE;
162 ZAP_LEAF_CHUNK(l, i).l_free.lf_next = i+1;
164 ZAP_LEAF_CHUNK(l, ZAP_LEAF_NUMCHUNKS(l)-1).l_free.lf_next = CHAIN_END;
165 l->l_phys->l_hdr.lh_block_type = ZBT_LEAF;
166 l->l_phys->l_hdr.lh_magic = ZAP_LEAF_MAGIC;
167 l->l_phys->l_hdr.lh_nfree = ZAP_LEAF_NUMCHUNKS(l);
171 * Routines which manipulate leaf chunks (l_chunk[]).
175 zap_leaf_chunk_alloc(zap_leaf_t *l)
179 ASSERT(l->l_phys->l_hdr.lh_nfree > 0);
181 chunk = l->l_phys->l_hdr.lh_freelist;
182 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
183 ASSERT3U(ZAP_LEAF_CHUNK(l, chunk).l_free.lf_type, ==, ZAP_CHUNK_FREE);
185 l->l_phys->l_hdr.lh_freelist = ZAP_LEAF_CHUNK(l, chunk).l_free.lf_next;
187 l->l_phys->l_hdr.lh_nfree--;
193 zap_leaf_chunk_free(zap_leaf_t *l, uint16_t chunk)
195 struct zap_leaf_free *zlf = &ZAP_LEAF_CHUNK(l, chunk).l_free;
196 ASSERT3U(l->l_phys->l_hdr.lh_nfree, <, ZAP_LEAF_NUMCHUNKS(l));
197 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
198 ASSERT(zlf->lf_type != ZAP_CHUNK_FREE);
200 zlf->lf_type = ZAP_CHUNK_FREE;
201 zlf->lf_next = l->l_phys->l_hdr.lh_freelist;
202 bzero(zlf->lf_pad, sizeof (zlf->lf_pad)); /* help it to compress */
203 l->l_phys->l_hdr.lh_freelist = chunk;
205 l->l_phys->l_hdr.lh_nfree++;
209 * Routines which manipulate leaf arrays (zap_leaf_array type chunks).
213 zap_leaf_array_create(zap_leaf_t *l, const char *buf,
214 int integer_size, int num_integers)
217 uint16_t *chunkp = &chunk_head;
220 int shift = (integer_size-1)*8;
221 int len = num_integers;
223 ASSERT3U(num_integers * integer_size, <, MAX_ARRAY_BYTES);
226 uint16_t chunk = zap_leaf_chunk_alloc(l);
227 struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(l, chunk).l_array;
230 la->la_type = ZAP_CHUNK_ARRAY;
231 for (i = 0; i < ZAP_LEAF_ARRAY_BYTES; i++) {
233 value = ldv(integer_size, buf);
234 la->la_array[i] = value >> shift;
236 if (++byten == integer_size) {
245 chunkp = &la->la_next;
253 zap_leaf_array_free(zap_leaf_t *l, uint16_t *chunkp)
255 uint16_t chunk = *chunkp;
259 while (chunk != CHAIN_END) {
260 int nextchunk = ZAP_LEAF_CHUNK(l, chunk).l_array.la_next;
261 ASSERT3U(ZAP_LEAF_CHUNK(l, chunk).l_array.la_type, ==,
263 zap_leaf_chunk_free(l, chunk);
268 /* array_len and buf_len are in integers, not bytes */
270 zap_leaf_array_read(zap_leaf_t *l, uint16_t chunk,
271 int array_int_len, int array_len, int buf_int_len, uint64_t buf_len,
274 int len = MIN(array_len, buf_len);
278 ASSERT3U(array_int_len, <=, buf_int_len);
280 /* Fast path for one 8-byte integer */
281 if (array_int_len == 8 && buf_int_len == 8 && len == 1) {
282 struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(l, chunk).l_array;
283 uint8_t *ip = la->la_array;
284 uint64_t *buf64 = (uint64_t *)buf;
286 *buf64 = (uint64_t)ip[0] << 56 | (uint64_t)ip[1] << 48 |
287 (uint64_t)ip[2] << 40 | (uint64_t)ip[3] << 32 |
288 (uint64_t)ip[4] << 24 | (uint64_t)ip[5] << 16 |
289 (uint64_t)ip[6] << 8 | (uint64_t)ip[7];
293 /* Fast path for an array of 1-byte integers (eg. the entry name) */
294 if (array_int_len == 1 && buf_int_len == 1 &&
295 buf_len > array_len + ZAP_LEAF_ARRAY_BYTES) {
296 while (chunk != CHAIN_END) {
297 struct zap_leaf_array *la =
298 &ZAP_LEAF_CHUNK(l, chunk).l_array;
299 bcopy(la->la_array, buf, ZAP_LEAF_ARRAY_BYTES);
300 buf += ZAP_LEAF_ARRAY_BYTES;
307 struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(l, chunk).l_array;
310 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
311 for (i = 0; i < ZAP_LEAF_ARRAY_BYTES && len > 0; i++) {
312 value = (value << 8) | la->la_array[i];
314 if (byten == array_int_len) {
315 stv(buf_int_len, buf, value);
328 * Only to be used on 8-bit arrays.
329 * array_len is actual len in bytes (not encoded le_value_length).
330 * buf is null-terminated.
333 zap_leaf_array_equal(zap_leaf_t *l, int chunk,
334 int array_len, const char *buf)
338 while (bseen < array_len) {
339 struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(l, chunk).l_array;
340 int toread = MIN(array_len - bseen, ZAP_LEAF_ARRAY_BYTES);
341 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
342 if (bcmp(la->la_array, buf + bseen, toread))
347 return (bseen == array_len);
351 * Routines which manipulate leaf entries.
355 zap_leaf_lookup(zap_leaf_t *l,
356 const char *name, uint64_t h, zap_entry_handle_t *zeh)
359 struct zap_leaf_entry *le;
361 ASSERT3U(l->l_phys->l_hdr.lh_magic, ==, ZAP_LEAF_MAGIC);
363 for (chunkp = LEAF_HASH_ENTPTR(l, h);
364 *chunkp != CHAIN_END; chunkp = &le->le_next) {
365 uint16_t chunk = *chunkp;
366 le = ZAP_LEAF_ENTRY(l, chunk);
368 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
369 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
371 if (le->le_hash != h)
374 if (zap_leaf_array_equal(l, le->le_name_chunk,
375 le->le_name_length, name)) {
376 zeh->zeh_num_integers = le->le_value_length;
377 zeh->zeh_integer_size = le->le_int_size;
378 zeh->zeh_cd = le->le_cd;
379 zeh->zeh_hash = le->le_hash;
380 zeh->zeh_chunkp = chunkp;
389 /* Return (h1,cd1 >= h2,cd2) */
390 #define HCD_GTEQ(h1, cd1, h2, cd2) \
391 ((h1 > h2) ? TRUE : ((h1 == h2 && cd1 >= cd2) ? TRUE : FALSE))
394 zap_leaf_lookup_closest(zap_leaf_t *l,
395 uint64_t h, uint32_t cd, zap_entry_handle_t *zeh)
398 uint64_t besth = -1ULL;
399 uint32_t bestcd = ZAP_MAXCD;
400 uint16_t bestlh = ZAP_LEAF_HASH_NUMENTRIES(l)-1;
402 struct zap_leaf_entry *le;
404 ASSERT3U(l->l_phys->l_hdr.lh_magic, ==, ZAP_LEAF_MAGIC);
406 for (lh = LEAF_HASH(l, h); lh <= bestlh; lh++) {
407 for (chunk = l->l_phys->l_hash[lh];
408 chunk != CHAIN_END; chunk = le->le_next) {
409 le = ZAP_LEAF_ENTRY(l, chunk);
411 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
412 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
414 if (HCD_GTEQ(le->le_hash, le->le_cd, h, cd) &&
415 HCD_GTEQ(besth, bestcd, le->le_hash, le->le_cd)) {
416 ASSERT3U(bestlh, >=, lh);
421 zeh->zeh_num_integers = le->le_value_length;
422 zeh->zeh_integer_size = le->le_int_size;
423 zeh->zeh_cd = le->le_cd;
424 zeh->zeh_hash = le->le_hash;
425 zeh->zeh_fakechunk = chunk;
426 zeh->zeh_chunkp = &zeh->zeh_fakechunk;
432 return (bestcd == ZAP_MAXCD ? ENOENT : 0);
436 zap_entry_read(const zap_entry_handle_t *zeh,
437 uint8_t integer_size, uint64_t num_integers, void *buf)
439 struct zap_leaf_entry *le =
440 ZAP_LEAF_ENTRY(zeh->zeh_leaf, *zeh->zeh_chunkp);
441 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
443 if (le->le_int_size > integer_size)
446 zap_leaf_array_read(zeh->zeh_leaf, le->le_value_chunk, le->le_int_size,
447 le->le_value_length, integer_size, num_integers, buf);
449 if (zeh->zeh_num_integers > num_integers)
456 zap_entry_read_name(const zap_entry_handle_t *zeh, uint16_t buflen, char *buf)
458 struct zap_leaf_entry *le =
459 ZAP_LEAF_ENTRY(zeh->zeh_leaf, *zeh->zeh_chunkp);
460 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
462 zap_leaf_array_read(zeh->zeh_leaf, le->le_name_chunk, 1,
463 le->le_name_length, 1, buflen, buf);
464 if (le->le_name_length > buflen)
470 zap_entry_update(zap_entry_handle_t *zeh,
471 uint8_t integer_size, uint64_t num_integers, const void *buf)
474 zap_leaf_t *l = zeh->zeh_leaf;
475 struct zap_leaf_entry *le = ZAP_LEAF_ENTRY(l, *zeh->zeh_chunkp);
477 delta_chunks = ZAP_LEAF_ARRAY_NCHUNKS(num_integers * integer_size) -
478 ZAP_LEAF_ARRAY_NCHUNKS(le->le_value_length * le->le_int_size);
480 if ((int)l->l_phys->l_hdr.lh_nfree < delta_chunks)
484 * We should search other chained leaves (via
485 * zap_entry_remove,create?) otherwise returning EAGAIN will
486 * just send us into an infinite loop if we have to chain
487 * another leaf block, rather than being able to split this
491 zap_leaf_array_free(l, &le->le_value_chunk);
493 zap_leaf_array_create(l, buf, integer_size, num_integers);
494 le->le_value_length = num_integers;
495 le->le_int_size = integer_size;
500 zap_entry_remove(zap_entry_handle_t *zeh)
502 uint16_t entry_chunk;
503 struct zap_leaf_entry *le;
504 zap_leaf_t *l = zeh->zeh_leaf;
506 ASSERT3P(zeh->zeh_chunkp, !=, &zeh->zeh_fakechunk);
508 entry_chunk = *zeh->zeh_chunkp;
509 le = ZAP_LEAF_ENTRY(l, entry_chunk);
510 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
512 zap_leaf_array_free(l, &le->le_name_chunk);
513 zap_leaf_array_free(l, &le->le_value_chunk);
515 *zeh->zeh_chunkp = le->le_next;
516 zap_leaf_chunk_free(l, entry_chunk);
518 l->l_phys->l_hdr.lh_nentries--;
522 zap_entry_create(zap_leaf_t *l, const char *name, uint64_t h, uint32_t cd,
523 uint8_t integer_size, uint64_t num_integers, const void *buf,
524 zap_entry_handle_t *zeh)
528 struct zap_leaf_entry *le;
529 uint64_t namelen, valuelen;
532 valuelen = integer_size * num_integers;
533 namelen = strlen(name) + 1;
534 ASSERT(namelen >= 2);
536 numchunks = 1 + ZAP_LEAF_ARRAY_NCHUNKS(namelen) +
537 ZAP_LEAF_ARRAY_NCHUNKS(valuelen);
538 if (numchunks > ZAP_LEAF_NUMCHUNKS(l))
541 if (cd == ZAP_MAXCD) {
542 for (cd = 0; cd < ZAP_MAXCD; cd++) {
543 for (chunk = *LEAF_HASH_ENTPTR(l, h);
544 chunk != CHAIN_END; chunk = le->le_next) {
545 le = ZAP_LEAF_ENTRY(l, chunk);
546 if (le->le_hash == h &&
551 /* If this cd is not in use, we are good. */
552 if (chunk == CHAIN_END)
555 /* If we tried all the cd's, we lose. */
560 if (l->l_phys->l_hdr.lh_nfree < numchunks)
564 chunk = zap_leaf_chunk_alloc(l);
565 le = ZAP_LEAF_ENTRY(l, chunk);
566 le->le_type = ZAP_CHUNK_ENTRY;
567 le->le_name_chunk = zap_leaf_array_create(l, name, 1, namelen);
568 le->le_name_length = namelen;
570 zap_leaf_array_create(l, buf, integer_size, num_integers);
571 le->le_value_length = num_integers;
572 le->le_int_size = integer_size;
576 /* link it into the hash chain */
577 chunkp = LEAF_HASH_ENTPTR(l, h);
578 le->le_next = *chunkp;
581 l->l_phys->l_hdr.lh_nentries++;
584 zeh->zeh_num_integers = num_integers;
585 zeh->zeh_integer_size = le->le_int_size;
586 zeh->zeh_cd = le->le_cd;
587 zeh->zeh_hash = le->le_hash;
588 zeh->zeh_chunkp = chunkp;
594 * Routines for transferring entries between leafs.
598 zap_leaf_rehash_entry(zap_leaf_t *l, uint16_t entry)
600 struct zap_leaf_entry *le = ZAP_LEAF_ENTRY(l, entry);
601 uint16_t *ptr = LEAF_HASH_ENTPTR(l, le->le_hash);
607 zap_leaf_transfer_array(zap_leaf_t *l, uint16_t chunk, zap_leaf_t *nl)
610 uint16_t *nchunkp = &new_chunk;
612 while (chunk != CHAIN_END) {
613 uint16_t nchunk = zap_leaf_chunk_alloc(nl);
614 struct zap_leaf_array *nla =
615 &ZAP_LEAF_CHUNK(nl, nchunk).l_array;
616 struct zap_leaf_array *la =
617 &ZAP_LEAF_CHUNK(l, chunk).l_array;
618 int nextchunk = la->la_next;
620 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
621 ASSERT3U(nchunk, <, ZAP_LEAF_NUMCHUNKS(l));
623 *nla = *la; /* structure assignment */
625 zap_leaf_chunk_free(l, chunk);
628 nchunkp = &nla->la_next;
630 *nchunkp = CHAIN_END;
635 zap_leaf_transfer_entry(zap_leaf_t *l, int entry, zap_leaf_t *nl)
637 struct zap_leaf_entry *le, *nle;
640 le = ZAP_LEAF_ENTRY(l, entry);
641 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
643 chunk = zap_leaf_chunk_alloc(nl);
644 nle = ZAP_LEAF_ENTRY(nl, chunk);
645 *nle = *le; /* structure assignment */
647 zap_leaf_rehash_entry(nl, chunk);
649 nle->le_name_chunk = zap_leaf_transfer_array(l, le->le_name_chunk, nl);
650 nle->le_value_chunk =
651 zap_leaf_transfer_array(l, le->le_value_chunk, nl);
653 zap_leaf_chunk_free(l, entry);
655 l->l_phys->l_hdr.lh_nentries--;
656 nl->l_phys->l_hdr.lh_nentries++;
660 * Transfer the entries whose hash prefix ends in 1 to the new leaf.
663 zap_leaf_split(zap_leaf_t *l, zap_leaf_t *nl)
666 int bit = 64 - 1 - l->l_phys->l_hdr.lh_prefix_len;
668 /* set new prefix and prefix_len */
669 l->l_phys->l_hdr.lh_prefix <<= 1;
670 l->l_phys->l_hdr.lh_prefix_len++;
671 nl->l_phys->l_hdr.lh_prefix = l->l_phys->l_hdr.lh_prefix | 1;
672 nl->l_phys->l_hdr.lh_prefix_len = l->l_phys->l_hdr.lh_prefix_len;
674 /* break existing hash chains */
675 zap_memset(l->l_phys->l_hash, CHAIN_END, 2*ZAP_LEAF_HASH_NUMENTRIES(l));
678 * Transfer entries whose hash bit 'bit' is set to nl; rehash
679 * the remaining entries
681 * NB: We could find entries via the hashtable instead. That
682 * would be O(hashents+numents) rather than O(numblks+numents),
683 * but this accesses memory more sequentially, and when we're
684 * called, the block is usually pretty full.
686 for (i = 0; i < ZAP_LEAF_NUMCHUNKS(l); i++) {
687 struct zap_leaf_entry *le = ZAP_LEAF_ENTRY(l, i);
688 if (le->le_type != ZAP_CHUNK_ENTRY)
691 if (le->le_hash & (1ULL << bit))
692 zap_leaf_transfer_entry(l, i, nl);
694 zap_leaf_rehash_entry(l, i);
699 zap_leaf_stats(zap_t *zap, zap_leaf_t *l, zap_stats_t *zs)
703 n = zap->zap_f.zap_phys->zap_ptrtbl.zt_shift -
704 l->l_phys->l_hdr.lh_prefix_len;
705 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
706 zs->zs_leafs_with_2n_pointers[n]++;
709 n = l->l_phys->l_hdr.lh_nentries/5;
710 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
711 zs->zs_blocks_with_n5_entries[n]++;
713 n = ((1<<FZAP_BLOCK_SHIFT(zap)) -
714 l->l_phys->l_hdr.lh_nfree * (ZAP_LEAF_ARRAY_BYTES+1))*10 /
715 (1<<FZAP_BLOCK_SHIFT(zap));
716 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
717 zs->zs_blocks_n_tenths_full[n]++;
719 for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(l); i++) {
721 int chunk = l->l_phys->l_hash[i];
723 while (chunk != CHAIN_END) {
724 struct zap_leaf_entry *le =
725 ZAP_LEAF_ENTRY(l, chunk);
727 n = 1 + ZAP_LEAF_ARRAY_NCHUNKS(le->le_name_length) +
728 ZAP_LEAF_ARRAY_NCHUNKS(le->le_value_length *
730 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
731 zs->zs_entries_using_n_chunks[n]++;
738 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
739 zs->zs_buckets_with_n_entries[n]++;