From 9760933c200263e6540f9e43d61a95c2b1849236 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Wed, 27 Aug 2003 23:21:17 +0000 Subject: [PATCH] unifdef LDAP_CACHING --- servers/slapd/back-meta/back-meta.h | 2 -- servers/slapd/back-meta/cache-config.c | 2 -- servers/slapd/back-meta/cache-merge.c | 4 ---- servers/slapd/back-meta/cache-query.c | 2 -- servers/slapd/back-meta/cache-remove.c | 3 --- servers/slapd/back-meta/cache-search.c | 2 -- servers/slapd/back-meta/cache-substring.c | 2 -- servers/slapd/back-meta/cache-template.c | 2 -- servers/slapd/back-meta/cache.h | 2 -- servers/slapd/back-meta/config.c | 8 -------- servers/slapd/back-meta/init.c | 4 ---- servers/slapd/back-meta/search.c | 2 -- servers/slapd/schema_prep.c | 2 -- servers/slapd/slap.h | 3 --- 14 files changed, 40 deletions(-) diff --git a/servers/slapd/back-meta/back-meta.h b/servers/slapd/back-meta/back-meta.h index 41b6cda628..56623fc640 100644 --- a/servers/slapd/back-meta/back-meta.h +++ b/servers/slapd/back-meta/back-meta.h @@ -150,11 +150,9 @@ struct metainfo { #define META_DEFAULT_TARGET_NONE -1 struct metatarget **targets; -#ifdef LDAP_CACHING struct rewrite_info *rwinfo; cache_manager *cm; Backend *glue_be; -#endif /* LDAP_CACHING */ struct metadncache cache; diff --git a/servers/slapd/back-meta/cache-config.c b/servers/slapd/back-meta/cache-config.c index a4417949f2..b14e28a3e0 100644 --- a/servers/slapd/back-meta/cache-config.c +++ b/servers/slapd/back-meta/cache-config.c @@ -27,7 +27,6 @@ #include "../back-ldap/back-ldap.h" #include "back-meta.h" -#ifdef LDAP_CACHING #define MAX_ATTR_SETS 500 static void find_supersets( struct attr_set* attr_sets, int numsets ); static int compare_sets( struct attr_set* setA, int, int ); @@ -329,4 +328,3 @@ compare_sets(struct attr_set* set, int i, int j) return result; } -#endif diff --git a/servers/slapd/back-meta/cache-merge.c b/servers/slapd/back-meta/cache-merge.c index 83e0c8ba2c..211ec672e3 100644 --- a/servers/slapd/back-meta/cache-merge.c +++ b/servers/slapd/back-meta/cache-merge.c @@ -34,8 +34,6 @@ #include "../../../libraries/libldap/ldap-int.h" #include -#ifdef LDAP_CACHING - static struct berval bv_queryid_any = BER_BVC( "(queryid=*)" ); static Attribute* @@ -286,5 +284,3 @@ normalize_values( Attribute* attr ) return LDAP_SUCCESS; } - -#endif /* LDAP_CACHING */ diff --git a/servers/slapd/back-meta/cache-query.c b/servers/slapd/back-meta/cache-query.c index 99db22d878..1571ec380f 100644 --- a/servers/slapd/back-meta/cache-query.c +++ b/servers/slapd/back-meta/cache-query.c @@ -26,7 +26,6 @@ #include "../back-ldap/back-ldap.h" #include "back-meta.h" -#ifdef LDAP_CACHING static void add_query_on_top (query_manager*, CachedQuery*); static int base_scope_compare(struct berval* dn_stored, struct berval* dn_incoming, int scope_stored, @@ -465,4 +464,3 @@ remove_from_template (CachedQuery* qc, QueryTemplate* template) template->no_of_queries--; } -#endif diff --git a/servers/slapd/back-meta/cache-remove.c b/servers/slapd/back-meta/cache-remove.c index 4b1a65b004..f375ea11eb 100644 --- a/servers/slapd/back-meta/cache-remove.c +++ b/servers/slapd/back-meta/cache-remove.c @@ -34,7 +34,6 @@ #include "../../../libraries/libldap/ldap-int.h" #include -#ifdef LDAP_CACHING static int remove_func ( Operation *op, @@ -188,5 +187,3 @@ remove_func ( return 0; } - -#endif /* LDAP_CACHING */ diff --git a/servers/slapd/back-meta/cache-search.c b/servers/slapd/back-meta/cache-search.c index b8df2bb57d..8f61bef9f6 100644 --- a/servers/slapd/back-meta/cache-search.c +++ b/servers/slapd/back-meta/cache-search.c @@ -104,7 +104,6 @@ #include "ldap_log.h" #include "../../../libraries/libldap/ldap-int.h" -#ifdef LDAP_CACHING static Entry* meta_create_entry( Backend *be, @@ -1840,4 +1839,3 @@ cache_back_sentry( return 0; } } -#endif diff --git a/servers/slapd/back-meta/cache-substring.c b/servers/slapd/back-meta/cache-substring.c index 8871093620..574ec2509e 100644 --- a/servers/slapd/back-meta/cache-substring.c +++ b/servers/slapd/back-meta/cache-substring.c @@ -35,7 +35,6 @@ #include "slap.h" #include "back-meta.h" -#ifdef LDAP_CACHING static char* invert_string(char* string); static struct berval* merge_init_final(struct berval*, struct berval*, struct berval*); static int strings_containment(struct berval* stored, struct berval* incoming); @@ -287,4 +286,3 @@ final: */ return rc; } -#endif diff --git a/servers/slapd/back-meta/cache-template.c b/servers/slapd/back-meta/cache-template.c index bad7b5b8d3..64fd2d28aa 100644 --- a/servers/slapd/back-meta/cache-template.c +++ b/servers/slapd/back-meta/cache-template.c @@ -30,7 +30,6 @@ #undef ldap_debug /* silence a warning in ldap-int.h */ #include "../../../libraries/libldap/ldap-int.h" -#ifdef LDAP_CACHING void filter2template( Filter *f, @@ -244,4 +243,3 @@ filter2template( return; } } -#endif /* LDAP_CACHING */ diff --git a/servers/slapd/back-meta/cache.h b/servers/slapd/back-meta/cache.h index 2e2328cefd..1f7a50c083 100644 --- a/servers/slapd/back-meta/cache.h +++ b/servers/slapd/back-meta/cache.h @@ -27,7 +27,6 @@ EVEN #define META_CACHE_H #include "slap.h" -#ifdef LDAP_CACHING /* cache specific errors */ enum type_of_result { @@ -215,4 +214,3 @@ remove_query_data ( struct exception* result ); #endif -#endif diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index f404141cd6..9685449d89 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -522,17 +522,11 @@ meta_back_db_config( int i = li->ntargets-1; if ( i < 0 ) { -#ifndef LDAP_CACHING - fprintf( stderr, - "%s: line %d: need \"uri\" directive first\n", - fname, lineno ); -#else /* LDAP_CACHING */ if ( strcasecmp( argv[0], "rewriteEngine" ) == 0 ) { li->rwinfo = rewrite_info_init( REWRITE_MODE_USE_DEFAULT ); } return rewrite_parse(li->rwinfo, fname, lineno, argc, argv); -#endif /* LDAP_CACHING */ } return rewrite_parse( li->targets[ i ]->rwmap.rwm_rw, fname, lineno, @@ -554,11 +548,9 @@ meta_back_db_config( fname, lineno, argc, argv ); /* anything else */ } else { -#ifdef LDAP_CACHING if ( meta_back_cache_config( be, fname, lineno, argc, argv ) == 0 ) { return 0; } -#endif /* LDAP_CACHING */ fprintf( stderr, "%s: line %d: unknown directive \"%s\" in meta database definition" diff --git a/servers/slapd/back-meta/init.c b/servers/slapd/back-meta/init.c index 184b22cbeb..3f8009a185 100644 --- a/servers/slapd/back-meta/init.c +++ b/servers/slapd/back-meta/init.c @@ -136,7 +136,6 @@ meta_back_db_init( { struct metainfo *li; -#ifdef LDAP_CACHING struct rewrite_info *rwinfo; cache_manager *cm; query_manager *qm; @@ -187,7 +186,6 @@ meta_back_db_init( ldap_pvt_thread_mutex_init(&cm->cache_mutex); ldap_pvt_thread_mutex_init(&cm->remove_mutex); ldap_pvt_thread_mutex_init( &cm->cc_mutex ); -#endif /* LDAP_CACHING */ li = ch_calloc( 1, sizeof( struct metainfo ) ); if ( li == NULL ) { @@ -199,11 +197,9 @@ meta_back_db_init( * this may change */ li->defaulttarget = META_DEFAULT_TARGET_NONE; -#ifdef LDAP_CACHING li->cm = cm; li->rwinfo = rwinfo; /* FIXME: what about qm ? */ -#endif /* LDAP_CACHING */ ldap_pvt_thread_mutex_init( &li->conn_mutex ); ldap_pvt_thread_mutex_init( &li->cache.mutex ); diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 6ac2a91e5f..940ce702cc 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -114,13 +114,11 @@ meta_back_search( Operation *op, SlapReply *rs ) int isroot = 0; dncookie dc; -#ifdef LDAP_CACHING cache_manager* cm = li->cm; if (cm->caching) { return meta_back_cache_search(op, rs); } -#endif /* LDAP_CACHING */ /* * controls are set in ldap_back_dobind() diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index e29fb64f41..0af3f42a57 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -406,7 +406,6 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_superiorUUID) }, -#ifdef LDAP_CACHING /* LDAP cache specific operational attribute */ { "queryid", "( 1.3.6.1.4.1.4203.666.1.12 NAME 'queryid' " "DESC 'list of queries the entry belongs to' " @@ -417,7 +416,6 @@ static struct slap_schema_ad_map { NULL, NULL, NULL, NULL, NULL, NULL, NULL, offsetof(struct slap_internal_schema, si_ad_queryid) }, -#endif /* LDAP_CACHING */ { "syncreplCookie", "( 1.3.6.1.4.1.4203.666.1.23 " "NAME 'syncreplCookie' " diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 948145c3d7..6c9e110b5f 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -37,7 +37,6 @@ #include "ldap_queue.h" #define SLAP_EXTENDED_SCHEMA 1 -#define LDAP_CACHING 1 LDAP_BEGIN_DECL /* @@ -735,10 +734,8 @@ struct slap_internal_schema { AttributeDescription *si_ad_namingCSN; AttributeDescription *si_ad_superiorUUID; -#ifdef LDAP_CACHING /* LDAP cache specific operational attribute */ AttributeDescription *si_ad_queryid; -#endif /* LDAP_CACHING */ AttributeDescription *si_ad_dseType; AttributeDescription *si_ad_syncreplCookie; -- 2.39.5