vold_label.c revision 18c2aff776a775d34a4c9893a4c72e0434d68e36
/*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
#include <syslog.h>
#include <errno.h>
#include <string.h>
#include <rpcsvc/nfs_prot.h>
#include <netdb.h>
#include <setjmp.h>
#include <netconfig.h>
#include <locale.h>
#include <ulimit.h>
#include <dlfcn.h>
#include "vold.h"
#include "label.h"
#define LAB_ALLOC_CHUNK 10
static int nlabs = 0;
static int nalloclabs = 0;
void
{
int i;
int na; /* for nalloclabs */
/* see if the label already exists */
for (i = 0; i < nlabs; i++) {
/* label already in list */
return;
}
}
/* see if we need to allocate another chunk of label structs */
if (nlabs == nalloclabs) {
/* is the list empty ?? */
if (labsw == 0) {
/* allocate first block of label pointers */
sizeof (struct labsw *));
} else {
/* add a block of pointers */
na = nalloclabs;
sizeof (struct labsw *));
/* copy over the current struct pointers */
for (i = 0; i < na; i++) {
}
}
}
/* allocate the next label from the block */
/* keep track of last one allocated */
}
/*
* Yes, well, this is a really ugly but it lets us build l_devlist
* in the configuration code. This interface should probably be
* rethought.
*/
struct labsw *
{
return (lastlabsw);
}
label_size(int type)
{
if (type == PARTITION_LABEL) {
return (sizeof (partition_label_t));
} else {
}
}
{
/* if types don't match forget it */
return (FALSE);
}
/* call the compare routine for label's type */
return (TRUE);
} else {
return (FALSE);
}
} else {
}
}
char *
{
} else {
}
}
char *
label_ident(int type)
{
if (type == -1) {
return ("error");
}
}
label_xdrsize(int type)
{
}
int
label_type(char *s)
{
int i;
for (i = 0; i < nlabs; i++) {
return (i);
}
}
return (-1);
}
enum laread_res
{
int i;
int j;
/* scan each label type */
for (i = 0; i < nlabs; i++) {
return (res);
}
}
}
}
return (res); /* probably L_UNRECOG */
}
/* XXX: not currently used */
enum laread_res
{
}
/* XXX: not currently used */
int
{
}
void
{
if (l->l_type != -1) {
} else {
}
}
void
{
/*
* call the label function to see if it can get any of this stuff
* off the label.
*/
}
}
}
}
}
}
v->v_flags |= V_RMONEJECT;
}
v->v_flags |= V_MEJECTABLE;
}
}
void
{
}
}
}
}
}