dbtable.c revision 7d32c065c7bb56f281651ae3dd2888f32ce4f1d9
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* $Id: dbtable.c,v 1.13 2000/02/03 23:43:46 halley Exp $
*/
/*
* Principal Author: DCL
*/
#include <config.h>
#include <isc/assertions.h>
struct dns_dbtable {
/* Unlocked. */
unsigned int magic;
/* Locked by lock. */
unsigned int references;
/* Locked by tree_lock. */
};
static void
(void)arg;
dns_db_detach(&db);
}
{
return (DNS_R_NOMEMORY);
if (result != DNS_R_SUCCESS)
goto clean1;
if (iresult != ISC_R_SUCCESS) {
"isc_lock_init() failed: %s",
goto clean2;
}
if (iresult != ISC_R_SUCCESS) {
"isc_rwlock_init() failed: %s",
goto clean3;
}
return (DNS_R_SUCCESS);
return (result);
}
static inline void
/*
* Caller must ensure that it is safe to
* call.
*/
}
void
source->references++;
}
void
dbtable->references--;
if (dbtable->references == 0)
if (free_dbtable)
}
return (result);
}
void
/*
* There is a requirement that the association of name with db
* be verified. With the current rbt.c this is expensive to do,
* because effectively two find operations are being done, but
* deletion is relatively infrequent.
*/
(void **)&stored_data);
if (result == DNS_R_SUCCESS) {
}
}
void
}
void
}
void
}
(void **)&stored_data);
} else
return (result);
}