Lines Matching refs:op
0 /* op.c - relay backend operations */
68 * Callbacks: Caller changed op->o_bd from Relay to underlying
79 relay_back_cleanup_cb( Operation *op, SlapReply *rs )
81 op->o_bd = ((relay_callback *) op->o_callback)->rcb_bd;
86 relay_back_response_cb( Operation *op, SlapReply *rs )
88 relay_callback *rcb = (relay_callback *) op->o_callback;
91 rcb->rcb_bd = op->o_bd;
92 op->o_bd = op->o_callback->sc_private;
96 #define relay_back_add_cb( rcb, op ) { \
97 (rcb)->rcb_sc.sc_next = (op)->o_callback; \
100 (rcb)->rcb_sc.sc_private = (op)->o_bd; \
101 (op)->o_callback = (slap_callback *) (rcb); \
104 #define relay_back_remove_cb( rcb, op ) { \
105 slap_callback **sc = &(op)->o_callback; \
117 relay_back_select_backend( Operation *op, SlapReply *rs, int which )
120 char *key = (char *) op->o_bd->be_private;
125 if ( bd == NULL && !BER_BVISNULL( &op->o_req_ndn ) ) {
127 bd = select_backend( &op->o_req_ndn, 1 );
131 key += which; /* <relay, op type> key from RELAY_WRAP_OP() */
132 LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
142 op->o_log_prefix, op->o_req_dn.bv_val, 0 );
149 default_referral, NULL, &op->o_req_dn,
150 op->o_tag == LDAP_REQ_SEARCH ?
151 op->ors_scope : LDAP_SCOPE_DEFAULT );
165 send_ldap_result( op, rs );
173 * Forward <act> on <op> to database <bd>, with <relay, op type>-specific
174 * key in op->o_extra so relay_back_select_backend() can catch recursion.
176 #define RELAY_WRAP_OP( op, bd, which, act ) { \
178 BackendDB *const wrap_bd = (op)->o_bd; \
181 LDAP_SLIST_INSERT_HEAD( &(op)->o_extra, &wrap_oex.oe, oe_next ); \
182 (op)->o_bd = (bd); \
184 (op)->o_bd = wrap_bd; \
185 LDAP_SLIST_REMOVE( &(op)->o_extra, &wrap_oex.oe, OpExtra, oe_next ); \
189 * Forward backend function #<which> on <op> to operation DN's database
194 relay_back_op( Operation *op, SlapReply *rs, int which )
201 bd = relay_back_select_backend( op, rs, which );
209 relay_back_add_cb( &rcb, op );
210 RELAY_WRAP_OP( op, bd, which, {
211 rc = func( op, rs );
213 relay_back_remove_cb( &rcb, op );
222 send_ldap_result( op, rs );
231 relay_back_op_bind( Operation *op, SlapReply *rs )
235 switch ( be_rootdn_bind( op, rs ) ) {
243 return relay_back_op( op, rs, op_bind );
247 int func( Operation *op, SlapReply *rs ) \
248 { return relay_back_op( op, rs, which ); }
265 relay_back_entry_release_rw( Operation *op, Entry *e, int rw )
270 bd = relay_back_select_backend( op, NULL, relay_op_entry_release );
272 RELAY_WRAP_OP( op, bd, relay_op_entry_release, {
273 rc = bd->be_release( op, e, rw );
284 relay_back_entry_get_rw( Operation *op, struct berval *ndn,
290 bd = relay_back_select_backend( op, NULL, relay_op_entry_get );
292 RELAY_WRAP_OP( op, bd, relay_op_entry_get, {
293 rc = bd->be_fetch( op, ndn, oc, at, rw, e );
312 relay_back_has_subordinates( Operation *op, Entry *e, int *hasSubs )
317 bd = relay_back_select_backend( op, NULL, relay_op_has_subordinates );
319 RELAY_WRAP_OP( op, bd, relay_op_has_subordinates, {
320 rc = bd->be_has_subordinates( op, e, hasSubs );