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 {
char *dn
)
{
- struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry e, *ep;
ID id;
#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);
}
/* 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);
char *dn
)
{
- struct ldbminfo *li = (struct ldbminfo *) be->be_private;
struct dbcache *db;
Datum key;
int rc;
/* 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;
* 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 */
#include "portable.h"
#include <stdio.h>
-#include <errno.h>
+#include <ac/errno.h>
#include <ac/string.h>
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 ) {
* 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 ));
{
int rc;
Datum key;
+ /* XXX do we need idl ??? */
ID_BLOCK *idl = NULL;
char *tmpval = NULL;
char *realval = val;