74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * CDDL HEADER START
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * The contents of this file are subject to the terms of the
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * Common Development and Distribution License, Version 1.0 only
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * (the "License"). You may not use this file except in compliance
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * with the License.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * or http://www.opensolaris.org/os/licensing.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * See the License for the specific language governing permissions
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * and limitations under the License.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * When distributing Covered Code, include this CDDL HEADER in each
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * If applicable, add the following below this CDDL HEADER, with the
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * fields enclosed by brackets "[]" replaced with your own identifying
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * information: Portions Copyright [yyyy] [name of copyright owner]
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * CDDL HEADER END
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
71d35b6b5563817dfbe757ab9e3b9f018b2db491Thomas Hindoe Paaboel Andersen * Use is subject to license terms.
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering#pragma ident "%Z%%M% %I% %E% SMI"
71d35b6b5563817dfbe757ab9e3b9f018b2db491Thomas Hindoe Paaboel Andersen/* array of the sets */
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering/* for the addresses of each set above */
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering * routines to snarf the metaset information
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering * usage: ::dumpsetaddr [-s setname]
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringdumpsetaddr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering if (mdb_getopts(argc, argv, 's', MDB_OPT_STR, &s_opt,
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering /* left over arguments ?? */
23b298bce75a0d1f4f15f34458af9678b4a30c3aLennart Poettering mdb_warn("No sets read in yet - try ::metaset\n");
23b298bce75a0d1f4f15f34458af9678b4a30c3aLennart Poettering for (i = 0; i < md_nsets; i++) {
51323288fc628a5cac50914df915545d685b793eLennart Poettering mdb_printf("%d %p\n", i, mdset_addrs[i]);
ae6a4bbf318e197813227e50c245a00de03784a2Lennart Poettering * Function: snarf_ui_anchor
ae6a4bbf318e197813227e50c245a00de03784a2Lennart Poettering * Purpose: to read in the s_ui part of a metaset.
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering * Returns: <n> - number of configured metadevices
7cc6ed7ba6c667caef9a92ba4d59e1ecdc3af8ffLennart Poettering * -1 - not configured
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poettering for (j = 0; j < md_nunits; j++) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering if (mdb_vread(&addr, sizeof (void *), (uintptr_t)ptr) == -1) {
7588460aaf6bd33f6c9bd5645916cfd8a862e9c4Tom Gundersen * Function: snarf_sets
7588460aaf6bd33f6c9bd5645916cfd8a862e9c4Tom Gundersen * Purpose: Entry point into the module that reads the kernel's version
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering * of the SVM configuration.
547973dea7abd6c124ff6c79fe2bbe322a7314aeLennart Poettering * First of all populates the mdset array and then for each
801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47ddLennart Poettering * component that makes up an "md_set_t" reads it in, via calls
23b298bce75a0d1f4f15f34458af9678b4a30c3aLennart Poettering * to other functions.
23b298bce75a0d1f4f15f34458af9678b4a30c3aLennart Poettering /* find the SVM hook - md_set */
23b298bce75a0d1f4f15f34458af9678b4a30c3aLennart Poettering if (mdb_lookup_by_name("md_set", &setsym) == -1) {
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering mdb_warn("SVM is not configured on this machine\n");
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
if (md_verbose) {
for (i = 0; i < md_nsets; i++) {
if (md_verbose)
return (DCMD_ERR);
return (DCMD_ERR);
active_sets++;
(void) snarf_ui_anchor(i);
if (md_verbose) {
return (DCMD_OK);