]> git.sur5r.net Git - openldap/commitdiff
Omit bei_rdn field from EntryInfo
authorHoward Chu <hyc@openldap.org>
Tue, 22 Apr 2003 18:59:37 +0000 (18:59 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 22 Apr 2003 18:59:37 +0000 (18:59 +0000)
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/dn2id.c

index c6743eb3153c21cf7c52a9b7188ff65f0660ea3a..d1028051dd35f045b0acd5776aa32f6649ac0fd3 100644 (file)
@@ -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)
index 3437ef3c75a4650a4d66628dd553a8b56fefe455..b3dbd63eaa44ab97dd4a2736a4107598f02f25b8 100644 (file)
@@ -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;
index 4dea214cd4ead4bda2a5ddf5fc803b4ac5300b27..810eee18426b4025344726173da9f9a2fcc9fd90 100644 (file)
@@ -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 );