mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Some minor clean-up; checking bdb2 for sync with ldbm.
This commit is contained in:
parent
3b4fdbfeb3
commit
1c7ebc514f
@ -82,8 +82,8 @@ struct cache {
|
||||
ldap_pvt_thread_mutex_t c_mutex;
|
||||
};
|
||||
|
||||
#define CACHE_READ_LOCK 1
|
||||
#define CACHE_WRITE_LOCK 2
|
||||
#define CACHE_READ_LOCK 0
|
||||
#define CACHE_WRITE_LOCK 1
|
||||
|
||||
/* for the cache of open index files (re-used for txn) */
|
||||
struct dbcache {
|
||||
|
@ -359,7 +359,6 @@ bdb2i_cache_find_entry_dn2id(
|
||||
char *dn
|
||||
)
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
Entry e, *ep;
|
||||
ID id;
|
||||
|
||||
|
@ -61,7 +61,7 @@ bdb2i_back_delete_internal(
|
||||
#endif
|
||||
|
||||
/* delete from parent's id2children entry */
|
||||
if( (pdn = dn_parent( be, dn )) != NULL ) {
|
||||
if( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
|
||||
if( (p = bdb2i_dn2entry_w( be, pdn, &matched )) == NULL) {
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"<=- bdb2i_back_delete: parent does not exist\n", 0, 0, 0);
|
||||
@ -103,7 +103,7 @@ bdb2i_back_delete_internal(
|
||||
}
|
||||
|
||||
/* delete from dn2id mapping */
|
||||
if ( bdb2i_dn2id_delete( be, e->e_dn ) != 0 ) {
|
||||
if ( bdb2i_dn2id_delete( be, e->e_ndn ) != 0 ) {
|
||||
Debug(LDAP_DEBUG_ARGS,
|
||||
"<=- bdb2i_back_delete: operations error %s\n",
|
||||
dn, 0, 0);
|
||||
|
@ -116,7 +116,6 @@ bdb2i_dn2id_delete(
|
||||
char *dn
|
||||
)
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
struct dbcache *db;
|
||||
Datum key;
|
||||
int rc;
|
||||
|
@ -15,7 +15,7 @@ static ID_BLOCK* idl_dup( ID_BLOCK *idl );
|
||||
|
||||
/* Allocate an ID_BLOCK with room for nids ids */
|
||||
ID_BLOCK *
|
||||
bdb2i_idl_alloc( unsigned long nids )
|
||||
bdb2i_idl_alloc( unsigned int nids )
|
||||
{
|
||||
ID_BLOCK *new;
|
||||
|
||||
@ -615,9 +615,9 @@ bdb2i_idl_insert_key(
|
||||
* 3 id not inserted, block must be split
|
||||
*/
|
||||
int
|
||||
bdb2i_idl_insert( ID_BLOCK **idl, ID id, unsigned long maxids )
|
||||
bdb2i_idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids )
|
||||
{
|
||||
unsigned long i, j;
|
||||
unsigned int i, j;
|
||||
|
||||
if ( ID_BLOCK_ALLIDS( *idl ) ) {
|
||||
return( 2 ); /* already there */
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <ac/errno.h>
|
||||
|
||||
#include <ac/string.h>
|
||||
|
||||
@ -91,7 +91,6 @@ bdb2i_leave_backend_rw( DB_LOCK lock, int writer )
|
||||
we must have several return codes that are or'ed at the end */
|
||||
int ret_transaction = 0;
|
||||
int ret_lock = 0;
|
||||
int ret_chkp = 0;
|
||||
|
||||
/* if we are a writer, finish the transaction */
|
||||
if ( writer ) {
|
||||
|
@ -103,12 +103,12 @@ Entry * bdb2i_id2entry_rw LDAP_P(( BackendDB *be, ID id, int rw ));
|
||||
* idl.c
|
||||
*/
|
||||
|
||||
ID_BLOCK * bdb2i_idl_alloc LDAP_P(( unsigned long nids ));
|
||||
ID_BLOCK * bdb2i_idl_alloc LDAP_P(( unsigned int nids ));
|
||||
ID_BLOCK * bdb2i_idl_allids LDAP_P(( BackendDB *be ));
|
||||
void bdb2i_idl_free LDAP_P(( ID_BLOCK *idl ));
|
||||
ID_BLOCK * bdb2i_idl_fetch LDAP_P(( BackendDB *be, struct dbcache *db, Datum key ));
|
||||
int bdb2i_idl_insert_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
|
||||
int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned long maxids ));
|
||||
int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
|
||||
int bdb2i_idl_delete_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
|
||||
ID_BLOCK * bdb2i_idl_intersection LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
|
||||
ID_BLOCK * bdb2i_idl_union LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
|
||||
|
@ -167,6 +167,7 @@ add_value(
|
||||
{
|
||||
int rc;
|
||||
Datum key;
|
||||
/* XXX do we need idl ??? */
|
||||
ID_BLOCK *idl = NULL;
|
||||
char *tmpval = NULL;
|
||||
char *realval = val;
|
||||
|
Loading…
Reference in New Issue
Block a user