/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include <libintl.h>
#include "volume_defaults.h"
#include "volume_error.h"
/*
* Methods which manipulate a defaults_t struct
*/
static int defaults_get_singleton_component(
/*
* Constructor: Create a defaults_t struct populated with default
* values. This defaults_t must be freed.
*
* @param defaults
* RETURN: a pointer to a new defaults_t
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
{
int error = 0;
return (-1);
}
/*
* Create initial "global" (disk set-independent) defaults, as
* a devconfig_t of type disk set with NULL name
*/
return (error);
}
/* Append global defaults disk set to disksets */
/* Set defaults */
if ((error = defaults_set_mirror_nsubs(
return (error);
}
return (0);
}
/*
* Free memory (recursively) allocated to a defaults_t struct
*
* @param arg
* pointer to the defaults_t struct to free
*/
void
void *arg)
{
return;
}
/* Free the disksets */
}
/* Free the devconfig itself */
}
/*
* Set list of diskset specific defaults
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param disksets
* a dlist_t representing the defaults for specific
* named disk sets
*/
void
{
}
/*
* Get list of diskset specific defaults
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @return a dlist_t representing the defaults for specific
* named disk sets
*/
dlist_t *
{
}
/*
* Get a disk set with the given name from the given defaults_t
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param name
* the name of the disk set whose defaults to retrieve,
* or NULL to get the defaults for all disk sets
*
* @param diskset
* RETURN: defaults for the given named disk set, or
* defaults for all disk sets if name is NULL
*
* @return ENOENT
* if the named disk set does not exist
*
* @return 0
* if the named disk set exists
*/
int
char *name,
{
/* Get list of disk sets */
/* For each disk set-specific defaults... */
/* Get the name if this disk set */
devconfig_get_name(d, &dname);
/* Do the names match? */
if (
/* Global defaults disk set */
/* Named disk set */
*diskset = d;
break;
}
}
}
/* Diskset doesn't exist */
return (ENOENT);
}
return (0);
}
/*
* Get the first component of the given type from the given disk set.
* If not found, create the component if requested.
*
* @return ENOENT
* if the given disk set does not exist, or it exists,
* but the requested component does not exist under it
* and its creation was not requested
*
* @return 0
* if the requested component exists or was created
*
* @return non-zero
* if the requested component does not exist and could
* not be created
*/
static int
char *disksetname,
{
int error;
/* Get the disk set referred to */
if ((error = defaults_get_diskset_by_name(
gettext("could not get defaults for disk set %s"),
return (error);
}
/*
* Get the singleton component under this disk set, create if
* requested
*/
}
/*
* Set name of the the default HSP to use
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param name
* the name of the default HSP to use
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
char *name)
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the name attribute */
}
/*
* Get the name of the default HSP to use
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param name
* RETURN: the name of the default HSP to use
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
char **name)
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* HSP found for this disk set */
case 0:
/* Get the nsubs attribute */
/* nsubs attribute found */
return (0);
}
/* FALLTHROUGH */
/* HSP not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or HSP couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default number of submirrors for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default number of submirrors
* for mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the nsubs attribute */
}
/*
* Get the default number of submirrors for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default number of submirrors for mirrored
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* mirror found for this disk set */
case 0:
/* Get the nsubs attribute */
if ((error = devconfig_get_mirror_nsubs(
/* nsubs attribute found */
return (0);
}
/* FALLTHROUGH */
/* mirror not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or mirror couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default read strategy for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default read strategy for
* mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the read attribute */
}
/*
* Get the default read strategy for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default read strategy for mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* mirror found for this disk set */
case 0:
/* Get the read attribute */
/* read attribute found */
return (0);
}
/* FALLTHROUGH */
/* mirror not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or mirror couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default write strategy for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default write strategy for
* mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the write attribute */
}
/*
* Get the default write strategy for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default write strategy for mirrored
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* mirror found for this disk set */
case 0:
/* Get the write attribute */
if ((error = devconfig_get_mirror_write(
/* write attribute found */
return (0);
}
/* FALLTHROUGH */
/* mirror not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or mirror couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default resync pass for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default resync pass for
* mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the pass attribute */
}
/*
* Get the default resync pass for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default resync pass for mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* mirror found for this disk set */
case 0:
/* Get the pass attribute */
/* pass attribute found */
return (0);
}
/* FALLTHROUGH */
/* mirror not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or mirror couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default HSP creation flag for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default HSP creation flag for
* mirrored volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the usehsp attribute */
}
/*
* Get the default HSP creation flag for mirrored volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default HSP creation flag for mirrored
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* mirror found for this disk set */
case 0:
/* Get the usehsp attribute */
if ((error = devconfig_get_volume_usehsp(
/* usehsp attribute found */
return (0);
}
/* FALLTHROUGH */
/* mirror not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or mirror couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default HSP creation flag for concatenated volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default HSP creation flag for
* concatenated volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the usehsp attribute */
}
/*
* Get the default HSP creation flag for concatenated volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default HSP creation flag for concatenated
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* concat found for this disk set */
case 0:
/* Get the usehsp attribute */
if ((error = devconfig_get_volume_usehsp(
/* usehsp attribute found */
return (0);
}
/* FALLTHROUGH */
/* concat not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or concat couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default minimum number of components for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default minimum number of
* components for striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the mincomp attribute */
}
/*
* Get the default minimum number of components for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default minimum number of components for
* striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* stripe found for this disk set */
case 0:
/* Get the mincomp attribute */
if ((error = devconfig_get_stripe_mincomp(
/* mincomp attribute found */
return (0);
}
/* FALLTHROUGH */
/* stripe not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or stripe couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default maximum number of components for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default maximum number of
* components for striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the maxcomp attribute */
}
/*
* Get the default maximum number of components for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default maximum number of components for
* striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* stripe found for this disk set */
case 0:
/* Get the maxcomp attribute */
if ((error = devconfig_get_stripe_maxcomp(
/* maxcomp attribute found */
return (0);
}
/* FALLTHROUGH */
/* stripe not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or stripe couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default interlace for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default interlace for striped
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the interlace attribute */
}
/*
* Get the default interlace for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default interlace for striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* stripe found for this disk set */
case 0:
/* Get the interlace attribute */
if ((error = devconfig_get_stripe_interlace(
/* interlace attribute found */
return (0);
}
/* FALLTHROUGH */
/* stripe not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or stripe couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default HSP creation flag for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default HSP creation flag for
* striped volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the usehsp attribute */
}
/*
* Get the default HSP creation flag for striped volumes
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default HSP creation flag for striped
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* stripe found for this disk set */
case 0:
/* Get the usehsp attribute */
if ((error = devconfig_get_volume_usehsp(
/* usehsp attribute found */
return (0);
}
/* FALLTHROUGH */
/* stripe not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or stripe couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default redundancy level for generic volumes.
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* If 0, a stripe will be created by default. If > 0, a
* mirror with this number of submirrors will be created
* by default.
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the redundancy level */
}
/*
* Get the default redundancy level for generic volumes.
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default redundancy level for generic
* volumes
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* volume found for this disk set */
case 0:
/* Get the redundancy level */
/* redundancy level found */
return (0);
}
/* FALLTHROUGH */
/* volume not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or volume couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default number of data paths for generic volume
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default number of data paths
* for generic volume
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the npaths attribute */
}
/*
* Get the default number of data paths for generic volume
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default number of data paths for generic
* volume
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* volume found for this disk set */
case 0:
/* Get the npaths attribute */
if ((error = devconfig_get_volume_npaths(
/* npaths attribute found */
return (0);
}
/* FALLTHROUGH */
/* volume not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or volume couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}
/*
* Set the default HSP creation flag for generic volume
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* the value to set as the default HSP creation flag for
* generic volume
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error = 0;
/* volume_set_error already called */
return (error);
}
/* Set the usehsp attribute */
}
/*
* Get the default HSP creation flag for generic volume
*
* @param defaults
* a defaults_t hierarchy representing default settings
* for all disk sets and specific disk sets
*
* @param diskset
* the name of the disk set to which to apply this
* default setting, or NULL to apply default
* setting to all disk sets
*
* @param val
* RETURN: the default HSP creation flag for generic
* volume
*
* @return 0
* if successful
*
* @return non-zero
* if an error occurred. Use get_error_string() to
* retrieve the associated error message.
*/
int
char *diskset,
{
int error;
int i = 0;
/* Check both the given and global (NULL) disk sets for the value */
do {
switch (error) {
/* volume found for this disk set */
case 0:
/* Get the usehsp attribute */
if ((error = devconfig_get_volume_usehsp(
/* usehsp attribute found */
return (0);
}
/* FALLTHROUGH */
/* volume not found for this disk set */
case ENOENT:
break;
/* Invalid disk set, or volume couldn't be created */
default:
/* volume_set_error already called */
return (error);
}
/* Stop after the global (NULL) disk set has been searched */
return (ENOENT);
}