/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#define _LAYOUT_DLIST_UTIL_C
#include <assert.h>
#include <string.h>
#include <libintl.h>
#include <libdiskmgt.h>
#include "volume_devconfig.h"
#include "volume_dlist.h"
#include "volume_output.h"
#include "layout_device_cache.h"
#include "layout_dlist_util.h"
#include "layout_request.h"
#include "layout_slice.h" /* destroy_new_slice */
#include "layout_svm_util.h"
/*
* FUNCTION: compare_strings(void *str1, void *str2)
*
* INPUT: str1 - opaque pointer to a char *
* str2 - opaque pointer to a char *
*
* RETURNS: int - <0 - if str1 < str2
* 0 - if str1 == str2
* >0 - if str1 > str2
*
* PURPOSE: dlist_t helper which compares the two input strings.
*
* Comparison is done with string_case_compare()
*/
int
void *str1,
void *str2)
{
}
/*
* FUNCTION: compare_devconfig_sizes(void *devconf1, void *devconf2)
*
* INPUT: devconf1 - opaque pointer
* devconf2 - opaque pointer
*
* RETURNS: int - <0 - if devconf1.size_in_blks < devconf2.size_in_blks
* 0 - if devconf1.size_in_blks == devconf2.size_in_blks
* >0 - if devconf1.size.in_blks > devconf2.size_in_blks
*
* PURPOSE: dlist_t helper which compares the sizes of two devconfig_t
* structs.
*
* Both input objects are assumed to be devconfig_t pointers.
*/
int
void *devconf1,
void *devconf2)
{
}
/*
* FUNCTION: compare_slice_sizes(void *desc1, void *desc2)
*
* INPUT: desc1 - opaque pointer to a dm_descriptor_t slice handle
* desc2 - opaque pointer to a dm_descriptor_t slice handle
*
*
* PURPOSE: dlist_t helper which compares the sizes of two slices
* represented as dm_descriptor_t handles.
*/
int
void *desc1,
void *desc2)
{
}
/*
* FUNCTION: compare_devconfig_and_descriptor_names(void *devconf,
* void *desc)
*
* INPUT: devconf - opaque pointer to a devconfig_t
* desc - opaque pointer to a dm_descriptor_t
*
* RETURNS: int - <0 - if devconf name is "less than" descr name
* 0 - if devconf name is "equal to" descr name
* >0 - if devconf name is "greater than" desc name
*
* PURPOSE: dlist_t helper which compares the name of a devconfig_t
* struct to the name for a dm_descriptor_t.
*
* Note that the order of the arguments is important.
* This function is intended to be passed into the various
* dlist_* functions which take a comparison function.
*/
int
void *devconf,
void *desc)
{
}
/*
* FUNCTION: compare_string_to_devconfig_name(void *str, void *devconf)
*
* INPUT: str - opaque pointer to a char *str
* devconf - opaque pointer to a devconfig_t
*
* RETURNS: int - <0 - if devconf name is "less than" str
* 0 - if devconf name is "equal to" str
* >0 - if devconf name is "greater than" str
*
* PURPOSE: dlist_t helper which compares a string to the name of
* a devconfig_t struct.
*/
int
void *str,
void *devconf)
{
/* no memory for new string(s) */
return (-1);
}
}
/*
* FUNCTION: free_devconfig_object(void *obj)
*
* INPUT: obj - an opaque pointer
*
* RETURNS: void
*
* PURPOSE: helper which decomposes a devconfig_t struct after a
* failed layout attempt.
*
* reclaims allocated space.
* undoes slicing
*/
void
void *obj)
{
return;
}
switch (type) {
case TYPE_MIRROR:
case TYPE_CONCAT:
case TYPE_RAID5:
case TYPE_HSP:
case TYPE_STRIPE:
/* release name */
} else {
}
/* decompose volume's components */
break;
case TYPE_SLICE:
(void) destroy_new_slice(dev);
break;
default:
break;
}
}
/*
* FUNCTION: compare_device_names(
* void *str1, void *str2)
*
* INPUT: str1 - opaque pointer
* str2 - opaque pointer
*
* RETURNS: int - <0 - if str1 < str2
* 0 - if str1 == str2
* >0 - if str1 > str2
*
* PURPOSE: dlist_t helper which compares two device name strings.
*
* Both names are assumed to be in CTD form.
*
* Either name may be fully qualified by an absolute
* path. If only one name is fully qualified, the
* leading path with be stripped off prior to the
* comparison.
*
* Uses string_case_compare() to compare the names.
*/
int
void *str1,
void *str2)
{
int val = 0;
/* if one doesn't start with '/', just compare device names */
} else {
++short1;
}
} else {
++short2;
}
} else {
/* if they both start with '/', assume they're full paths */
}
return (val);
}
/*
* FUNCTION: compare_descriptors(
* void *desc1, void *desc2)
*
* INPUT: desc1 - opaque pointer
* desc2 - opaque pointer
*
* RETURNS: int - <0 - if desc1 < desc2
* 0 - if desc1 == desc2
* >0 - if desc1 > desc2
*
* PURPOSE: dlist_t helper which compares two dm_descriptor_t handles.
*/
int
void *desc1,
void *desc2)
{
}
/*
* FUNCTION: compare_descriptor_names(
* void *desc1, void *desc2)
*
* INPUT: desc1 - opaque pointer
* desc2 - opaque pointer
*
* RETURNS: int - <0 - if desc1.name < desc2.name
* 0 - if desc1.name == desc2.name
* >0 - if desc1.name > desc2.name
*
* PURPOSE: dlist_t helper which compares the names associated
* with the input dm_descriptor_t handles.
*
* Retrieves the names associated with both descriptors
* and compares them using string_case_compare.
*/
int
void *desc1,
void *desc2)
{
}
/*
* FUNCTION: compare_slices_on_same_hba(
* void *slice1, void *slice2)
*
* INPUT: slice1 - opaque pointer
* slice2 - opaque pointer
*
* RETURNS: int - 0 - if slice1 is on the same hba as slice2
* !0 - otherwise
*
* PURPOSE: dlist_t helper which checks whether slice1 is on the
* same hba as slice2
*/
int
void *slice1,
void *slice2)
{
/* Retrieve the names of the slices */
/* Retrieve the disk descriptors for the slices */
/* Retrieve list of HBA descriptors for the slices */
return (0);
}
}
}
}
}
}
return (1);
}