X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-ldbm%2Fkey.c;h=0ea188a473bdf1c6f3d185da46c0ffa41495683c;hb=c5b6a86502dc0c16027cd87e3d9544e9078083db;hp=de8b90565eee91e3eb0996a7ba1aac54c2707f6d;hpb=3281138bcfae5aea0e42cf5aa9c368753a56bf46;p=openldap diff --git a/servers/slapd/back-ldbm/key.c b/servers/slapd/back-ldbm/key.c index de8b90565e..0ea188a473 100644 --- a/servers/slapd/back-ldbm/key.c +++ b/servers/slapd/back-ldbm/key.c @@ -1,7 +1,7 @@ /* index.c - routines for dealing with attribute indexes */ /* $OpenLDAP$ */ /* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -28,8 +28,7 @@ key_read( ID_BLOCK *idl; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_read: enter\n" )); + LDAP_LOG( INDEX, ENTRY, "key_read: enter\n", 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 ); #endif @@ -42,9 +41,8 @@ key_read( idl = idl_fetch( be, db, key ); #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_read: %ld candidates\n", - idl ? ID_BLOCK_NIDS(idl) : 0 )); + LDAP_LOG( INDEX, ENTRY, + "key_read: %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n", idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 ); @@ -69,9 +67,8 @@ key_change( Datum key; #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_change: %s ID %lx\n", - op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id )); + LDAP_LOG( INDEX, ENTRY, "key_change: %s ID %lx\n", + op == SLAP_INDEX_ADD_OP ? "Add" : "Delete", (long)id, 0 ); #else Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n", op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 ); @@ -82,6 +79,7 @@ key_change( key.dptr = k->bv_val; key.dsize = k->bv_len; + ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex ); if (op == SLAP_INDEX_ADD_OP) { /* Add values */ rc = idl_insert_key( be, db, key, id ); @@ -90,11 +88,11 @@ key_change( /* Delete values */ rc = idl_delete_key( be, db, key, id ); } + ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex ); #ifdef NEW_LOGGING - LDAP_LOG(( "index", LDAP_LEVEL_ENTRY, - "key_change: return %d\n", rc )); + LDAP_LOG( INDEX, ENTRY, "key_change: return %d\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 ); #endif