From: Howard Chu Date: Fri, 17 Aug 2007 20:33:46 +0000 (+0000) Subject: More for BDB 4.6 compatibility X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~173 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4c7d288eb7175110c8916b135b10de0f75e97587;p=openldap More for BDB 4.6 compatibility --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 1f70e8ef40..88f5feb533 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -35,7 +35,7 @@ bdb_add(Operation *op, SlapReply *rs ) DB_TXN *ltid = NULL, *lt2; struct bdb_op_info opinfo = {0}; int subentry; - u_int32_t locker = 0, rlocker = 0; + BDB_LOCKER locker = 0, rlocker = 0; DB_LOCK lock; int num_retries = 0; diff --git a/servers/slapd/back-bdb/back-bdb.h b/servers/slapd/back-bdb/back-bdb.h index f0dc800007..51edd51c0b 100644 --- a/servers/slapd/back-bdb/back-bdb.h +++ b/servers/slapd/back-bdb/back-bdb.h @@ -58,6 +58,28 @@ LDAP_BEGIN_DECL #define BDB_PAGESIZE 4096 /* BDB's original default */ #endif +/* 4.6.18 redefines cursor->locker */ +#if DB_VERSION_FULL >= 0x04060012 + +struct __db_locker { + u_int32_t id; +}; + +typedef struct __db_locker * BDB_LOCKER; + +extern int __lock_getlocker(DB_LOCKTAB *lt, u_int32_t locker, int create, DB_LOCKER **ret); + +#define CURSOR_SETLOCKER(cursor, id) cursor->locker = id +#define CURSOR_GETLOCKER(cursor) cursor->locker +#else + +typedef u_int32_t BDB_LOCKER; + +#define CURSOR_SETLOCKER(cursor, id) cursor->locker = id +#define CURSOR_GETLOCKER(cursor) cursor->locker + +#endif + #define DEFAULT_CACHE_SIZE 1000 /* The default search IDL stack cache depth */ @@ -135,7 +157,7 @@ typedef struct bdb_cache { int c_eiused; /* EntryInfo's in use */ int c_leaves; /* EntryInfo leaf nodes */ int c_purging; - u_int32_t c_locker; /* used by lru cleaner */ + BDB_LOCKER c_locker; /* used by lru cleaner */ ldap_pvt_thread_rdwr_t c_rwlock; ldap_pvt_thread_mutex_t c_lru_mutex; ldap_pvt_thread_mutex_t c_count_mutex; @@ -230,6 +252,7 @@ struct bdb_info { #define bi_id2entry bi_databases[BDB_ID2ENTRY] #define bi_dn2id bi_databases[BDB_DN2ID] + struct bdb_lock_info { struct bdb_lock_info *bli_next; ID bli_id; @@ -239,8 +262,8 @@ struct bdb_lock_info { struct bdb_op_info { BackendDB* boi_bdb; DB_TXN* boi_txn; + BDB_LOCKER boi_locker; u_int32_t boi_err; - u_int32_t boi_locker; int boi_acl_cache; struct bdb_lock_info *boi_locks; /* used when no txn */ }; @@ -280,23 +303,12 @@ struct bdb_op_info { ((db)->open)(db, NULL, file, name, type, flags, mode) #endif -#endif - -/* 4.6.18 redefines cursor->locker */ +/* BDB 4.6.18 makes locker a struct instead of an int */ #if DB_VERSION_FULL >= 0x04060012 +#undef TXN_ID +#define TXN_ID(txn) (txn)->locker +#endif -struct __db_locker { - u_int32_t id; -}; - -extern int __lock_getlocker(DB_LOCKTAB *lt, u_int32_t locker, int create, DB_LOCKER **ret); - -#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 diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index 286c268b06..3f6b37a908 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -32,7 +32,7 @@ bdb_bind( Operation *op, SlapReply *rs ) AttributeDescription *password = slap_schema.si_ad_userPassword; - u_int32_t locker; + BDB_LOCKER locker; DB_LOCK lock; Debug( LDAP_DEBUG_ARGS, diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index db5429382b..9a22c0176a 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -155,11 +155,17 @@ bdb_cache_lru_link( struct bdb_info *bdb, EntryInfo *ei ) * alternatives though. */ +#if DB_VERSION_FULL >= 0x04060012 +#define BDB_LOCKID(locker) locker->id +#else +#define BDB_LOCKID(locker) locker +#endif + /* Atomically release and reacquire a lock */ int bdb_cache_entry_db_relock( struct bdb_info *bdb, - u_int32_t locker, + BDB_LOCKER locker, EntryInfo *ei, int rw, int tryOnly, @@ -183,7 +189,7 @@ bdb_cache_entry_db_relock( list[1].lock = *lock; list[1].mode = rw ? DB_LOCK_WRITE : DB_LOCK_READ; list[1].obj = &lockobj; - rc = bdb->bi_dbenv->lock_vec(bdb->bi_dbenv, locker, tryOnly ? DB_LOCK_NOWAIT : 0, + rc = bdb->bi_dbenv->lock_vec(bdb->bi_dbenv, BDB_LOCKID(locker), tryOnly ? DB_LOCK_NOWAIT : 0, list, 2, NULL ); if (rc && !tryOnly) { @@ -198,7 +204,7 @@ bdb_cache_entry_db_relock( } static int -bdb_cache_entry_db_lock( struct bdb_info *bdb, u_int32_t locker, EntryInfo *ei, +bdb_cache_entry_db_lock( struct bdb_info *bdb, BDB_LOCKER locker, EntryInfo *ei, int rw, int tryOnly, DB_LOCK *lock ) { #ifdef NO_DB_LOCK @@ -218,7 +224,7 @@ bdb_cache_entry_db_lock( struct bdb_info *bdb, u_int32_t locker, EntryInfo *ei, lockobj.data = &ei->bei_id; lockobj.size = sizeof(ei->bei_id) + 1; - rc = LOCK_GET(bdb->bi_dbenv, locker, tryOnly ? DB_LOCK_NOWAIT : 0, + rc = LOCK_GET(bdb->bi_dbenv, BDB_LOCKID(locker), tryOnly ? DB_LOCK_NOWAIT : 0, &lockobj, db_rw, lock); if (rc && !tryOnly) { Debug( LDAP_DEBUG_TRACE, @@ -457,7 +463,7 @@ int hdb_cache_find_parent( Operation *op, DB_TXN *txn, - u_int32_t locker, + BDB_LOCKER locker, ID id, EntryInfo **res ) { @@ -742,7 +748,7 @@ bdb_cache_find_id( ID id, EntryInfo **eip, int islocked, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private; @@ -963,7 +969,7 @@ bdb_cache_add( EntryInfo *eip, Entry *e, struct berval *nrdn, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { EntryInfo *new, ei; @@ -1038,7 +1044,7 @@ bdb_cache_modify( struct bdb_info *bdb, Entry *e, Attribute *newAttrs, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { EntryInfo *ei = BEI(e); @@ -1068,7 +1074,7 @@ bdb_cache_modrdn( struct berval *nrdn, Entry *new, EntryInfo *ein, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { EntryInfo *ei = BEI(e), *pei; @@ -1163,7 +1169,7 @@ int bdb_cache_delete( struct bdb_info *bdb, Entry *e, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { EntryInfo *ei = BEI(e); @@ -1354,9 +1360,15 @@ static void bdb_locker_id_free( void *key, void *data ) { DB_ENV *env = key; - u_int32_t lockid = (long)data; + u_int32_t lockid; int rc; +#if DB_VERSION_FULL >= 0x04060012 + BDB_LOCKER lptr = data; + lockid = lptr->id; +#else + lockid = (long)data; +#endif rc = XLOCK_ID_FREE( env, lockid ); if ( rc == EINVAL ) { DB_LOCKREQ lr; @@ -1385,7 +1397,7 @@ bdb_locker_flush( DB_ENV *env ) } int -bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ) +bdb_locker_id( Operation *op, DB_ENV *env, BDB_LOCKER *locker ) { int i, rc; u_int32_t lockid; @@ -1415,7 +1427,14 @@ bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ) if ( rc != 0) { return rc; } +#if DB_VERSION_FULL >= 0x04060012 + { BDB_LOCKER lptr; + __lock_getlocker( env->lk_handle, lockid, 0, &lptr ); + data = lptr; + } +#else data = (void *)((long)lockid); +#endif if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, env, data, bdb_locker_id_free ) ) ) { XLOCK_ID_FREE( env, lockid ); @@ -1427,7 +1446,11 @@ bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ) } else { lockid = (long)data; } +#if DB_VERSION_FULL >= 0x04060012 + *locker = data; +#else *locker = lockid; +#endif return 0; } #endif /* BDB_REUSE_LOCKERS */ diff --git a/servers/slapd/back-bdb/compare.c b/servers/slapd/back-bdb/compare.c index 4999ec7d46..972071314c 100644 --- a/servers/slapd/back-bdb/compare.c +++ b/servers/slapd/back-bdb/compare.c @@ -30,7 +30,7 @@ bdb_compare( Operation *op, SlapReply *rs ) Attribute *a; int manageDSAit = get_manageDSAit( op ); - u_int32_t locker; + BDB_LOCKER locker; DB_LOCK lock; rs->sr_err = LOCK_ID(bdb->bi_dbenv, &locker); diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index 39d1116cd3..3895cf30c9 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -190,7 +190,7 @@ bdb_online_index( void *ctx, void *arg ) DBT key, data; DB_TXN *txn; DB_LOCK lock; - u_int32_t locker; + BDB_LOCKER locker; ID id, nid; EntryInfo *ei; int rc, getnext = 1; diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 37b7a13cc9..f66baf0d9b 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -38,7 +38,7 @@ bdb_delete( Operation *op, SlapReply *rs ) struct bdb_op_info opinfo = {0}; ID eid; - u_int32_t locker = 0; + BDB_LOCKER locker = 0; DB_LOCK lock, plock; int num_retries = 0; diff --git a/servers/slapd/back-bdb/dn2entry.c b/servers/slapd/back-bdb/dn2entry.c index 5211f8e9b8..9df6d4f6d3 100644 --- a/servers/slapd/back-bdb/dn2entry.c +++ b/servers/slapd/back-bdb/dn2entry.c @@ -34,7 +34,7 @@ bdb_dn2entry( struct berval *dn, EntryInfo **e, int matched, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ) { EntryInfo *ei = NULL; diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 2a64cb5c96..3f83cf4fc6 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -332,7 +332,7 @@ bdb_dn2id_children( int bdb_dn2idl( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, struct berval *ndn, EntryInfo *ei, ID *ids, @@ -712,7 +712,7 @@ int hdb_dn2id_parent( Operation *op, DB_TXN *txn, - u_int32_t locker, + BDB_LOCKER locker, EntryInfo *ei, ID *idp ) { @@ -833,7 +833,7 @@ hdb_dn2id_children( struct dn2id_cookie { struct bdb_info *bdb; Operation *op; - u_int32_t locker; + BDB_LOCKER locker; EntryInfo *ei; ID *ids; ID *tmp; @@ -1064,7 +1064,7 @@ gotit: int hdb_dn2idl( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, struct berval *ndn, EntryInfo *ei, ID *ids, diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index a7d002348a..cd41d4eacc 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -27,39 +27,39 @@ static int presence_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeDescription *desc, ID *ids ); static int equality_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp ); static int inequality_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp, int gtorlt ); static int approx_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp ); static int substring_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, SubstringsAssertion *sub, ID *ids, ID *tmp ); static int list_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, Filter *flist, int ftype, ID *ids, @@ -69,7 +69,7 @@ static int list_candidates( static int ext_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion *mra, ID *ids, ID *tmp, @@ -79,7 +79,7 @@ ext_candidates( static int comp_candidates ( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion *mra, ComponentFilter *f, ID *ids, @@ -89,7 +89,7 @@ comp_candidates ( static int ava_comp_candidates ( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, AttributeAliasing *aa, ID *ids, @@ -100,7 +100,7 @@ ava_comp_candidates ( int bdb_filter_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, Filter *f, ID *ids, ID *tmp, @@ -231,7 +231,7 @@ out: static int comp_list_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion* mra, ComponentFilter *flist, int ftype, @@ -296,7 +296,7 @@ comp_list_candidates( static int comp_equality_candidates ( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion *mra, ComponentAssertion *ca, ID *ids, @@ -407,7 +407,7 @@ comp_equality_candidates ( static int ava_comp_candidates ( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, AttributeAliasing *aa, ID *ids, @@ -431,7 +431,7 @@ ava_comp_candidates ( static int comp_candidates ( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion *mra, ComponentFilter *f, ID *ids, @@ -480,7 +480,7 @@ comp_candidates ( static int ext_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, MatchingRuleAssertion *mra, ID *ids, ID *tmp, @@ -559,7 +559,7 @@ ext_candidates( static int list_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, Filter *flist, int ftype, ID *ids, @@ -625,7 +625,7 @@ list_candidates( static int presence_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeDescription *desc, ID *ids ) { @@ -696,7 +696,7 @@ done: static int equality_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp ) @@ -813,7 +813,7 @@ equality_candidates( static int approx_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp ) @@ -933,7 +933,7 @@ approx_candidates( static int substring_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, SubstringsAssertion *sub, ID *ids, ID *tmp ) @@ -1049,7 +1049,7 @@ substring_candidates( static int inequality_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, AttributeAssertion *ava, ID *ids, ID *tmp, diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index e66357cb10..98c75bb9fa 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -93,7 +93,7 @@ int bdb_id2entry_update( int bdb_id2entry( BackendDB *be, DB_TXN *tid, - u_int32_t locker, + BDB_LOCKER locker, ID id, Entry **e ) { @@ -318,7 +318,7 @@ int bdb_entry_get( int rc; const char *at_name = at ? at->ad_cname.bv_val : "(null)"; - u_int32_t locker = 0; + BDB_LOCKER locker = 0; DB_LOCK lock; int free_lock_id = 0; diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index 8f52540bd1..35d6d4890d 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -480,7 +480,7 @@ int bdb_idl_fetch_key( BackendDB *be, DB *db, - u_int32_t locker, + BDB_LOCKER locker, DBT *key, ID *ids, DBC **saved_cursor, diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 24cedde31a..01af4c2c46 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -451,7 +451,13 @@ shm_retry: } if ( !quick ) { +#if DB_VERSION_FULL >= 0x04060012 + u_int32_t lid; + XLOCK_ID(bdb->bi_dbenv, &lid); + __lock_getlocker(bdb->bi_dbenv->lk_handle, lid, 0, &bdb->bi_cache.c_locker); +#else XLOCK_ID(bdb->bi_dbenv, &bdb->bi_cache.c_locker); +#endif } entry_prealloc( bdb->bi_cache.c_maxsize ); @@ -543,7 +549,11 @@ bdb_db_close( BackendDB *be, ConfigReply *cr ) if( bdb->bi_dbenv ) { /* Free cache locker if we enabled locking */ if ( !( slapMode & SLAP_TOOL_QUICK )) { +#if DB_VERSION_FULL >= 0x04060012 + XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker->id); +#else XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker); +#endif bdb->bi_cache.c_locker = 0; } #ifdef BDB_REUSE_LOCKERS diff --git a/servers/slapd/back-bdb/key.c b/servers/slapd/back-bdb/key.c index 7128a6c5db..161caf7011 100644 --- a/servers/slapd/back-bdb/key.c +++ b/servers/slapd/back-bdb/key.c @@ -30,7 +30,7 @@ int bdb_key_read( Backend *be, DB *db, - u_int32_t locker, + BDB_LOCKER locker, struct berval *k, ID *ids, DBC **saved_cursor, diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 1ca4692a4c..df1cf3dfca 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -281,7 +281,7 @@ bdb_modify( Operation *op, SlapReply *rs ) Entry dummy = {0}; int fakeroot = 0; - u_int32_t locker = 0; + BDB_LOCKER locker = 0; DB_LOCK lock; int num_retries = 0; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 1497a19822..21954bafbd 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -46,7 +46,7 @@ bdb_modrdn( Operation *op, SlapReply *rs ) int manageDSAit = get_manageDSAit( op ); - u_int32_t locker = 0; + BDB_LOCKER locker = 0; DB_LOCK lock, plock, nplock; int num_retries = 0; diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 7d75164f94..b69325f2aa 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -84,7 +84,7 @@ bdb_db_cache( int bdb_dn2entry LDAP_P(( Operation *op, DB_TXN *tid, struct berval *dn, EntryInfo **e, int matched, - u_int32_t locker, DB_LOCK *lock )); + BDB_LOCKER locker, DB_LOCK *lock )); /* * dn2id.c @@ -120,7 +120,7 @@ int bdb_dn2id_children( int bdb_dn2idl( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, struct berval *ndn, EntryInfo *ei, ID *ids, @@ -133,7 +133,7 @@ int bdb_dn2idl( int bdb_dn2id_parent( Operation *op, DB_TXN *txn, - u_int32_t locker, + BDB_LOCKER locker, EntryInfo *ei, ID *idp ); @@ -168,7 +168,7 @@ char *ebcdic_dberror( int rc ); int bdb_filter_candidates( Operation *op, - u_int32_t locker, + BDB_LOCKER locker, Filter *f, ID *ids, ID *tmp, @@ -202,7 +202,7 @@ int bdb_id2entry_delete( int bdb_id2entry( BackendDB *be, DB_TXN *tid, - u_int32_t locker, + BDB_LOCKER locker, ID id, Entry **e); #endif @@ -285,7 +285,7 @@ unsigned bdb_idl_search( ID *ids, ID id ); int bdb_idl_fetch_key( BackendDB *be, DB *db, - u_int32_t locker, + BDB_LOCKER locker, DBT *key, ID *ids, DBC **saved_cursor, @@ -391,7 +391,7 @@ extern int bdb_key_read( Backend *be, DB *db, - u_int32_t locker, + BDB_LOCKER locker, struct berval *k, ID *ids, DBC **saved_cursor, @@ -513,7 +513,7 @@ int bdb_cache_add( EntryInfo *pei, Entry *e, struct berval *nrdn, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ); int bdb_cache_modrdn( @@ -522,14 +522,14 @@ int bdb_cache_modrdn( struct berval *nrdn, Entry *new, EntryInfo *ein, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ); int bdb_cache_modify( struct bdb_info *bdb, Entry *e, Attribute *newAttrs, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ); int bdb_cache_find_ndn( @@ -548,21 +548,21 @@ int bdb_cache_find_id( ID id, EntryInfo **eip, int islocked, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ); int bdb_cache_find_parent( Operation *op, DB_TXN *txn, - u_int32_t locker, + BDB_LOCKER locker, ID id, EntryInfo **res ); int bdb_cache_delete( struct bdb_info *bdb, Entry *e, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock ); void bdb_cache_delete_cleanup( @@ -582,7 +582,7 @@ int hdb_cache_load( #define bdb_cache_entry_db_relock BDB_SYMBOL(cache_entry_db_relock) int bdb_cache_entry_db_relock( struct bdb_info *bdb, - u_int32_t locker, + BDB_LOCKER locker, EntryInfo *ei, int rw, int tryOnly, @@ -596,7 +596,7 @@ int bdb_cache_entry_db_unlock( #define bdb_locker_id BDB_SYMBOL(locker_id) #define bdb_locker_flush BDB_SYMBOL(locker_flush) -int bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker ); +int bdb_locker_id( Operation *op, DB_ENV *env, BDB_LOCKER *locker ); void bdb_locker_flush( DB_ENV *env ); #define LOCK_ID_FREE(env, locker) ((void)0) diff --git a/servers/slapd/back-bdb/referral.c b/servers/slapd/back-bdb/referral.c index d31056eebb..03c60773c2 100644 --- a/servers/slapd/back-bdb/referral.c +++ b/servers/slapd/back-bdb/referral.c @@ -28,7 +28,7 @@ bdb_referrals( Operation *op, SlapReply *rs ) EntryInfo *ei; int rc = LDAP_SUCCESS; - u_int32_t locker; + BDB_LOCKER locker; DB_LOCK lock; if( op->o_tag == LDAP_REQ_SEARCH ) { diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 94dd7c87ae..e28c4b0993 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -31,7 +31,7 @@ static int search_candidates( Operation *op, SlapReply *rs, Entry *e, - u_int32_t locker, + BDB_LOCKER locker, ID *ids, ID *scopes ); @@ -51,7 +51,7 @@ static Entry * deref_base ( SlapReply *rs, Entry *e, Entry **matched, - u_int32_t locker, + BDB_LOCKER locker, DB_LOCK *lock, ID *tmp, ID *visited ) @@ -143,7 +143,7 @@ static int search_aliases( Operation *op, SlapReply *rs, Entry *e, - u_int32_t locker, + BDB_LOCKER locker, ID *ids, ID *scopes, ID *stack ) @@ -321,7 +321,7 @@ bdb_search( Operation *op, SlapReply *rs ) ID lastid = NOID; AttributeName *attrs; - u_int32_t locker = 0; + BDB_LOCKER locker = 0; DB_LOCK lock; struct bdb_op_info *opinfo = NULL; DB_TXN *ltid = NULL; @@ -1011,7 +1011,7 @@ static int search_candidates( Operation *op, SlapReply *rs, Entry *e, - u_int32_t locker, + BDB_LOCKER locker, ID *ids, ID *scopes ) {