]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/idl.c
ITS#4310 seems to affect also back-ldbm
[openldap] / servers / slapd / back-ldbm / idl.c
index f19ece31d0c38743b405cf7c3c79334b4d21fe4d..6feeee00501382d5b9179011413a33dd03cf3e2f 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -124,13 +124,9 @@ void
 idl_free( ID_BLOCK *idl )
 {
        if ( idl == NULL ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( INDEX, INFO, "idl_free: called with NULL pointer\n" , 0,0,0);
-#else
                Debug( LDAP_DEBUG_TRACE,
                        "idl_free: called with NULL pointer\n",
                        0, 0, 0 );
-#endif
 
                return;
        }
@@ -231,13 +227,8 @@ idl_fetch(
                cont_id( &data, ID_BLOCK_ID(idl, i) );
 
                if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) {
-#ifdef NEW_LOGGING
-                       LDAP_LOG( INDEX, INFO,
-                                  "idl_fetch: idl_fetch_one returned NULL\n", 0,0,0 );
-#else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_fetch: one returned NULL\n", 0, 0, 0 );
-#endif
 
                        continue;
                }
@@ -274,14 +265,8 @@ idl_fetch(
        idl_check(idl);
 #endif
 
-#ifdef NEW_LOGGING
-       LDAP_LOG( INDEX, ENTRY, 
-                  "idl_fetch: %ld ids (%ld max)\n",
-                  ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
-#else
        Debug( LDAP_DEBUG_TRACE, "<= idl_fetch %ld ids (%ld max)\n",
               ID_BLOCK_NIDS(idl), ID_BLOCK_NMAXN(idl), 0 );
-#endif
 
        return( idl );
 }
@@ -418,14 +403,9 @@ idl_change_first(
 
        /* delete old key block */
        if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( INDEX, INFO, 
-                          "idl_change_first: ldbm_cache_delete returned %d\n", rc, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: ldbm_cache_delete returned %d\n",
                        rc, 0, 0 );
-#endif
 
                return( rc );
        }
@@ -434,13 +414,8 @@ idl_change_first(
        cont_id( &bkey, ID_BLOCK_ID(b, 0) );
 
        if ( (rc = idl_store( be, db, bkey, b )) != 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( INDEX, INFO, 
-                          "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
-#endif
 
                return( rc );
        }
@@ -448,13 +423,8 @@ idl_change_first(
        /* update + write indirect header block */
        ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0);
        if ( (rc = idl_store( be, db, hkey, h )) != 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( INDEX, INFO, 
-                          "idl_change_first: idl_store returned %s\n", rc, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY,
                    "idl_change_first: idl_store returned %d\n", rc, 0, 0 );
-#endif
 
                return( rc );
        }
@@ -586,13 +556,8 @@ idl_insert_key(
        cont_id( &k2, ID_BLOCK_ID(idl, i) );
 
        if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG( INDEX, ERR,
-                          "idl_insert_key: nonexistent continuation block\n", 0, 0, 0 );
-#else
                Debug( LDAP_DEBUG_ANY, "idl_insert_key: nonexistent continuation block\n",
                    0, 0, 0 );
-#endif
 
                cont_free( &k2 );
                idl_free( idl );
@@ -603,13 +568,8 @@ idl_insert_key(
        switch ( idl_insert( &tmp, id, db->dbc_maxids ) ) {
        case 0:         /* id inserted ok */
                if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
-#ifdef NEW_LOGGING
-                       LDAP_LOG( INDEX, ERR, 
-                                  "ids_insert_key: idl_store returned %d\n", rc, 0, 0 );
-#else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
-#endif
 
                }
                break;
@@ -647,14 +607,9 @@ idl_insert_key(
                        cont_alloc( &k3, &key );
                        cont_id( &k3, ID_BLOCK_ID(idl, i + 1) );
                        if ( (tmp2 = idl_fetch_one( be, db, k3 )) == NULL ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( INDEX, ERR,
-                                          "idl_insert_key: idl_fetch_one returned NULL\n", 0, 0, 0);
-#else
                                Debug( LDAP_DEBUG_ANY,
                                    "idl_insert_key: idl_fetch_one returned NULL\n",
                                    0, 0, 0 );
-#endif
 
                                /* split the original block */
                                cont_free( &k3 );
@@ -676,13 +631,8 @@ idl_insert_key(
                            rc = idl_insert( &tmp, id, db->dbc_maxids );
 
                            if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( INDEX, ERR, 
-                                       "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
-#else
                                Debug( LDAP_DEBUG_ANY,
                            "idl_insert_key: idl_store returned %d\n", rc, 0, 0 );
-#endif
 
                            }
 
@@ -707,15 +657,9 @@ idl_insert_key(
                                         * will always be called.
                                         */
                                if ( rc == 2 ) {
-#ifdef NEW_LOGGING
-                                       LDAP_LOG( INDEX, INFO, 
-                                                  "idl_insert_key: id %ld is already in next block\n", 
-                                                  id, 0, 0 );
-#else
                                        Debug( LDAP_DEBUG_ANY,
                                            "idl_insert_key: id %ld already in next block\n",
                                            id, 0, 0 );
-#endif
 
                                }
 
@@ -968,13 +912,8 @@ idl_delete_key (
                cont_id( &data, ID_BLOCK_ID(idl, j) );
 
                if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) {
-#ifdef NEW_LOGGING
-                       LDAP_LOG( INDEX, INFO,
-                                  "idl_delete_key: idl_fetch_one returned NULL\n", 0, 0, 0 );
-#else
                        Debug( LDAP_DEBUG_ANY,
                            "idl_delete_key: idl_fetch of returned NULL\n", 0, 0, 0 );
-#endif
 
                        continue;
                }