1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

ldb_tdb: Replace exists, name and error_map with key value ops

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2017-01-10 20:45:02 +13:00 committed by Andrew Bartlett
parent 9c8f00aaba
commit e33fb2c633
3 changed files with 10 additions and 10 deletions

View File

@ -3004,7 +3004,7 @@ int ltdb_reindex(struct ldb_module *module)
ldb_debug(ldb_module_get_ctx(module),
LDB_DEBUG_WARNING, "Reindexing: re_index successful on %s, "
"final index write-out will be in transaction commit",
tdb_name(ltdb->tdb));
ltdb->kv_ops->name(ltdb));
}
return LDB_SUCCESS;
}

View File

@ -256,7 +256,7 @@ int ltdb_search_key(struct ldb_module *module, struct ltdb_private *ltdb,
ltdb_parse_data_unpack, &ctx);
if (ret == -1) {
ret = ltdb_err_map(tdb_error(ltdb->tdb));
ret = ltdb->kv_ops->error(ltdb);
if (ret == LDB_SUCCESS) {
/*
* Just to be sure we don't turn errors

View File

@ -391,7 +391,7 @@ static int ltdb_modified(struct ldb_module *module, struct ldb_dn *dn)
if (ltdb->warn_reindex) {
ldb_debug(ldb_module_get_ctx(module),
LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s",
tdb_name(ltdb->tdb), ldb_dn_get_linearized(dn));
ltdb->kv_ops->name(ltdb), ldb_dn_get_linearized(dn));
}
ret = ltdb_reindex(module);
}
@ -459,10 +459,10 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg
tdb_data.dptr = ldb_data.data;
tdb_data.dsize = ldb_data.length;
ret = tdb_store(ltdb->tdb, tdb_key, tdb_data, flgs);
ret = ltdb->kv_ops->store(ltdb, tdb_key, tdb_data, flgs);
if (ret != 0) {
bool is_special = ldb_dn_is_special(msg->dn);
ret = ltdb_err_map(tdb_error(ltdb->tdb));
ret = ltdb->kv_ops->error(ltdb);
/*
* LDB_ERR_ENTRY_ALREADY_EXISTS means the DN, not
@ -677,11 +677,11 @@ int ltdb_delete_noindex(struct ldb_module *module,
return LDB_ERR_OTHER;
}
ret = tdb_delete(ltdb->tdb, tdb_key);
ret = ltdb->kv_ops->delete(ltdb, tdb_key);
TALLOC_FREE(tdb_key_ctx);
if (ret != 0) {
ret = ltdb_err_map(tdb_error(ltdb->tdb));
ret = ltdb->kv_ops->error(ltdb);
}
return ret;
@ -1412,7 +1412,7 @@ static int ltdb_start_trans(struct ldb_module *module)
}
if (tdb_transaction_start(ltdb->tdb) != 0) {
return ltdb_err_map(tdb_error(ltdb->tdb));
return ltdb->kv_ops->error(ltdb);
}
ltdb->in_transaction++;
@ -1473,7 +1473,7 @@ static int ltdb_end_trans(struct ldb_module *module)
ltdb->prepared_commit = false;
if (tdb_transaction_commit(ltdb->tdb) != 0) {
ret = ltdb_err_map(tdb_error(ltdb->tdb));
ret = ltdb->kv_ops->error(ltdb);
ldb_asprintf_errstring(ldb_module_get_ctx(module),
"Failure during tdb_transaction_commit(): %s -> %s",
tdb_errorstr(ltdb->tdb),
@ -1493,7 +1493,7 @@ static int ltdb_del_trans(struct ldb_module *module)
if (ltdb_index_transaction_cancel(module) != 0) {
tdb_transaction_cancel(ltdb->tdb);
return ltdb_err_map(tdb_error(ltdb->tdb));
return ltdb->kv_ops->error(ltdb);
}
tdb_transaction_cancel(ltdb->tdb);