Attribute *ap;
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "ldbm_modify_internal: %s\n", dn ));
+ LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_modify_internal: %s\n", dn, 0, 0 );
#else
Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", dn, 0, 0);
#endif
switch ( mod->sm_op ) {
case LDAP_MOD_ADD:
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_modify_internal: add\n" ));
+ LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: add\n", 0, 0, 0);
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0);
#endif
rc = modify_add_values( e, mod, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_modify_internal: failed %d (%s)\n",
- rc, *text ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
case LDAP_MOD_DELETE:
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_modify_internal: delete\n" ));
+ LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: delete\n", 0,0,0);
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0);
#endif
assert( rc != LDAP_TYPE_OR_VALUE_EXISTS );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
case LDAP_MOD_REPLACE:
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_modify_internal: replace\n" ));
+ LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: replace\n",0,0,0);
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0);
#endif
rc = modify_replace_values( e, mod, text, textbuf, textlen );
- assert( rc != LDAP_TYPE_OR_VALUE_EXISTS );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
case SLAP_MOD_SOFTADD:
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "ldbm_modify_internal: softadd\n" ));
+ LDAP_LOG( BACK_LDBM, DETAIL1,
+ "ldbm_modify_internal: softadd\n", 0, 0, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0);
#endif
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_modify_internal: failed %d (%s)\n", rc, *text ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
default:
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
- "ldbm_modify_internal: invalid op %d\n", mod->sm_op ));
+ LDAP_LOG( BACK_LDBM, ERR,
+ "ldbm_modify_internal: invalid op %d\n", mod->sm_op, 0, 0 );
#else
Debug(LDAP_DEBUG_ANY, "ldbm_modify_internal: invalid op %d\n",
mod->sm_op, 0, 0);
rc = LDAP_OTHER;
*text = "Invalid modify operation";
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_modify_internal: %d (%s)\n", rc, *text ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_modify_internal: %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
rc = entry_schema_check( be, e, save_attrs, text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
- "ldbm_modify_internal: entry failed schema check: %s\n",
- *text ));
+ LDAP_LOG( BACK_LDBM, ERR,
+ "ldbm_modify_internal: entry failed schema check: %s\n",
+ *text, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",
*text, 0, 0 );
}
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
- rc = op->o_abandon;
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
- if ( rc ) {
+ if ( op->o_abandon ) {
rc = SLAPD_ABANDON;
goto exit;
}
SLAP_INDEX_DELETE_OP );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
- "ldbm_modify_internal: Attribute index delete failure\n" ));
+ LDAP_LOG( BACK_LDBM, ERR,
+ "ldbm_modify_internal: Attribute index delete failure\n",
+ 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Attribute index delete failure",
SLAP_INDEX_ADD_OP );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
- "ldbm_modify_internal: Attribute index add failure\n" ));
+ LDAP_LOG( BACK_LDBM, ERR,
+ "ldbm_modify_internal: Attribute index add failure\n",
+ 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"Attribute index add failure",
size_t textlen = sizeof textbuf;
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "ldbm_back_modify: enter\n" ));
+ LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_back_modify: enter\n", 0, 0, 0);
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
#endif
+ /* grab giant lock for writing */
+ ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
/* acquire and lock entry */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
NULL, dn, LDAP_SCOPE_DEFAULT );
}
+ ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
conn, op, e );
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
- "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val ));
+ LDAP_LOG( BACK_LDBM, INFO,
+ "ldbm_back_modify: entry (%s) is referral\n", ndn->bv_val, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
NULL, NULL, NULL, NULL );
cache_return_entry_w( &li->li_cache, e );
+ ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
return( 0 );
error_return:;
cache_return_entry_w( &li->li_cache, e );
+ ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
return( -1 );
}