goto done;
}
- rc = bdb_dn2id_children( be, ltid, &e->e_nname );
+ rc = bdb_dn2id_children( be, ltid, &e->e_nname, 0 );
if( rc != DB_NOTFOUND ) {
switch( rc ) {
case DB_LOCK_DEADLOCK:
if( matched != NULL ) {
*matched = NULL;
- rc = bdb_dn2id_matched( be, tid, dn, &id, &id2 );
+ rc = bdb_dn2id_matched( be, tid, dn, &id, &id2, flags );
} else {
- rc = bdb_dn2id( be, tid, dn, &id );
+ rc = bdb_dn2id( be, tid, dn, &id, flags );
}
if( rc != 0 ) {
BackendDB *be,
DB_TXN *txn,
struct berval *dn,
- ID *id )
+ ID *id,
+ int flags )
{
int rc;
DBT key, data;
data.flags = DB_DBT_USERMEM;
/* fetch it */
- rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags );
+ rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags | flags);
if( rc != 0 ) {
#ifdef NEW_LOGGING
DB_TXN *txn,
struct berval *in,
ID *id,
- ID *id2 )
+ ID *id2,
+ int flags )
{
int rc;
DBT key, data;
break;
} else {
/* fetch it */
- rc = db->get(db, txn, &key, &data, bdb->bi_db_opflags );
+ rc = db->get(db, txn, &key, &data, bdb->bi_db_opflags | flags );
}
if( rc == DB_NOTFOUND ) {
bdb_dn2id_children(
BackendDB *be,
DB_TXN *txn,
- struct berval *dn )
+ struct berval *dn,
+ int flags )
{
int rc;
DBT key, data;
data.doff = 0;
data.dlen = sizeof(id);
- rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags );
+ rc = db->get( db, txn, &key, &data, bdb->bi_db_opflags | flags );
free( key.data );
#ifdef NEW_LOGGING
}
/* fetch it */
- rc = db->get( db, tid, &key, &data, bdb->bi_db_opflags );
+ rc = db->get( db, tid, &key, &data, bdb->bi_db_opflags | ( rw ? DB_RMW : 0 ));
if( rc != 0 ) {
return rc;
ber_bvarray_free( refs );
free( matched_dn );
- return rc;
+ goto done;
}
if ( !manageDSAit && is_entry_referral( e ) ) {
op->o_private = &opinfo;
/* get entry */
- rc = bdb_dn2entry_w( be, ltid, ndn, &e, &matched, 0, locker, &lock );
+ rc = bdb_dn2entry_w( be, ltid, ndn, &e, &matched, DB_RMW, locker, &lock );
switch( rc ) {
case 0:
new_ndn.bv_val, 0, 0 );
#endif
- rc = bdb_dn2id ( be, ltid, &new_ndn, &id );
+ rc = bdb_dn2id ( be, ltid, &new_ndn, &id, 0 );
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
opinfo.boi_err = 0;
op->o_private = &opinfo;
- rc = bdb_dn2id_children( be, ltid, &e->e_nname );
+ rc = bdb_dn2id_children( be, ltid, &e->e_nname, 0 );
switch( rc ) {
case DB_LOCK_DEADLOCK:
BackendDB *be,
DB_TXN *tid,
struct berval *dn,
- ID *id );
+ ID *id,
+ int flags );
int bdb_dn2id_matched(
BackendDB *be,
DB_TXN *tid,
struct berval *dn,
ID *id,
- ID *id2 );
+ ID *id2,
+ int flags );
int bdb_dn2id_add(
BackendDB *be,
int bdb_dn2id_children(
BackendDB *be,
DB_TXN *tid,
- struct berval *dn );
+ struct berval *dn,
+ int flags );
int
bdb_dn2idl(