/*
* 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
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* common routines for parallelization (used by both fsck and quotacheck)
*/
#include <stdio.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <macros.h>
/*
* data structures for parallelization
*/
struct driver {
};
struct onedev {
};
struct rawdev {
};
static int debug = 0;
/*
* defines used in building shared object names
*/
/* the directory where we find shared objects */
/* a shared object name is OBJECT_PREFIX || driver_name */
/* the version of the driver interface we support */
/* the "build" entry point for a driver specific object is named this */
static int chooseone();
void preen_addunit(void *, char *, int (*)(), void *, uint_t);
int preen_subdev(char *, struct dk_cinfo *, void *);
static int alloc_driver(char *, int (*)(), void *);
/*
* add the given device to the list of devices to be checked
*/
int
{
int fd;
extern char *strdup();
return (-1);
}
perror("DKIOCINFO");
return (-1);
}
return (-1);
}
return (-1);
}
}
return (0);
}
int
{
void *dlhandle;
int (*fptr)();
if (debug)
return (1);
}
if (debug)
return (1);
}
return (0);
}
/*
* select a device from the "unchecked" list, and add it to the
* active list.
*/
int
{
return (0);
if (rdp) {
}
return (1);
} else {
return (2);
}
}
int
{
break;
}
return (-1);
} else {
}
/*
* free(dp->devname);
* free(dp);
*/
return (0);
}
static
struct rawdev *
{
if (rc != 0)
break;
}
if (rc == 0)
break;
}
/*
* remove from list...
*/
if (rdp) {
if (last) {
} else {
}
}
return (rdp);
}
/*
* by `cookie'
* If a new `driver' structure needs to be created, associate the given
* choosing function and driver private data with it.
*/
void
void *cookie,
char *dname, /* driver name */
int (*cf)(), /* candidate choosing function */
void *datap, /* driver private data */
{
int drvid;
/*
* locate the driver struct
*/
break;
}
}
/*
* driver struct doesn't exist yet -- create one
*/
}
/*
* see if this device already references the given driver
*/
break;
}
/*
* allocate a new `struct onedev' and chain it in
* rdp->alldevs...
*/
}
/*
* add `unit' to the unitmap in devp
*/
}
static
int
{
extern char *strdup();
(struct driver *)
(struct driver *)
exit(1);
}
ndalloc += DRIVER_ALLOC;
}
exit(1);
}
return (ndrivers++);
}
static
struct onedev *
{
exit(1);
}
return (devp);
}
static
void
{
exit(1);
}
}
}
static int
{
int i;
return (1);
}
return (0);
}
/*
* preen_getdev.
*/
static
void
{
int i;
exit(1);
}
}
for (i = 0; i < newsize; i++)
}
/*
* make each device in the given `rawdev' un-busy.
* Called from preen_releasedev
*/
static
void
{
int i;
}
}