entry.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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"
#include <fcntl.h>
#include <libdevinfo.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "libdiskmgt.h"
#include "disks_private.h"
#include "partition.h"
extern dm_desc_type_t drive_assoc_types[];
extern dm_desc_type_t bus_assoc_types[];
extern dm_desc_type_t controller_assoc_types[];
extern dm_desc_type_t media_assoc_types[];
extern dm_desc_type_t slice_assoc_types[];
extern dm_desc_type_t partition_assoc_types[];
extern dm_desc_type_t path_assoc_types[];
extern dm_desc_type_t alias_assoc_types[];
void
{
return;
}
cache_wlock();
cache_unlock();
}
void
{
descriptor_t **dp;
int error;
return;
}
if (error != 0) {
return;
}
cache_wlock();
cache_unlock();
}
/*ARGSUSED*/
void
dm_free_name(char *name)
{
}
int *errp)
{
cache_wlock();
if (!cache_is_valid_desc(dp)) {
cache_unlock();
return (NULL);
}
/* verify that the descriptor is still valid */
cache_unlock();
return (NULL);
}
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
default:
break;
}
cache_unlock();
}
{
switch (type) {
case DM_DRIVE:
return (drive_assoc_types);
case DM_BUS:
return (bus_assoc_types);
case DM_CONTROLLER:
return (controller_assoc_types);
case DM_MEDIA:
return (media_assoc_types);
case DM_SLICE:
return (slice_assoc_types);
case DM_PARTITION:
return (partition_assoc_types);
case DM_PATH:
return (path_assoc_types);
case DM_ALIAS:
return (alias_assoc_types);
}
return (NULL);
}
nvlist_t *
{
cache_rlock();
if (!cache_is_valid_desc(dp)) {
cache_unlock();
return (NULL);
}
/* verify that the descriptor is still valid */
cache_unlock();
return (NULL);
}
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
default:
break;
}
cache_unlock();
return (attrs);
}
{
cache_wlock();
switch (desc_type) {
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
errp);
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
errp);
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
default:
break;
}
cache_unlock();
return (desc);
}
{
cache_wlock();
switch (type) {
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
default:
break;
}
cache_unlock();
}
char *
{
cache_rlock();
if (!cache_is_valid_desc(dp)) {
cache_unlock();
return (NULL);
}
/* verify that the descriptor is still valid */
cache_unlock();
return (NULL);
}
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
}
cache_unlock();
*errp = 0;
return (NULL);
}
return (name);
}
return (NULL);
}
nvlist_t *
{
cache_rlock();
if (!cache_is_valid_desc(dp)) {
cache_unlock();
return (NULL);
}
/* verify that the descriptor is still valid */
cache_unlock();
return (NULL);
}
case DM_DRIVE:
break;
case DM_BUS:
break;
case DM_CONTROLLER:
break;
case DM_MEDIA:
break;
case DM_SLICE:
break;
case DM_PARTITION:
break;
case DM_PATH:
break;
case DM_ALIAS:
break;
default:
break;
}
cache_unlock();
return (stats);
}
{
cache_rlock();
if (!cache_is_valid_desc(dp)) {
cache_unlock();
return (-1);
}
cache_unlock();
}
void
{
if (*errp == 0) {
}
}
descriptor_t **
{
return (NULL);
}
*errp = 0;
return (empty);
}
void
{
char *valp;
}
}
int
{
if (dm_debug) {
}
return (1);
} else {
return (0);
}
}
/* nm1 != NULL */
if (dm_debug) {
}
return (0);
}
return (1);
}
return (0);
}
/*ARGSUSED*/
static descriptor_t **
{
#ifdef _LP64
return ((descriptor_t **)descs);
#else
/* convert the 64 bit descriptors to 32 bit ptrs */
int cnt;
int i;
descriptor_t **da;
return (NULL);
}
for (i = 0; descs[i]; i++) {
}
*errp = 0;
return (da);
#endif
}
/*ARGSUSED*/
static dm_descriptor_t *
{
#ifdef _LP64
return ((dm_descriptor_t *)ptrs);
#else
/* convert the 32 bit ptrs to the 64 bit descriptors */
int cnt;
int i;
return (NULL);
}
return (NULL);
}
for (i = 0; ptrs[i]; i++) {
}
*errp = 0;
return (da);
#endif
}