refcount.c revision 91ebeef555ce7f899b6270a3c2df47b51f7ad59a
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
91ebeef555ce7f899b6270a3c2df47b51f7ad59aahrens * Common Development and Distribution License (the "License").
91ebeef555ce7f899b6270a3c2df47b51f7ad59aahrens * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
91ebeef555ce7f899b6270a3c2df47b51f7ad59aahrens * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrens#pragma ident "%Z%%M% %I% %E% SMI"
fa9e4066f08beec538e775443c5be79dd423fcabahrensint reference_tracking_enable = FALSE; /* runs out of memory too easily */
fa9e4066f08beec538e775443c5be79dd423fcabahrens reference_cache = kmem_cache_create("reference_cache",
fa9e4066f08beec538e775443c5be79dd423fcabahrens sizeof (reference_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
fa9e4066f08beec538e775443c5be79dd423fcabahrens reference_history_cache = kmem_cache_create("reference_history_cache",
fa9e4066f08beec538e775443c5be79dd423fcabahrens sizeof (uint64_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
fa9e4066f08beec538e775443c5be79dd423fcabahrensrefcount_destroy_many(refcount_t *rc, uint64_t number)
fa9e4066f08beec538e775443c5be79dd423fcabahrens kmem_cache_free(reference_history_cache, ref->ref_removed);
fa9e4066f08beec538e775443c5be79dd423fcabahrensrefcount_add_many(refcount_t *rc, uint64_t number, void *holder)
fa9e4066f08beec538e775443c5be79dd423fcabahrensrefcount_remove_many(refcount_t *rc, uint64_t number, void *holder)
fa9e4066f08beec538e775443c5be79dd423fcabahrens if (ref->ref_holder == holder && ref->ref_number == number) {
fa9e4066f08beec538e775443c5be79dd423fcabahrens return (-1);