]> git.sur5r.net Git - openldap/commitdiff
Proxy caching update : op->o_caching_on flag removed
authorJong Hyuk Choi <jongchoi@openldap.org>
Thu, 14 Aug 2003 02:11:46 +0000 (02:11 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Thu, 14 Aug 2003 02:11:46 +0000 (02:11 +0000)
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/search.c
servers/slapd/back-meta/cache-merge.c
servers/slapd/back-meta/cache-remove.c
servers/slapd/back-meta/cache-search.c
servers/slapd/slap.h

index 9b7f55835bcf5068fab0324a9f22c8f56c207ada..8e6b560302ea10623b6efd2a1e589b7d4a5c078f 100644 (file)
@@ -39,15 +39,7 @@ ldbm_back_add(
        Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", op->o_req_dn.bv_val, 0, 0);
 #endif
        
-#ifndef LDAP_CACHING
        rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen );
-#else /* LDAP_CACHING */
-        if ( !op->o_caching_on ) {
-               rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL, &rs->sr_text, textbuf, textlen );
-       } else {
-               rs->sr_err = LDAP_SUCCESS;
-       }
-#endif /* LDAP_CACHING */
 
        if ( rs->sr_err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
@@ -70,9 +62,6 @@ ldbm_back_add(
        subentry = is_entry_subentry( op->oq_add.rs_e );
 #endif
 
-#ifdef LDAP_CACHING
-       if ( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
        if ( !access_allowed( op, op->oq_add.rs_e,
                                entry, NULL, ACL_WRITE, NULL ) )
        {
@@ -94,9 +83,6 @@ ldbm_back_add(
                return -1;
 #endif
        }
-#ifdef LDAP_CACHING
-       }
-#endif /* LDAP_CACHING */
 
        /* grab giant lock for writing */
        ldap_pvt_thread_rdwr_wlock(&li->li_giant_rwlock);
@@ -125,11 +111,7 @@ ldbm_back_add(
                dnParent( &op->o_req_ndn, &pdn );
        }
 
-#ifndef LDAP_CACHING
        if( pdn.bv_len )
-#else /* LDAP_CACHING */
-       if( pdn.bv_len && !op->o_caching_on )
-#endif /* LDAP_CACHING */
        {
                Entry *matched = NULL;
 
@@ -277,21 +259,13 @@ ldbm_back_add(
 #endif
 
        } else {
-#ifndef LDAP_CACHING
                if( pdn.bv_val != NULL )
-#else /* LDAP_CACHING */
-               if( pdn.bv_val != NULL && !op->o_caching_on )
-#endif /* LDAP_CACHING */
                {
                        assert( *pdn.bv_val == '\0' );
                }
 
                /* no parent, must be adding entry to root */
-#ifndef LDAP_CACHING
                if ( !be_isroot( op->o_bd, &op->o_ndn ) )
-#else /* LDAP_CACHING */
-               if ( !be_isroot( op->o_bd, &op->o_ndn ) && !op->o_caching_on )
-#endif /* LDAP_CACHING */
                {
                        if ( be_issuffix( op->o_bd, (struct berval *)&slap_empty_bv ) || be_isupdate( op->o_bd, &op->o_ndn ) ) {
                                p = (Entry *)&slap_entry_root;
index e048ef65d10977bd324802e762c215736c7153d1..50b027f5adae77ab36a719721be31d4812c9b4e4 100644 (file)
@@ -84,9 +84,6 @@ ldbm_back_delete(
        }
 
        /* check entry for "entry" acl */
-#ifdef LDAP_CACHING
-       if( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
        if ( ! access_allowed( op, e,
                entry, NULL, ACL_WRITE, NULL ) )
        {
@@ -226,9 +223,6 @@ ldbm_back_delete(
                        }
                }
        }
-#ifdef LDAP_CACHING
-       }
-#endif /* LDAP_CACHING */
 
        /* delete from dn2id mapping */
        if ( dn2id_delete( op->o_bd, &e->e_nname, e->e_id ) != 0 ) {
index 2448c6ad42c639aaa26d83e596cfb96f34583c3c..a729fc3172d478551c3d0776e7f574794e1d28fd 100644 (file)
@@ -209,16 +209,7 @@ int ldbm_modify_internal(
        }
 
        /* check that the entry still obeys the schema */
-#ifndef LDAP_CACHING
        rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
-#else /* LDAP_CACHING */
-       if ( !op->o_caching_on ) {
-               rc = entry_schema_check( op->o_bd, e, save_attrs,
-                               text, textbuf, textlen );
-       } else {
-               rc = LDAP_SUCCESS; 
-       }
-#endif /* LDAP_CACHING */
 
        if ( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
@@ -358,11 +349,7 @@ ldbm_back_modify(
 #endif
        }
 
-#ifndef LDAP_CACHING
        if ( !manageDSAit && is_entry_referral( e ) )
-#else /* LDAP_CACHING */
-       if ( !op->o_caching_on && !manageDSAit && is_entry_referral( e ) )
-#endif /* LDAP_CACHING */
        {
                /* parent is a referral, don't allow add */
                /* parent is an alias, don't allow add */
index 52461e5b95f044221eeed5150482abf4bdfcb976..8c09b37331e7e939216cde6fb16698fd6ec65e83 100644 (file)
@@ -57,7 +57,6 @@ ldbm_back_search(
        /* grab giant lock for reading */
        ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
 
-#ifndef LDAP_CACHING
        if ( op->o_req_ndn.bv_len == 0 ) {
                /* DIT root special case */
                e = (Entry *) &slap_entry_root;
@@ -65,25 +64,6 @@ ldbm_back_search(
                /* need normalized dn below */
                ber_dupbv( &realbase, &e->e_nname );
 
-#else /* LDAP_CACHING */
-       if ( op->o_caching_on || op->o_req_ndn.bv_len == 0 ) {
-               if (op->o_req_ndn.bv_len == 0) {
-                   e = (Entry *) &slap_entry_root;
-                   /* need normalized dn below */
-                   ber_dupbv( &realbase, &e->e_nname );
-               } else {
-                       if ((op->oq_search.rs_scope == LDAP_SCOPE_BASE) 
-                                       && (e = dn2entry_r( op->o_bd, &op->o_req_ndn, &matched )))
-                       {
-                               candidates = base_candidate(op->o_bd, e);
-                               cache_return_entry_r( &li->li_cache, e );
-                               goto searchit;
-                       }
-                       cache_base_entry.e_nname = op->o_req_ndn;
-                       e = &cache_base_entry;
-               }
-#endif /* LDAP_CACHING */
-
                candidates = search_candidates( op, e, op->oq_search.rs_filter,
                                op->oq_search.rs_scope, op->oq_search.rs_deref,
                                manageDSAit || get_domainScope(op) );
@@ -221,21 +201,10 @@ searchit:
                Debug( LDAP_DEBUG_TRACE, "ldbm_search: no candidates\n",
                        0, 0, 0 );
 #endif
-#ifdef LDAP_CACHING
-                if ( op->o_caching_on ) {
-                       ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
-               }
-#endif /* LDAP_CACHING */
 
                rs->sr_err = LDAP_SUCCESS;
                send_ldap_result( op, rs );
 
-#ifdef LDAP_CACHING
-               if ( op->o_caching_on ) {
-                       ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
-               }
-#endif /* LDAP_CACHING */
-
 #ifdef LDAP_SYNCREPL
                rc = LDAP_OTHER;
 #else
@@ -245,11 +214,7 @@ searchit:
        }
 
        /* if not root, get appropriate limits */
-#ifndef LDAP_CACHING
        if ( be_isroot( op->o_bd, &op->o_ndn ) )
-#else /* LDAP_CACHING */
-       if ( op->o_caching_on || be_isroot( op->o_bd, &op->o_ndn ) )
-#endif /* LDAP_CACHING */
        {
                /*
                 * FIXME: I'd consider this dangerous if someone
@@ -391,10 +356,6 @@ searchit:
        }
 #endif
 
-#ifdef LDAP_CACHING
-                if ( !op->o_caching_on ) {
-#endif /* LDAP_CACHING */
-
                if ( op->oq_search.rs_deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) {
                        Entry *matched;
                        int err;
@@ -493,10 +454,6 @@ searchit:
                        goto loop_continue;
                }
 
-#ifdef LDAP_CACHING
-               }
-#endif /* LDAP_CACHING */
-
 #ifdef LDAP_SYNCREPL
                if ( !manageDSAit && is_entry_glue( e )) {
                        goto loop_continue;
@@ -537,22 +494,8 @@ searchit:
 
                                if (e) {
 
-#ifdef LDAP_CACHING
-                                       if ( op->o_caching_on ) {
-                                               ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
-                                               cache_return_entry_r( &li->li_cache, e );
-                                       }
-#endif /* LDAP_CACHING */
-
                                        result = send_search_entry( op, rs );
 
-#ifdef LDAP_CACHING
-                                       if ( op->o_caching_on ) {
-                                               ldap_pvt_thread_rdwr_rlock( &li->li_giant_rwlock );
-                                       }
-#endif /* LDAP_CACHING */
-
-
                                        switch (result) {
                                        case 0:         /* entry sent ok */
                                                break;
@@ -591,13 +534,7 @@ searchit:
 loop_continue:
                if( e != NULL ) {
                        /* free reader lock */
-#ifndef LDAP_CACHING
                        cache_return_entry_r( &li->li_cache, e );
-#else /* LDAP_CACHING */
-                       if ( !op->o_caching_on ) {
-                               cache_return_entry_r( &li->li_cache, e );
-                       }
-#endif /* LDAP_CACHING */
                }
 
                ldap_pvt_thread_yield();
index c3e92ecc4bfde945e8f2ea33844486073dd0c526..83e0c8ba2cdf4459aea1962e21bd6aa479b8d2af 100644 (file)
@@ -161,7 +161,6 @@ merge_entry(
        op_tmp.o_tag = LDAP_REQ_ADD;
        op_tmp.o_protocol = LDAP_VERSION3;
        op_tmp.o_callback = &cb;
-       op_tmp.o_caching_on = 0;
        op_tmp.o_time = slap_get_time();
        op_tmp.o_do_not_cache = 1;
 
index a85e3b9346c5cb4f5c2d3447be3ce024c596080b..4b1a65b0046fdc15815173e33c8bfc95a59c231a 100644 (file)
@@ -80,7 +80,6 @@ remove_query_data (
        op_tmp.o_callback = &cb;
        op_tmp.o_time = slap_get_time();
        op_tmp.o_do_not_cache = 1;
-       op_tmp.o_caching_on = 0; 
 
        op_tmp.o_req_dn = op->o_bd->be_suffix[0];
        op_tmp.o_req_ndn = op->o_bd->be_nsuffix[0];
index 13c2f600a3ae41275498192cf916836651756e74..b8df2bb57d1cf2727719dd38d4310303b4b2a343 100644 (file)
@@ -404,7 +404,6 @@ meta_back_cache_search(
                op_tmp.o_req_dn = cachebase;
                op_tmp.o_req_ndn = ncachebase;
 
-               op_tmp.o_caching_on = 0; 
                op_tmp.o_callback = &cb; 
 
                li->glue_be->be_search(&op_tmp, rs);
index 8c72ab573d1f42db381c42a601aa9db3bdeb9196..ca56418b9557ee32f373e5d63e12f5803d6ea93b 100644 (file)
@@ -1977,10 +1977,6 @@ typedef struct slap_op {
        syncinfo_t*     o_si;
 #endif
 
-#ifdef LDAP_CACHING 
-       char            o_caching_on; 
-#endif /*LDAP_CACHING */ 
-
 #ifdef LDAP_SLAPI
        void    *o_pb;                  /* NS-SLAPI plugin */
        void    *o_extensions;          /* NS-SLAPI plugin */