diff options
author | Michael Adam <obnox@samba.org> | 2009-10-28 01:28:38 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-11-03 01:02:36 +0100 |
commit | 0ec476fca1aa963489bc9292069e12ddb33ef7e3 (patch) | |
tree | ddfa0f22d09b207772600ccfe6f48abafd07e006 /source3 | |
parent | 4973ff66ac775d58c95cc6bd5665ed0d1e4a7718 (diff) | |
download | samba-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')
-rw-r--r-- | source3/lib/dbwrap_ctdb.c | 22 |
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) { |