lufs_debug.c revision 80d3443290aca22ad7fb6c18568d19d37517ebbf
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/sysmacros.h>
#ifdef DEBUG
/*
* DEBUG ROUTINES
* THESE ROUTINES ARE ONLY USED WHEN ASSERTS ARE ENABLED
*/
static kmutex_t toptracelock;
static int toptraceindex;
struct toptrace {
enum delta_type dtyp;
long arg2;
long arg3;
long long arg1;
} *toptrace;
static void
{
toptraceindex = 0;
}
if (++toptraceindex == toptracemax)
toptraceindex = 0;
else {
}
}
/*
* add a range into the metadata map
*/
void
{
}
/*
* delete a range from the metadata map
*/
void
{
}
/*
* clear the entries from the metadata map
*/
void
{
}
int
{
}
return (1);
}
int
{
else
return (1);
}
int
{
struct threadtrans *tp;
/*
* check for delta contained fully within matamap
*/
/*
* maintain transaction info
*/
/*
* check transaction stuff
*/
switch (dtyp) {
case DT_CANCEL:
case DT_ABZERO:
break;
default:
break;
}
} else
return (1);
return (1);
}
int
{
return (1);
}
int
top_init_debug(void)
{
return (1);
}
struct topstats_link {
struct topstats_link *ts_next;
};
/*
* DEBUG ROUTINES
* from debug portion of *_map.c
*/
/*
* scan test support
*/
int
{
mapentry_t *me;
/*
* remember location of youngest rolled delta
*/
if (trimroll == 0)
} else {
}
}
return (1);
}
/*
* scan test support
*/
int
{
/*
*/
if (trimroll)
} else {
}
return (1);
}
int
{
return (1);
}
/*
* log-read after log-write
*/
int
{
/* Alloc a buf */
/* Do the read */
}
return (1);
}
/*
* Cleanup a map struct
*/
int
{
return (1);
/* Don't free this, cause the next snarf will want it */
if ((lufs_debug & MT_TRANSACT) != 0)
return (1);
ptsl = &topstats_anchor;
while (tsl) {
return (1);
}
}
return (1);
}
int
{
struct topstats_link *tsl;
return (1);
return (1);
while (tsl) {
return (1);
}
}
return (1);
}
/*
* check a map's list
*/
int
{
int i;
int hashed;
int nexted;
int preved;
int ncancel;
mapentry_t *me;
int wrapped;
/*
* verify the entries on the hash
*/
hashed = 0;
++hashed;
}
}
/*
* verify the doubly linked list of all entries
*/
nexted = 0;
nexted++;
preved = 0;
preved++;
/*
* verify the cancel list
*/
ncancel = 0;
++ncancel;
}
/*
* verify the logmap's log offsets
*/
wrapped = 0;
/*
* Make sure to skip any mapentries whose me_lof = 0
* and me_type == DT_CANCEL, these are mapentries
* in place just to mark user block deletions as not
* available for allocate within the same moby transaction
* in case we crash before it is comitted. Skip these
* entries in the checks below as they are not applicable.
*/
continue;
if (firstlof == 0) {
continue;
}
if (wrapped) {
continue;
}
wrapped = 1;
continue;
}
}
}
return (1);
}
/*
* check for overlap
*/
int
{
mapentry_t *me;
mapentry_t **mep;
/*
* search for dup entry
*/
break;
/*
* overlap detected
*/
if (me)
return (1);
}
return (0);
}
/*
* check for within
*/
int
{
mapentry_t *me;
mapentry_t **mep;
int scans = 0;
int withins = 0;
scans++;
/*
* search for within entry
*/
withins++;
break;
}
}
}
int
{
mtm->mtm_trimrlof = 0;
} else {
mtm->mtm_trimrlof = 0;
}
return (1);
}
int
{
return (1);
}
#endif /* DEBUG */
/*
* lufs_debug controls the debug level for TSufs, and is only used
* for a debug kernel. It's referenced by ufs_ioctl() and so is
* not under #ifdef DEBUG compilation.
*/