]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Sync with HEAD
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Mar 2003 18:56:38 +0000 (18:56 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Mar 2003 18:56:38 +0000 (18:56 +0000)
servers/slapd/add.c
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/index.c
servers/slapd/back-bdb/modrdn.c

index d0b393d3646b46bafc5c1efb3bc9a3da9b69f83e..5c4092e63a4f45935afe67a28021a082506dfedc 100644 (file)
@@ -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;
                                }
index ef753b29e1c93a187937ac76edeeb96457f7b911..d7ebd7ba1b02eea4bbbfaa8da30972f2712b6838 100644 (file)
@@ -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;
index 1ea5ad73f1233e93c6654ea9f68a6f5030d6b675..82268eaa09864d885982a823e75e58f63c834620 100644 (file)
@@ -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 );
 
index 7365a2d6551412839a2e3edfec0f26922e9308b1..635b5217b76b08e2c214838fb531c8862460e3a1 100644 (file)
@@ -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",