]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/dn2id.c
Cleanup prev commit
[openldap] / servers / slapd / back-bdb / dn2id.c
index 05e482e1e389f8bbce188da75abdbb89b9ddb41d..c4f7cfac5e5355317bc75b5bdbe58c5c9d7828c2 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -332,6 +332,7 @@ bdb_dn2id_children(
 int
 bdb_dn2idl(
        Operation *op,
+       u_int32_t locker,
        Entry *e,
        ID *ids,
        ID *stack )
@@ -362,7 +363,7 @@ bdb_dn2idl(
        AC_MEMCPY( &((char *)key.data)[1], e->e_nname.bv_val, key.size - 1 );
 
        BDB_IDL_ZERO( ids );
-       rc = bdb_idl_fetch_key( op->o_bd, db, NULL, &key, ids, NULL, 0 );
+       rc = bdb_idl_fetch_key( op->o_bd, db, locker, &key, ids, NULL, 0 );
 
        if( rc != 0 ) {
                Debug( LDAP_DEBUG_TRACE,
@@ -830,6 +831,7 @@ hdb_dn2id_children(
 struct dn2id_cookie {
        struct bdb_info *bdb;
        Operation *op;
+       u_int32_t locker;
        EntryInfo *ei;
        ID *ids;
        ID *tmp;
@@ -1060,6 +1062,7 @@ gotit:
 int
 hdb_dn2idl(
        Operation       *op,
+       u_int32_t locker,
        Entry           *e,
        ID *ids,
        ID *stack )
@@ -1090,6 +1093,7 @@ hdb_dn2idl(
        cx.tmp = stack;
        cx.buf = stack + BDB_IDL_UM_SIZE;
        cx.op = op;
+       cx.locker = locker;
        cx.need_sort = 0;
        cx.depth = 0;
 
@@ -1118,7 +1122,8 @@ hdb_dn2idl(
                cx.key.size = sizeof(ID)+1;
                *ptr = cx.prefix;
                cx.id = e->e_id;
-               bdb_idl_cache_put( cx.bdb, cx.db, &cx.key, cx.ids, cx.rc );
+               if ( cx.bdb->bi_idl_cache_max_size )
+                       bdb_idl_cache_put( cx.bdb, cx.db, &cx.key, cx.ids, cx.rc );
        }
 
        if ( cx.rc == DB_NOTFOUND )