X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Fdn2entry.c;h=c2817e23b22104671732c539b0c06adff54c940b;hb=5d9479a3e82cc1ed5260f26878bf710a3b65faec;hp=7568035eeb05b53e81497c8b7765db40101b5352;hpb=61a15be30a64e79667f96c0998f5f507254fd751;p=openldap diff --git a/servers/slapd/back-bdb/dn2entry.c b/servers/slapd/back-bdb/dn2entry.c index 7568035eeb..c2817e23b2 100644 --- a/servers/slapd/back-bdb/dn2entry.c +++ b/servers/slapd/back-bdb/dn2entry.c @@ -1,7 +1,7 @@ /* dn2entry.c - routines to deal with the dn2id / id2entry glue */ /* $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 */ @@ -12,43 +12,52 @@ #include "back-bdb.h" + /* * dn2entry - look up dn in the cache/indexes and return the corresponding * entry. */ int -bdb_dn2entry( - Backend *be, +bdb_dn2entry_rw( + BackendDB *be, DB_TXN *tid, - const char *dn, + struct berval *dn, Entry **e, - Entry **matched, - int flags ) + Entry **matched, + int flags, + int rw, + u_int32_t locker, + DB_LOCK *lock ) { int rc; - ID id; - char *matchedDN = NULL; + ID id, id2 = 0; + +#ifdef NEW_LOGGING + LDAP_LOG ( CACHE, ARGS, "bdb_dn2entry_rw(\"%s\")\n", dn->bv_val, 0, 0 ); +#else + Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry_rw(\"%s\")\n", + dn->bv_val, 0, 0 ); +#endif - Debug(LDAP_DEBUG_TRACE, "bdb_dn2entry: dn: \"%s\"\n", - dn, 0, 0 ); + *e = NULL; if( matched != NULL ) { - rc = bdb_dn2id_matched( be, tid, dn, &id, &matchedDN ); + *matched = NULL; + rc = bdb_dn2id_matched( be, tid, dn, &id, &id2, flags ); } else { - rc = bdb_dn2id( be, tid, dn, &id ); + rc = bdb_dn2id( be, tid, dn, &id, flags ); } if( rc != 0 ) { return rc; } - if( matchedDN == NULL ) { - rc = bdb_id2entry( be, tid, id, e ); + if( id2 == 0 ) { + rc = bdb_id2entry_rw( be, tid, id, e, rw, locker, lock ); } else { - ch_free( matchedDN ); - rc = bdb_id2entry( be, tid, id, matched ); + rc = bdb_id2entry_r( be, tid, id2, matched, locker, lock ); } return rc; -} \ No newline at end of file +}