From 30f401c62898426664d71518e4d176293f64ebc7 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 7 Jan 2008 21:35:03 +0000 Subject: [PATCH] rename ldap_pvt_thread_pool_setkey_x() to ldap_pvt_thread_pool_setkey() (as part of ITS#5309) --- contrib/slapd-modules/smbk5pwd/smbk5pwd.c | 6 +++--- include/ldap_pvt_thread.h | 5 +---- libraries/libldap_r/ldap_thr_debug.h | 4 ++-- libraries/libldap_r/thr_debug.c | 8 ++++---- libraries/libldap_r/thr_stub.c | 2 +- libraries/libldap_r/tpool.c | 2 +- servers/slapd/back-bdb/cache.c | 4 ++-- servers/slapd/back-bdb/search.c | 2 +- servers/slapd/back-meta/conn.c | 3 ++- servers/slapd/back-sql/sql-wrap.c | 2 +- servers/slapd/backend.c | 4 ++-- servers/slapd/connection.c | 6 +++--- servers/slapd/operation.c | 8 ++++---- servers/slapd/overlays/memberof.c | 4 ++-- servers/slapd/passwd.c | 4 ++-- servers/slapd/sl_malloc.c | 6 +++--- 16 files changed, 34 insertions(+), 36 deletions(-) diff --git a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c index 78bc1daec6..85a6260d57 100644 --- a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c +++ b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c @@ -215,7 +215,7 @@ static int smbk5pwd_op_cleanup( /* clear out the current key */ ldap_pvt_thread_pool_setkey( op->o_threadctx, smbk5pwd_op_cleanup, - NULL, NULL ); + NULL, NULL, NULL, NULL ); /* free the callback */ cb = op->o_callback; @@ -234,8 +234,8 @@ static int smbk5pwd_op_bind( */ if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE ) { slap_callback *cb; - ldap_pvt_thread_pool_setkey( op->o_threadctx, smbk5pwd_op_cleanup, op, - NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, + smbk5pwd_op_cleanup, op, NULL, NULL, NULL ); cb = op->o_tmpcalloc( 1, sizeof(slap_callback), op->o_tmpmemctx ); cb->sc_cleanup = smbk5pwd_op_cleanup; cb->sc_next = op->o_callback; diff --git a/include/ldap_pvt_thread.h b/include/ldap_pvt_thread.h index e8a8b08dbf..9036abe0aa 100644 --- a/include/ldap_pvt_thread.h +++ b/include/ldap_pvt_thread.h @@ -268,7 +268,7 @@ ldap_pvt_thread_pool_getkey LDAP_P(( ldap_pvt_thread_pool_keyfree_t **kfree )); LDAP_F( int ) -ldap_pvt_thread_pool_setkey_x LDAP_P(( +ldap_pvt_thread_pool_setkey LDAP_P(( void *ctx, void *key, void *data, @@ -276,9 +276,6 @@ ldap_pvt_thread_pool_setkey_x LDAP_P(( void **olddatap, ldap_pvt_thread_pool_keyfree_t **oldkfreep )); -#define ldap_pvt_thread_pool_setkey( ctx, key, data, kfree ) \ - ldap_pvt_thread_pool_setkey_x( (ctx), (key), (data), (kfree), NULL, NULL ) - LDAP_F( void ) ldap_pvt_thread_pool_purgekey LDAP_P(( void *key )); diff --git a/libraries/libldap_r/ldap_thr_debug.h b/libraries/libldap_r/ldap_thr_debug.h index a85ef67e5b..b43d32ee6c 100644 --- a/libraries/libldap_r/ldap_thr_debug.h +++ b/libraries/libldap_r/ldap_thr_debug.h @@ -119,7 +119,7 @@ #define ldap_pvt_thread_pool_resume ldap_int_thread_pool_resume #define ldap_pvt_thread_pool_destroy ldap_int_thread_pool_destroy #define ldap_pvt_thread_pool_getkey ldap_int_thread_pool_getkey -#define ldap_pvt_thread_pool_setkey_x ldap_int_thread_pool_setkey_x +#define ldap_pvt_thread_pool_setkey ldap_int_thread_pool_setkey #define ldap_pvt_thread_pool_purgekey ldap_int_thread_pool_purgekey #define ldap_pvt_thread_pool_context ldap_int_thread_pool_context #define ldap_pvt_thread_pool_context_reset ldap_int_thread_pool_context_reset @@ -182,7 +182,7 @@ #undef ldap_pvt_thread_pool_resume #undef ldap_pvt_thread_pool_destroy #undef ldap_pvt_thread_pool_getkey -#undef ldap_pvt_thread_pool_setkey_x +#undef ldap_pvt_thread_pool_setkey #undef ldap_pvt_thread_pool_purgekey #undef ldap_pvt_thread_pool_context #undef ldap_pvt_thread_pool_context_reset diff --git a/libraries/libldap_r/thr_debug.c b/libraries/libldap_r/thr_debug.c index 36894314d8..8ff9fbb3ae 100644 --- a/libraries/libldap_r/thr_debug.c +++ b/libraries/libldap_r/thr_debug.c @@ -1242,7 +1242,7 @@ ldap_pvt_thread_pool_getkey( } int -ldap_pvt_thread_pool_setkey_x( +ldap_pvt_thread_pool_setkey( void *xctx, void *key, void *data, @@ -1251,10 +1251,10 @@ ldap_pvt_thread_pool_setkey_x( ldap_pvt_thread_pool_keyfree_t **oldkfreep ) { int rc; - ERROR_IF( !threading_enabled, "ldap_pvt_thread_pool_setkey_x" ); - rc = ldap_int_thread_pool_setkey_x( + ERROR_IF( !threading_enabled, "ldap_pvt_thread_pool_setkey" ); + rc = ldap_int_thread_pool_setkey( xctx, key, data, kfree, olddatap, oldkfreep ); - ERROR_IF( rc, "ldap_pvt_thread_pool_setkey_x" ); + ERROR_IF( rc, "ldap_pvt_thread_pool_setkey" ); return rc; } diff --git a/libraries/libldap_r/thr_stub.c b/libraries/libldap_r/thr_stub.c index d8f06bee2a..ad4eea3f57 100644 --- a/libraries/libldap_r/thr_stub.c +++ b/libraries/libldap_r/thr_stub.c @@ -200,7 +200,7 @@ int ldap_pvt_thread_pool_getkey ( return(0); } -int ldap_pvt_thread_pool_setkey_x ( +int ldap_pvt_thread_pool_setkey ( void *ctx, void *key, void *data, ldap_pvt_thread_pool_keyfree_t *kfree, void **olddatap, ldap_pvt_thread_pool_keyfree_t **oldkfreep ) diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index 3b7abee8a7..842f1b260e 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -756,7 +756,7 @@ clear_key_idx( ldap_int_thread_userctx_t *ctx, int i ) * responsibility to free any existing data with the same key. * kfree() must not call functions taking a tpool argument. */ -int ldap_pvt_thread_pool_setkey_x( +int ldap_pvt_thread_pool_setkey( void *xctx, void *key, void *data, diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index d666364e1d..9fad593d9f 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1449,7 +1449,7 @@ bdb_locker_flush( DB_ENV *env ) void *ctx = ldap_pvt_thread_pool_context(); if ( !ldap_pvt_thread_pool_getkey( ctx, env, &data, NULL ) ) { - ldap_pvt_thread_pool_setkey( ctx, env, NULL, NULL ); + ldap_pvt_thread_pool_setkey( ctx, env, NULL, NULL, NULL, NULL ); bdb_locker_id_free( env, data ); } } @@ -1494,7 +1494,7 @@ bdb_locker_id( Operation *op, DB_ENV *env, BDB_LOCKER *locker ) data = (void *)((long)lockid); #endif if ( ( rc = ldap_pvt_thread_pool_setkey( ctx, env, - data, bdb_locker_id_free ) ) ) { + data, bdb_locker_id_free, NULL, NULL ) ) ) { XLOCK_ID_FREE( env, lockid ); Debug( LDAP_DEBUG_ANY, "bdb_locker_id: err %s(%d)\n", db_strerror(rc), rc, 0 ); diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index d2222d87c9..77ffb61aff 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -1009,7 +1009,7 @@ static void *search_stack( Operation *op ) * sizeof( ID ) ); if ( op->o_threadctx ) { ldap_pvt_thread_pool_setkey( op->o_threadctx, search_stack, - ret, search_stack_free ); + ret, search_stack_free, NULL, NULL ); } else { bdb->bi_search_stack = ret; } diff --git a/servers/slapd/back-meta/conn.c b/servers/slapd/back-meta/conn.c index eba59e52bd..fbc4ee1708 100644 --- a/servers/slapd/back-meta/conn.c +++ b/servers/slapd/back-meta/conn.c @@ -948,7 +948,8 @@ meta_back_candidates_get( Operation *op ) data = (void *)mc; ldap_pvt_thread_pool_setkey( op->o_threadctx, &meta_back_candidates_dummy, data, - meta_back_candidates_keyfree ); + meta_back_candidates_keyfree, + NULL, NULL ); } else { mi->mi_candidates = mc; diff --git a/servers/slapd/back-sql/sql-wrap.c b/servers/slapd/back-sql/sql-wrap.c index 5e40dc2a7b..053dd17839 100644 --- a/servers/slapd/back-sql/sql-wrap.c +++ b/servers/slapd/back-sql/sql-wrap.c @@ -519,7 +519,7 @@ backsql_get_db_conn( Operation *op, SQLHDBC *dbhp ) data = (void *)dbh; ldap_pvt_thread_pool_setkey( op->o_threadctx, &backsql_db_conn_dummy, data, - backsql_db_conn_keyfree ); + backsql_db_conn_keyfree, NULL, NULL ); } else { bi->sql_dbh = dbh; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index e29d2ba8b8..4325b568af 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -822,7 +822,7 @@ be_rootdn_bind( Operation *op, SlapReply *rs ) } #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey_x( op->o_threadctx, slap_sasl_bind, + ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); #endif @@ -830,7 +830,7 @@ be_rootdn_bind( Operation *op, SlapReply *rs ) #ifdef SLAPD_SPASSWD ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - old_authctx, NULL ); + old_authctx, NULL, NULL, NULL ); #endif rc = ( rc == 0 ? LDAP_SUCCESS : LDAP_INVALID_CREDENTIALS ); diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 957662fde7..33b565c95e 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -976,7 +976,7 @@ conn_counter_init( Operation *op, void *ctx ) sc = vsc; slap_counters_init( sc ); ldap_pvt_thread_pool_setkey( ctx, conn_counter_init, vsc, - conn_counter_destroy ); + conn_counter_destroy, NULL, NULL ); ldap_pvt_thread_mutex_lock( &slap_counters.sc_mutex ); sc->sc_next = slap_counters.sc_next; @@ -1953,8 +1953,8 @@ connection_fake_init2( slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op ); eb->eb_conn = conn->c_extensions; eb->eb_op = op->o_hdr->oh_extensions; - ldap_pvt_thread_pool_setkey( ctx, connection_fake_init, eb, - connection_fake_destroy ); + ldap_pvt_thread_pool_setkey( ctx, connection_fake_init, + eb, connection_fake_destroy, NULL, NULL ); } else { eb = ebx; conn->c_extensions = eb->eb_conn; diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index 124a3b85b9..96eeab4bf4 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -122,8 +122,8 @@ slap_op_free( Operation *op, void *ctx ) ldap_pvt_thread_pool_getkey( ctx, (void *)slap_op_free, &otmp, NULL ); op2 = otmp; LDAP_STAILQ_NEXT( op, o_next ) = op2; - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, (void *)op, - slap_op_q_destroy ); + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, + (void *)op, slap_op_q_destroy, NULL, NULL ); } else { ber_memfree_x( op, NULL ); } @@ -160,8 +160,8 @@ slap_op_alloc( if ( otmp ) { op = otmp; otmp = LDAP_STAILQ_NEXT( op, o_next ); - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, otmp, - slap_op_q_destroy ); + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, + otmp, slap_op_q_destroy, NULL, NULL ); } } if (!op) { diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c index 064024b1be..8915661ef6 100644 --- a/servers/slapd/overlays/memberof.c +++ b/servers/slapd/overlays/memberof.c @@ -204,7 +204,7 @@ memberof_saved_member_get( Operation *op, void *keyp ) *key = NULL; } else { - ldap_pvt_thread_pool_setkey_x( op->o_threadctx, + ldap_pvt_thread_pool_setkey( op->o_threadctx, key, NULL, NULL, &vals, NULL ); } @@ -232,7 +232,7 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals ) } else { void *old_vals = NULL; - ldap_pvt_thread_pool_setkey_x( op->o_threadctx, key, + ldap_pvt_thread_pool_setkey( op->o_threadctx, key, saved_vals, memberof_saved_member_free, &old_vals, NULL ); if ( old_vals != NULL ) { ber_bvarray_free( old_vals ); diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index a722ef9d7c..8d2b657ea5 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -507,7 +507,7 @@ slap_passwd_check( #ifdef SLAPD_SPASSWD void *old_authctx = NULL; - ldap_pvt_thread_pool_setkey_x( op->o_threadctx, slap_sasl_bind, + ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); #endif @@ -527,7 +527,7 @@ slap_passwd_check( #ifdef SLAPD_SPASSWD ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - old_authctx, NULL ); + old_authctx, NULL, NULL, NULL ); #endif return result; diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 4feab16e2b..0adb1133df 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -129,7 +129,7 @@ slap_sl_mem_create( slheap = sh; #else ldap_pvt_thread_pool_setkey(ctx, (void *)slap_sl_mem_init, - (void *)sh, slap_sl_mem_destroy); + (void *)sh, slap_sl_mem_destroy, NULL, NULL); #endif } else if ( size > (char *)sh->sh_end - (char *)sh->sh_base ) { void *newptr; @@ -162,7 +162,7 @@ slap_sl_mem_create( slheap = sh; #else ldap_pvt_thread_pool_setkey(ctx, (void *)slap_sl_mem_init, - (void *)sh, slap_sl_mem_destroy); + (void *)sh, slap_sl_mem_destroy, NULL, NULL); #endif } else { for (i = 0; i <= sh->sh_maxorder - order_start; i++) { @@ -246,7 +246,7 @@ slap_sl_mem_detach( slheap = NULL; #else /* separate from context */ - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_sl_mem_init, NULL, NULL ); + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_sl_mem_init, NULL, NULL, NULL, NULL ); #endif } -- 2.39.5