FreeBSD/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
/*
 * Using the specified dedup table, do a lookup for an entry with
 * the checksum cs.  If found, return the block's reference info
 * in *dr. Otherwise, insert a new entry in the dedup table, using
 * the reference information specified by *dr.
 *
 * return value:  true - entry was found
 *		  false - entry was not found
 */
Using the specified dedup table, do a lookup for an entry with
the checksum cs.  If found, return the block's reference info
in *dr. Otherwise, insert a new entry in the dedup table, using
the reference information specified by *dr.

return value:  true - entry was found
false - entry was not found
Using the specified dedup table do a lookup for an entry with the checksum cs . If found return the block ' s reference info in * dr . Otherwise insert a new entry in the dedup table using the reference information specified by * dr . return value : true - entry was found false - entry was not found
static boolean_t
ddt_update(libzfs_handle_t *hdl, dedup_table_t *ddt, zio_cksum_t *cs,
    uint64_t prop, dataref_t *dr)
{
	uint32_t hashcode;
	dedup_entry_t **ddepp;
	hashcode = BF64_GET(cs->zc_word[0], 0, ddt->numhashbits);
	for (ddepp = &(ddt->dedup_hash_array[hashcode]); *ddepp != NULL;
	    ddepp = &((*ddepp)->dde_next)) {
		if (ZIO_CHECKSUM_EQUAL(((*ddepp)->dde_chksum), *cs) &&
		    (*ddepp)->dde_prop == prop) {
			*dr = (*ddepp)->dde_ref;
			return (B_TRUE);
		}
	}
	ddt_hash_append(hdl, ddt, ddepp, cs, prop, dr);
	return (B_FALSE);
}
static boolean_t ddt_update ( libzfs_handle_t * hdl , dedup_table_t * ddt , zio_cksum_t * cs , uint64_t prop , dataref_t * dr ) { uint32_t hashcode ; dedup_entry_t * * ddepp ; hashcode = BF64_GET ( cs -> zc_word [ 0 ] , 0 , ddt -> numhashbits ) ; for ( ddepp = & ( ddt -> dedup_hash_array [ hashcode ] ) ; * ddepp != NULL ; ddepp = & ( ( * ddepp ) -> dde_next ) ) { if ( ZIO_CHECKSUM_EQUAL ( ( ( * ddepp ) -> dde_chksum ) , * cs ) && ( * ddepp ) -> dde_prop == prop ) { * dr = ( * ddepp ) -> dde_ref ; return ( B_TRUE ) ; } } ddt_hash_append ( hdl , ddt , ddepp , cs , prop , dr ) ; return ( B_FALSE ) ; }
Using the specified dedup table, do a lookup for an entry with
 the checksum cs.
Using the specified dedup table do a lookup for an entry with the checksum cs .