From: Kurt Zeilenga Date: Wed, 26 Mar 2003 18:56:38 +0000 (+0000) Subject: Sync with HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_1_17~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7d462bec846d50bbcc344fe1c5acbd3ac350706;p=thirdparty%2Fopenldap.git Sync with HEAD --- diff --git a/servers/slapd/add.c b/servers/slapd/add.c index d0b393d364..5c4092e63a 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -455,13 +455,9 @@ slap_mods2entry( } else { int rc; - const char *text = NULL; - char textbuf[ SLAP_TEXT_BUFLEN ] = { '\0' }; - rc = modify_check_duplicates( mods->sml_desc, mr, NULL, mods->sml_bvalues, 0, - &text, textbuf, sizeof( textbuf ) ); - + text, textbuf, textlen ); if ( rc != LDAP_SUCCESS ) { return rc; } diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index ef753b29e1..d7ebd7ba1b 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -19,7 +19,9 @@ /* BDB backend specific entry info -- visible only to the cache */ typedef struct bdb_entry_info { +#if 0 ldap_pvt_thread_rdwr_t bei_rdwr; /* reader/writer lock */ +#endif /* * remaining fields require backend cache lock to access @@ -101,6 +103,7 @@ bdb_cache_entry_rdwr_unlock(Entry *e, int rw) } #endif /* unused */ +#if 0 static int bdb_cache_entry_rdwr_init(Entry *e) { @@ -112,6 +115,7 @@ bdb_cache_entry_rdwr_destroy(Entry *e) { return ldap_pvt_thread_rdwr_destroy( &BEI(e)->bei_rdwr ); } +#endif static int bdb_cache_entry_private_init( Entry *e ) @@ -125,11 +129,13 @@ bdb_cache_entry_private_init( Entry *e ) e->e_private = ch_calloc(1, sizeof(struct bdb_entry_info)); +#if 0 if( bdb_cache_entry_rdwr_init( e ) != 0 ) { free( BEI(e) ); e->e_private = NULL; return 1; } +#endif return 0; } @@ -205,7 +211,9 @@ bdb_cache_entry_private_destroy( Entry *e ) { assert( e->e_private ); +#if 0 bdb_cache_entry_rdwr_destroy( e ); +#endif free( e->e_private ); e->e_private = NULL; diff --git a/servers/slapd/back-bdb/index.c b/servers/slapd/back-bdb/index.c index 1ea5ad73f1..82268eaa09 100644 --- a/servers/slapd/back-bdb/index.c +++ b/servers/slapd/back-bdb/index.c @@ -22,7 +22,6 @@ static struct berval presence_key = {LUTIL_HASH_BYTES, presence_keyval}; static slap_mask_t index_mask( Backend *be, AttributeDescription *desc, - char **dbname, struct berval *atname ) { AttributeType *at; @@ -32,7 +31,6 @@ static slap_mask_t index_mask( if( mask ) { *atname = desc->ad_cname; - *dbname = desc->ad_cname.bv_val; return mask; } @@ -45,7 +43,6 @@ static slap_mask_t index_mask( if ( mask && ( mask ^ SLAP_INDEX_NOTAGS ) ) { *atname = desc->ad_type->sat_cname; - *dbname = desc->ad_type->sat_cname.bv_val; return mask; } } @@ -59,7 +56,6 @@ static slap_mask_t index_mask( if ( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) { *atname = at->sat_cname; - *dbname = at->sat_cname.bv_val; return mask; } } @@ -72,10 +68,9 @@ int bdb_index_is_indexed( AttributeDescription *desc ) { slap_mask_t mask; - char *dbname; struct berval prefix; - mask = index_mask( be, desc, &dbname, &prefix ); + mask = index_mask( be, desc, &prefix ); if( mask == 0 ) { return LDAP_INAPPROPRIATE_MATCHING; @@ -95,15 +90,14 @@ int bdb_index_param( int rc; slap_mask_t mask; DB *db; - char *dbname; - mask = index_mask( be, desc, &dbname, prefixp ); + mask = index_mask( be, desc, prefixp ); if( mask == 0 ) { return LDAP_INAPPROPRIATE_MATCHING; } - rc = bdb_db_cache( be, NULL, dbname, &db ); + rc = bdb_db_cache( be, NULL, prefixp->bv_val, &db ); if( rc != LDAP_SUCCESS ) { return rc; @@ -150,7 +144,6 @@ done: static int indexer( Backend *be, DB_TXN *txn, - char *dbname, struct berval *atname, BerVarray vals, ID id, @@ -165,16 +158,17 @@ static int indexer( assert( mask ); - rc = bdb_db_cache( be, txn, dbname, &db ); + rc = bdb_db_cache( be, txn, atname->bv_val, &db ); if ( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG( INDEX, ERR, - "bdb_index_read: Could not open DB %s\n", dbname, 0, 0 ); + "bdb_index_read: Could not open DB %s\n", + atname->bv_val, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, - "<= bdb_index_read NULL (could not open %s)\n", - dbname, 0, 0 ); + "bdb_index_read: Could not open DB %s\n", + atname->bv_val, 0, 0 ); #endif return LDAP_OTHER; } @@ -285,8 +279,7 @@ static int index_at_values( } if( mask ) { - rc = indexer( be, txn, type->sat_cname.bv_val, - &type->sat_cname, + rc = indexer( be, txn, &type->sat_cname, vals, id, op, mask ); @@ -304,8 +297,7 @@ static int index_at_values( } if( mask ) { - rc = indexer( be, txn, desc->ad_cname.bv_val, - &desc->ad_cname, + rc = indexer( be, txn, &desc->ad_cname, vals, id, op, mask ); diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 7365a2d655..635b5217b7 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -859,6 +859,7 @@ retry: /* transaction retry */ } } else { + bdb_cache_entry_commit( e ); if(( rc=TXN_COMMIT( ltid, 0 )) != 0 ) { text = "txn_commit failed"; } else { @@ -882,10 +883,6 @@ retry: /* transaction retry */ op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn ); #endif text = NULL; - if ( !noop ) { - bdb_cache_entry_commit( e ); - } - } else { #ifdef NEW_LOGGING LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n",