diff options
author | Michael Adam <obnox@samba.org> | 2009-10-28 01:50:15 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-11-03 01:02:36 +0100 |
commit | 8d61b8abbc64fc2114c133e93b8c63188ef60bb8 (patch) | |
tree | 905eaf99b44640cacf55beb98ff138b8634f281a /source3/lib | |
parent | 0ec476fca1aa963489bc9292069e12ddb33ef7e3 (diff) | |
download | samba-8d61b8abbc64fc2114c133e93b8c63188ef60bb8.tar.gz |
s3:dbwrap_ctdb: use db_ctdb_ltdb_fetch() inside db_ctdb_transaction_fetch_start
Michael
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap_ctdb.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c index e4399c60381..fce6126a5c0 100644 --- a/source3/lib/dbwrap_ctdb.c +++ b/source3/lib/dbwrap_ctdb.c @@ -322,6 +322,8 @@ static int db_ctdb_transaction_fetch_start(struct db_ctdb_transaction_handle *h) int ret; struct db_ctdb_ctx *ctx = h->ctx; TDB_DATA data; + NTSTATUS status; + struct ctdb_ltdb_header header; key.dptr = (uint8_t *)discard_const(keyname); key.dsize = strlen(keyname); @@ -344,17 +346,13 @@ again: return -1; } - data = tdb_fetch(ctx->wtdb->tdb, key); - if ((data.dptr == NULL) || - (data.dsize < sizeof(struct ctdb_ltdb_header)) || - ((struct ctdb_ltdb_header *)data.dptr)->dmaster != get_my_vnn()) { - SAFE_FREE(data.dptr); + status = db_ctdb_ltdb_fetch(ctx, key, &header, tmp_ctx, &data); + if (!NT_STATUS_IS_OK(status) || header.dmaster != get_my_vnn()) { tdb_transaction_cancel(ctx->wtdb->tdb); talloc_free(tmp_ctx); goto again; } - SAFE_FREE(data.dptr); talloc_free(tmp_ctx); return 0; |