Lines Matching refs:hash

46  * in-use record is also on exactly one doubly-linked client id hash chain;
47 * the hash chains heads are contained in the header). For all other
49 * walking all of the hash chains. Here's a crude illustration of what
50 * this looks like on-disk (note that hash chains 2 and 3 are empty):
53 * | container info | hash chain heads (buckets) |
100 * when trying to achieve robustness is updating the client id hash chain.
103 * could leave our hash chains in an inconsistent state.
106 * the hash chains in the container. At any point in time, exactly one of
109 * operation, all hash chain modifications are done on the *inactive*
110 * image, then, once the inactive image has completed the hash chain
114 * image's hash chains to match the active image's hash chains.
118 * inactive image's hash chains with the active image's chains. Note that
323 uint16_t hash;
341 * our active image's hash chains correct and only swap to the
373 * (one call at a time) and set `recid' to hash
382 hash = cidhash(targetp->dn_cid,
384 if (read_hashhead(fd, &recid, hash, image)
400 hash = 0;
403 recid = header.dnh_cidhash[hash][image];
411 while (recid == DN_NOREC && ++hash < DN_CIDHASHSZ)
412 recid = header.dnh_cidhash[hash][image];
572 uint16_t hash;
585 hash = cidhash(addp->dn_cid, addp->dn_cid_len);
605 * We're going to insert `rec' at the head of the `hash' hash
607 * image's hash record id pointers so that the record will
610 if (read_hashhead(fd, &recid_head, hash, image) == -1)
619 * If there's a record currently on the hash chain (i.e, we're
638 * via hash.
644 * Update the alternate image's on-disk hash pointers. We need to
653 if (write_hashhead(fd, recid, hash, !image) == -1)
678 if (write_hashhead(fd, recid, hash, !image) == -1)
697 uint16_t hash;
729 hash = cidhash(rec.rec_dn.dn_cid, rec.rec_dn.dn_cid_len);
753 * Before we update the alternate image's on-disk hash pointers,
762 * Update the alternate image's on-disk hash pointers. We need to
779 if (write_hashhead(fd, rec.rec_next[image], hash, !image) == -1)
811 if (write_hashhead(fd, rec.rec_next[!image], hash, !image)
832 uint16_t hash, new_hash;
887 * Find out if our hash chain is changing. If so, then update the
894 hash = cidhash(rec.rec_dn.dn_cid, rec.rec_dn.dn_cid_len);
897 if (hash == new_hash) {
925 * If we've changed either the hash chain or the record id, then
927 * changing hash chains, then remove ourselves from the old
928 * hash chain and insert ourselves on the new one -- otherwise, if
933 if (hash != new_hash || recid != new_recid) {
943 if (hash != new_hash) {
959 if (write_hashhead(fd, rec_prev.rec_next[!image], hash,
965 * If our hash is changing, update the alternate image
968 if (hash != new_hash) {
1048 if (hash != new_hash || recid != new_recid) {
1059 if (write_hashhead(fd, rec.rec_next[image], hash,
1065 * If our hash changed, update the alternate image record
1068 if (hash != new_hash) {
1190 uint16_t hash;
1232 for (hash = 0; hash < DN_CIDHASHSZ; hash++) {
1233 header.dnh_cidhash[hash][!image] =
1234 header.dnh_cidhash[hash][image];
1287 * Given a `cid' that's `cidlen' bytes long, hash it to a value between 0
1288 * and DN_CIDHASHSZ - 1. We use CRC16 for our hash since it's known to be
1335 * order or the other way. If `hash' is false, then don't bother
1336 * converting the hash chains.
1340 nhconvert_header(dn_header_t *hdrp, boolean_t hash)
1350 if (hash) {
1392 * pointed to by `hdrp'; if `hash' is not set, then skip reading the
1393 * dn_header_t hash chains. Returns 0 on success, -1 on failure (errno is
1397 read_header(int fd, dn_header_t *hdrp, boolean_t hash)
1401 size = hash ? sizeof (dn_header_t) : offsetof(dn_header_t, dnh_cidhash);
1405 nhconvert_header(hdrp, hash);
1425 * Read in the head of the `cidhash' hash chain from open container `fd'
1441 * Write out the head of the `cidhash' hash chain into open container `fd'