summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-10-28 01:28:38 +0100
committerMichael Adam <obnox@samba.org>2009-11-03 01:02:36 +0100
commit0ec476fca1aa963489bc9292069e12ddb33ef7e3 (patch)
treeddfa0f22d09b207772600ccfe6f48abafd07e006 /source3/lib
parent4973ff66ac775d58c95cc6bd5665ed0d1e4a7718 (diff)
downloadsamba-0ec476fca1aa963489bc9292069e12ddb33ef7e3.tar.gz
samba-0ec476fca1aa963489bc9292069e12ddb33ef7e3.tar.bz2
samba-0ec476fca1aa963489bc9292069e12ddb33ef7e3.zip
s3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch()
Michael
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap_ctdb.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 145c0f65ea..e4399c6038 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -416,24 +416,14 @@ static int db_ctdb_transaction_fetch(struct db_ctdb_ctx *db,
TDB_DATA key, TDB_DATA *data)
{
struct db_ctdb_transaction_handle *h = db->transaction;
+ NTSTATUS status;
- *data = tdb_fetch(h->ctx->wtdb->tdb, key);
+ status = db_ctdb_ltdb_fetch(h->ctx, key, NULL, mem_ctx, data);
- if (data->dptr != NULL) {
- uint8_t *oldptr = (uint8_t *)data->dptr;
- data->dsize -= sizeof(struct ctdb_ltdb_header);
- if (data->dsize == 0) {
- data->dptr = NULL;
- } else {
- data->dptr = (uint8 *)
- talloc_memdup(
- mem_ctx, data->dptr+sizeof(struct ctdb_ltdb_header),
- data->dsize);
- }
- SAFE_FREE(oldptr);
- if (data->dptr == NULL && data->dsize != 0) {
- return -1;
- }
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+ *data = tdb_null;
+ } else if (!NT_STATUS_IS_OK(status)) {
+ return -1;
}
if (!h->in_replay) {