+#define bdb_dn2id_lock BDB_SYMBOL(dn2id_lock)
+
+static int
+bdb_dn2id_lock( struct bdb_info *bdb, struct berval *dn,
+ int rw, u_int32_t locker, DB_LOCK *lock )
+{
+ int rc;
+ DBT lockobj;
+ int db_rw;
+
+ if (rw)
+ db_rw = DB_LOCK_WRITE;
+ else
+ db_rw = DB_LOCK_READ;
+
+ lockobj.data = dn->bv_val;
+ lockobj.size = dn->bv_len;
+
+ rc = LOCK_GET(bdb->bi_dbenv, locker, DB_LOCK_NOWAIT,
+ &lockobj, db_rw, lock);
+ return rc;
+}
+