metaslab.c revision 5f5f7a6f9c8e9c1587a54e690556d756ec67558c
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
b38741657f2b4824e5595acf790b1d2eb9d761f0John Harres * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ==========================================================================
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Metaslab classes
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ==========================================================================
4c841f6070b4f88f9dc008de526b313bbebd4e32marks mc = kmem_zalloc(sizeof (metaslab_class_t), KM_SLEEP);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwmetaslab_class_add(metaslab_class_t *mc, metaslab_group_t *mg)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwmetaslab_class_remove(metaslab_class_t *mc, metaslab_group_t *mg)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ==========================================================================
89459e17032b6bb1d59eebd2b7c0d06859d4657cMark Shellenbaum * Metaslab groups
148434217c040ea38dc844384f6ba68d9b325906Matthew Ahrens * ==========================================================================
148434217c040ea38dc844384f6ba68d9b325906Matthew Ahrensmetaslab_compare(const void *x1, const void *x2)
e0d35c4478bf9fd4080951b5b9d1f9a38948ba69marks return (1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If the weights are identical, use the offset to force uniqueness.
return (mg);
static uint64_t
return (offset);
if (*cursor == 0)
*cursor = 0;
if (txg != 0) {
return (msp);
for (t = 0; t < TXG_SIZE; t++) {
#define METASLAB_ACTIVE_MASK \
static uint64_t
return (weight);
if (error) {
return (error);
for (t = 0; t < TXG_SIZE; t++) {
evictable = 0;
if (evictable)
static uint64_t
static uint64_t
return (offset);
int all_zero;
if (hintdva) {
top:
distance = 0;
if (!all_zero) {
dshift++;
goto top;
return (ENOSPC);
ASSERT(0);
if (now) {
int error;
return (ENXIO);
if (error) {
return (error);
int error = 0;
for (d = 0; d < ndvas; d++) {
if (error) {
return (error);
for (d = 0; d < ndvas; d++)
int d, error;
int last_error = 0;
for (d = 0; d < ndvas; d++)
return (last_error);