version 1.147.2.52, 2009/03/17 16:25:00
|
version 1.147.2.53, 2009/03/17 16:26:43
|
Line 1
|
Line 1
|
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.147.2.51 2009/03/13 19:52:28 quanah Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.147.2.52 2009/03/17 16:25:00 quanah Exp $ */ |
/* syncprov.c - syncrepl provider */ |
/* syncprov.c - syncrepl provider */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
Line 142 typedef struct syncprov_info_t {
|
Line 142 typedef struct syncprov_info_t {
|
typedef struct opcookie { |
typedef struct opcookie { |
slap_overinst *son; |
slap_overinst *son; |
syncmatches *smatches; |
syncmatches *smatches; |
|
modtarget *smt; |
struct berval sdn; /* DN of entry, for deletes */ |
struct berval sdn; /* DN of entry, for deletes */ |
struct berval sndn; |
struct berval sndn; |
struct berval suuid; /* UUID of entry */ |
struct berval suuid; /* UUID of entry */ |
Line 1313 syncprov_op_cleanup( Operation *op, Slap
|
Line 1314 syncprov_op_cleanup( Operation *op, Slap
|
} |
} |
|
|
/* Remove op from lock table */ |
/* Remove op from lock table */ |
mtdummy.mt_op = op; |
mt = opc->smt; |
ldap_pvt_thread_mutex_lock( &si->si_mods_mutex ); |
|
mt = avl_find( si->si_mods, &mtdummy, sp_avl_cmp ); |
|
if ( mt ) { |
if ( mt ) { |
modinst *mi = mt->mt_mods; |
modinst *mi = mt->mt_mods; |
|
|
/* If there are more, promote the next one */ |
/* If there are more, promote the next one */ |
ldap_pvt_thread_mutex_lock( &mt->mt_mutex ); |
|
if ( mi->mi_next ) { |
if ( mi->mi_next ) { |
|
ldap_pvt_thread_mutex_lock( &mt->mt_mutex ); |
mt->mt_mods = mi->mi_next; |
mt->mt_mods = mi->mi_next; |
mt->mt_op = mt->mt_mods->mi_op; |
mt->mt_op = mt->mt_mods->mi_op; |
ldap_pvt_thread_mutex_unlock( &mt->mt_mutex ); |
ldap_pvt_thread_mutex_unlock( &mt->mt_mutex ); |
} else { |
} else { |
|
ldap_pvt_thread_mutex_lock( &si->si_mods_mutex ); |
avl_delete( &si->si_mods, mt, sp_avl_cmp ); |
avl_delete( &si->si_mods, mt, sp_avl_cmp ); |
ldap_pvt_thread_mutex_unlock( &mt->mt_mutex ); |
ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex ); |
ldap_pvt_thread_mutex_destroy( &mt->mt_mutex ); |
ldap_pvt_thread_mutex_destroy( &mt->mt_mutex ); |
ch_free( mt ); |
ch_free( mt ); |
} |
} |
} |
} |
ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex ); |
|
if ( !BER_BVISNULL( &opc->suuid )) |
if ( !BER_BVISNULL( &opc->suuid )) |
op->o_tmpfree( opc->suuid.bv_val, op->o_tmpmemctx ); |
op->o_tmpfree( opc->suuid.bv_val, op->o_tmpmemctx ); |
if ( !BER_BVISNULL( &opc->sndn )) |
if ( !BER_BVISNULL( &opc->sndn )) |
Line 1974 syncprov_op_mod( Operation *op, SlapRepl
|
Line 1973 syncprov_op_mod( Operation *op, SlapRepl
|
avl_insert( &si->si_mods, mt, sp_avl_cmp, avl_dup_error ); |
avl_insert( &si->si_mods, mt, sp_avl_cmp, avl_dup_error ); |
ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex ); |
ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex ); |
} |
} |
|
opc->smt = mt; |
} |
} |
|
|
if (( have_psearches || si->si_logs ) && op->o_tag != LDAP_REQ_ADD ) |
if (( have_psearches || si->si_logs ) && op->o_tag != LDAP_REQ_ADD ) |