Commit e7d462be authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Sync with HEAD

parent 6d472750
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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",
......
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