From fcc59c64887cf1eaf8fa6d2f215325f4ac946895 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Thu, 14 Aug 2003 02:11:46 +0000 Subject: [PATCH] Proxy caching update : op->o_caching_on flag removed --- servers/slapd/back-ldbm/add.c | 26 ----------- servers/slapd/back-ldbm/delete.c | 6 --- servers/slapd/back-ldbm/modify.c | 13 ------ servers/slapd/back-ldbm/search.c | 63 -------------------------- servers/slapd/back-meta/cache-merge.c | 1 - servers/slapd/back-meta/cache-remove.c | 1 - servers/slapd/back-meta/cache-search.c | 1 - servers/slapd/slap.h | 4 -- 8 files changed, 115 deletions(-) diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 9b7f55835b..8e6b560302 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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; diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index e048ef65d1..50b027f5ad 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -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 ) { diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 2448c6ad42..a729fc3172 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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 */ diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 52461e5b95..8c09b37331 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -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(); diff --git a/servers/slapd/back-meta/cache-merge.c b/servers/slapd/back-meta/cache-merge.c index c3e92ecc4b..83e0c8ba2c 100644 --- a/servers/slapd/back-meta/cache-merge.c +++ b/servers/slapd/back-meta/cache-merge.c @@ -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; diff --git a/servers/slapd/back-meta/cache-remove.c b/servers/slapd/back-meta/cache-remove.c index a85e3b9346..4b1a65b004 100644 --- a/servers/slapd/back-meta/cache-remove.c +++ b/servers/slapd/back-meta/cache-remove.c @@ -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]; diff --git a/servers/slapd/back-meta/cache-search.c b/servers/slapd/back-meta/cache-search.c index 13c2f600a3..b8df2bb57d 100644 --- a/servers/slapd/back-meta/cache-search.c +++ b/servers/slapd/back-meta/cache-search.c @@ -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); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 8c72ab573d..ca56418b95 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 */ -- 2.39.5