Commit c7d3d423 authored by Howard Chu's avatar Howard Chu
Browse files

Omit bei_rdn field from EntryInfo

parent 7c39a5e7
......@@ -90,7 +90,9 @@ typedef struct bdb_entry_info {
* remaining fields require backend cache lock to access
*/
struct berval bei_nrdn;
#ifdef BDB_HIER
struct berval bei_rdn;
#endif
Entry *bei_e;
Avlnode *bei_kids;
ldap_pvt_thread_mutex_t bei_kids_mutex;
......@@ -149,8 +151,6 @@ struct bdb_info {
int bi_lock_detect;
long bi_shm_key;
int bi_is_hier;
ID bi_lastid;
ldap_pvt_thread_mutex_t bi_lastid_mutex;
#if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
......
......@@ -269,7 +269,9 @@ bdb_entryinfo_add_internal(
}
ei2->bei_id = ei->bei_id;
ei2->bei_parent = ei->bei_parent;
#ifdef BDB_HIER
ei2->bei_rdn = ei->bei_rdn;
#endif
/* Add to cache ID tree */
if (avl_insert( &cache->c_idtree, ei2, bdb_id_cmp, avl_dup_error )) {
......@@ -279,8 +281,10 @@ bdb_entryinfo_add_internal(
ei2 = eix;
addkid = 0;
cache->c_cursize -= incr;
#ifdef BDB_HIER
if ( ei->bei_rdn.bv_val )
ber_memfree_x( ei->bei_rdn.bv_val, NULL );
#endif
} else {
LRU_ADD( cache, ei2 );
ber_dupbv( &ei2->bei_nrdn, &ei->bei_nrdn );
......@@ -421,9 +425,11 @@ bdb_cache_find_parent(
/* Create a new node for the current ID */
ein = bdb_cache_entryinfo_new();
ein->bei_id = ei.bei_id;
ein->bei_kids = ei.bei_kids;
ein->bei_nrdn = ei.bei_nrdn;
#ifdef BDB_HIER
ein->bei_rdn = ei.bei_rdn;
ein->bei_kids = ei.bei_kids;
#endif
/* This node is not fully connected yet */
ein->bei_state = CACHE_ENTRY_NOT_LINKED;
......@@ -618,11 +624,13 @@ bdb_cache_add(
ei.bei_id = e->e_id;
ei.bei_parent = eip;
ei.bei_nrdn = *nrdn;
#ifdef BDB_HIER
if ( nrdn->bv_len != e->e_nname.bv_len ) {
char *ptr = strchr( rdn.bv_val, ',' );
rdn.bv_len = ptr - rdn.bv_val;
}
ber_dupbv( &ei.bei_rdn, &rdn );
#endif
rc = bdb_entryinfo_add_internal( bdb, &ei, &new, locker );
new->bei_e = e;
e->e_private = new;
......@@ -703,14 +711,17 @@ bdb_cache_modrdn(
bdb_cache_entryinfo_lock( pei );
avl_delete( &pei->bei_kids, (caddr_t) ei, bdb_rdn_cmp );
free( ei->bei_nrdn.bv_val );
free( ei->bei_rdn.bv_val );
ber_dupbv( &ei->bei_nrdn, nrdn );
#ifdef BDB_HIER
free( ei->bei_rdn.bv_val );
rdn = e->e_name;
if ( nrdn->bv_len != e->e_nname.bv_len ) {
char *ptr = strchr(rdn.bv_val, ',');
rdn.bv_len = ptr - rdn.bv_val;
}
ber_dupbv( &ei->bei_rdn, &rdn );
#endif
if (!ein) {
ein = ei->bei_parent;
......
......@@ -313,7 +313,6 @@ bdb_dn2id(
#else
Debug( LDAP_DEBUG_TRACE, "=> bdb_dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
#endif
DBTzero( &key );
key.size = dn->bv_len + 2;
key.data = sl_malloc( key.size, ctx );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment