mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 20:19:34 -05:00
Quick and dirty BDB 4.6.18 support. Expect this to change again soon.
This commit is contained in:
parent
767293dd3a
commit
b514b25795
5 changed files with 21 additions and 5 deletions
|
|
@ -275,6 +275,21 @@ struct bdb_op_info {
|
|||
|
||||
#endif
|
||||
|
||||
/* 4.6.18 redefines cursor->locker */
|
||||
#if DB_VERSION_FULL >= 0x04060012
|
||||
|
||||
struct __db_locker {
|
||||
u_int32_t id;
|
||||
};
|
||||
|
||||
#define CURSOR_SETLOCKER(cursor, id) \
|
||||
__lock_getlocker(cursor->dbp->dbenv->lk_handle, id, 0, &cursor->locker)
|
||||
#define CURSOR_GETLOCKER(cursor) cursor->locker->id
|
||||
#else
|
||||
#define CURSOR_SETLOCKER(cursor, id) cursor->locker = id
|
||||
#define CURSOR_GETLOCKER(cursor) cursor->locker
|
||||
#endif
|
||||
|
||||
#ifndef DB_BUFFER_SMALL
|
||||
#define DB_BUFFER_SMALL ENOMEM
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -738,7 +738,7 @@ hdb_dn2id_parent(
|
|||
rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
|
||||
if ( rc ) return rc;
|
||||
if ( !txn && locker ) {
|
||||
cursor->locker = locker;
|
||||
CURSOR_SETLOCKER(cursor, locker);
|
||||
}
|
||||
|
||||
data.ulen = sizeof(diskNode) + (SLAP_LDAPDN_MAXLEN * 2);
|
||||
|
|
|
|||
|
|
@ -121,8 +121,9 @@ int bdb_id2entry(
|
|||
if ( rc ) return rc;
|
||||
|
||||
/* Use our own locker if needed */
|
||||
if ( !tid && locker )
|
||||
cursor->locker = locker;
|
||||
if ( !tid && locker ) {
|
||||
CURSOR_SETLOCKER( cursor, locker );
|
||||
}
|
||||
|
||||
/* Get the nattrs / nvals counts first */
|
||||
data.ulen = data.dlen = sizeof(buf);
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ bdb_idl_fetch_key(
|
|||
"cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 );
|
||||
return rc;
|
||||
}
|
||||
cursor->locker = locker;
|
||||
CURSOR_SETLOCKER( cursor, locker );
|
||||
} else {
|
||||
cursor = *saved_cursor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
|
|||
op.o_tmpmemctx = NULL;
|
||||
op.o_tmpmfuncs = &ch_mfuncs;
|
||||
|
||||
rc = bdb_cache_find_parent( &op, NULL, cursor->locker, id, &ei );
|
||||
rc = bdb_cache_find_parent( &op, NULL, CURSOR_GETLOCKER(cursor), id, &ei );
|
||||
if ( rc == LDAP_SUCCESS ) {
|
||||
bdb_cache_entryinfo_unlock( ei );
|
||||
e->e_private = ei;
|
||||
|
|
|
|||
Loading…
Reference in a new issue