/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* initialize metadevices
*/
#include <meta.h>
#include <libdevinfo.h>
int
char *uname, /* Meta Device name (eg d0) */
char *str, /* String to Parse */
)
{
char c;
int cnt;
/* parse interlace */
} else if (cnt == 1) {
}
} else switch (c) {
case 'b':
case 'B':
break;
case 'k':
case 'K':
break;
case 'm':
case 'M':
break;
default:
}
/* return success */
*interlacep = num;
return (0);
}
/*
* cook up syntax error
*/
int
md_error_t *ep,
char *uname,
int argc,
char *argv[]
)
{
int rval;
/* if we have a token, concat it to uname */
char *p;
(void) strcat(p, ": ");
} else {
p[0] = '\0';
}
(void) strcat(p, "\"");
(void) strcat(p, "\"");
Free(p);
} else {
}
return (rval);
}
int
)
{
if (total_blocks > MD_MAX_BLKS_FOR_SMALL_DEVS) {
rval = MD_CRO_64BIT;
}
return (rval);
}
/*
* setup metadevice geometry
*/
/*ARGSUSED*/
int
)
{
if (round_cyl) {
} else {
}
return (0);
}
/*
* adjust metadevice geometry
*/
/*ARGSUSED*/
int
)
{
if (round_cyl) {
} else {
}
return (0);
}
/*
* Function: meta_init_make_device
* Purpose:
* Create the device node <uname> by constructing the necessary
* md_mkdev_params_t structure. We have to handle relative names
* The field that we need is the unit number of the metadevice (80 in
* the above examples).
* Input: spp set structure
* uname unit-name (fully qualified or relative)
* Output: ep error return structure
* Returns: > 0 success and return 'key'
* -1 Error. <ep> contains error reason
*/
mdsetname_t **spp,
char *uname,
)
{
char *p;
/*
* This ioctl call causes kernel to allocate a unit number
* and populate /devices for the named metadevice
*/
}
/*
* Now we have minor number so add it to the namespace
* and return the key
*/
return (-1);
}
/* Make sure the /dev link is created */
/*
* Delete name entry we just created
*/
Free(p);
}
return (rval);
}
/*
* FUNCTION: is_metadb_cmd()
* INPUT: argc - number of command line arguments
* argv - pointer to array of command line arguments
* OUTPUT: none
* RETURNS: TRUE if a metadb is to be created, FALSE otherwise
* PURPOSE: parses enough of the command line to determine if a metadb
* create is being attempted
*/
static boolean_t
int argc,
char *argv[]
)
{
int len;
/* look for match */
return (B_TRUE);
}
return (B_FALSE);
}
/*
* FUNCTION: is_stripe_cmd()
* INPUT: argc - number of command line arguments
* argv - pointer to array of command line arguments
* OUTPUT: none
* RETURNS: TRUE if a stripe is to be created, FALSE otherwise
* PURPOSE: parses enough of the command line to determine if a stripe
* create is being attempted
*/
static boolean_t
int argc,
char *argv[]
)
{
return (B_FALSE);
return (B_TRUE);
}
/*
* FUNCTION: meta_get_init_type()
* INPUT: argc - number of command line arguments
* argv - pointer to array of command line arguments
* OUTPUT: none
* RETURNS: type of metadevice or hot spare pools being initialized
* PURPOSE: parses enough of the command line to determine what type
* of metainit is being attempted
*/
int argc,
char *argv[]
)
{
return (TAB_HSP);
} else { /* assume that it is a hsp */
}
}
return (init_type);
}
/*
* initialize named device or hotspare pool
*/
int
mdsetname_t **spp,
int argc,
char *argv[],
char *cname, /* canonical name */
)
{
char *p;
int rval;
/* determine type of metadevice or hot spare pool being created */
/*
* Metatrans is eof
*/
/* hotspare pool */
/*
* We are creating metadevice so make sure the name
* has not been used
*/
/*
* The name has been used by hsp
*/
}
/*
* If path exists but unit is not created
* then meta_init_make_device will correct
* that. If unit also exists then it
* will return a conflict error
*/
if (init_type != TAB_UNKNOWN) {
/* Create device node */
&t_e)) <= 0) {
}
}
}
/* metadevice */
/*
* We need to create the device node if the specified metadevice
* does not already exist in the database. The actual creation
* is undertaken by the md driver and the links propagated by
* devfsadm.
*/
if (key == MD_KEYWILD) {
&t_e)) <= 0)
}
switch (init_type) {
case TAB_MIRROR:
break;
case TAB_RAID:
break;
case TAB_SP:
break;
case TAB_STRIPE:
break;
}
/*
* Remove the device node created before
*/
}
/*
* Del what we added before
*/
}
return (rval);
}
/* unknown type */
(void) strcpy(p, "\"");
(void) strcat(p, "\"");
Free(p);
return (rval);
}