/*
* 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 <sys/sysmacros.h>
extern md_ops_t trans_md_ops;
static int md_nlogs;
void
_init_ldl(void)
{
}
void
_fini_ldl(void)
{
}
static void
{
char *str;
if (ldl_iserror(ul))
str = "Error";
else if (ldl_isherror(ul))
str = "Hard Error";
else
str = "Okay";
}
/*
* atomically commit the log unit struct and any underlying metadevice struct
*/
static void
{
/*
* commit the log device and its child (if metadevice)
*/
recids[2] = 0;
} else
recids[1] = 0;
}
static void
{
int i;
/*
* Clear previous allocation
*/
/*
* preallocate 3 bp's and put them on the free list.
*/
for (i = 0; i < 3; ++i) {
}
/*
* first bp claims entire write buffer
*/
}
static void
{
/*
* Clear previous allocation
*/
/*
* preallocate N bufs that are hard-sized to blksize
* in other words, the read buffer pool is a linked list
* of statically sized bufs.
*/
} else
}
}
static void
{
return;
/*
* free the active bufs
*/
else
}
/*
* free the free bufs
*/
}
}
int
{
return (1);
}
/*
* If snarfing the log device,
* then remake the device number
* else (we are creating the log device)
* set the driver name in the shared name space.
*/
if (snarfing) {
}
/*
* With the current device id implementation there is possibility
* that we may have NODEV if the underlying can't be resolved at
* snarf time. If this is the case we want to be consistent with
* the normal behavior and continue to allow log to be put on the list.
* We delay the resolve of the dev_t so we can resolve at the open
* time of the log device by device id
*/
return (1);
}
/*
* initialize incore structs
* LDL_FIND_TAIL flag indicates that all I/O must wait until the
* tail has been found.
*/
ul->un_opencnt = 0;
ul->un_transcnt = 0;
/*
* allocate some read and write buffers
*/
if (snarfing) {
} else
}
/* Put on the unit list */
md_nlogs++;
return (0);
}
{
/*
* Find a unit struct by database recid
*/
break;
return (ul);
}
/*
* ldl_utadd adds a metatrans device to the log's list of mt devices.
* WARNING: top_end_sync() scans this list W/O locking for performance!!!
*/
void
{
return;
}
/*
* ldl_utdel removes a metatrans device to the log's list of mt devices.
* WARNING: top_end_sync() scans this list W/O locking for performance!!!
*/
static void
{
if (*utp)
}
{
/*
* Find a unit struct for this key and set
* If we found one then, we are done.
* Else create one.
*/
break;
if (ul)
if (recid < 0)
return (recid);
/*
* empty log
*/
uniqtime32(&tv);
(void) ldl_build_incore(ul, 0);
return (recid);
}
int
{
int err = 0;
if (ul->un_opencnt) {
ul->un_opencnt++;
return (0);
}
/*
* Do the open by device id if it is regular device
*/
}
if (err == 0)
ul->un_opencnt++;
return (err);
}
void
{
ul->un_opencnt--;
if (ul->un_opencnt) {
return;
}
/* Last reference to the log, close it */
}
/*
* LOGSCAN STUFF
*/
int
{
}
int
{
}
{
/*
* initial guess is the maxtransfer value for this log device
* reduce by number of logs
* increase for sharing
* increase if too small
* decrease if too large
*/
if (md_nlogs)
if (ul->un_transcnt)
if (bufsize < LDL_MINBUFSIZE)
return (bufsize);
}
/*
* if necessary; open all underlying devices for ul and start threads
* called at snarf, metainit, and open
*/
void
{
int err = 0;
/*
* first, handle the case of detached logs
*/
if (err == 0) {
}
}
}
/*
* remove log unit struct from global linked list
*/
static void
{
/*
* remove from list
*/
if (*ulp) {
--md_nlogs;
}
}
/*
* get rid of a log unit from the database
*/
void
{
/* Save the log key */
}
static void
{
/*
* remove from list
*/
ldl_unlist(ul);
/*
* free up resources
*/
if (removing) {
}
}
/*
* detach log from trans device
* caller insures that trans device is idle and will remain idle
*/
/* ARGSUSED */
int
{
return (0);
trans_commit(un, 0);
}
/*
* remove this metatrans device from the log's list of mt devices
*/
/*
* busy; do nothing
*/
return (0);
return (0);
}