summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-11-07 16:25:31 +0100
committerMichael Adam <obnox@samba.org>2012-11-29 17:41:46 +0100
commitb206b5274878bbf47cd19db0fccc025a1ac16784 (patch)
tree772dcf4c63c08105c8da354afd3611f76132f7cd /source3/lib/dbwrap
parent24c36e748414d70ede930e8418455a2c11068d49 (diff)
downloadsamba-b206b5274878bbf47cd19db0fccc025a1ac16784.tar.gz
samba-b206b5274878bbf47cd19db0fccc025a1ac16784.tar.bz2
samba-b206b5274878bbf47cd19db0fccc025a1ac16784.zip
s3: Remove header==NULL code from db_ctdb_marshall_record
The only call chain (via db_ctdb_marshall_add) has header != NULL Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index e4c87ead4f..5be4bf7c6a 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -177,9 +177,6 @@ static NTSTATUS db_ctdb_ltdb_store(struct db_ctdb_ctx *db,
/*
form a ctdb_rec_data record from a key/data pair
-
- note that header may be NULL. If not NULL then it is included in the data portion
- of the record
*/
static struct ctdb_rec_data *db_ctdb_marshall_record(TALLOC_CTX *mem_ctx, uint32_t reqid,
TDB_DATA key,
@@ -190,7 +187,7 @@ static struct ctdb_rec_data *db_ctdb_marshall_record(TALLOC_CTX *mem_ctx, uint32
struct ctdb_rec_data *d;
length = offsetof(struct ctdb_rec_data, data) + key.dsize +
- data.dsize + (header?sizeof(*header):0);
+ data.dsize + sizeof(*header);
d = (struct ctdb_rec_data *)talloc_size(mem_ctx, length);
if (d == NULL) {
return NULL;
@@ -199,14 +196,10 @@ static struct ctdb_rec_data *db_ctdb_marshall_record(TALLOC_CTX *mem_ctx, uint32
d->reqid = reqid;
d->keylen = key.dsize;
memcpy(&d->data[0], key.dptr, key.dsize);
- if (header) {
- d->datalen = data.dsize + sizeof(*header);
- memcpy(&d->data[key.dsize], header, sizeof(*header));
- memcpy(&d->data[key.dsize+sizeof(*header)], data.dptr, data.dsize);
- } else {
- d->datalen = data.dsize;
- memcpy(&d->data[key.dsize], data.dptr, data.dsize);
- }
+
+ d->datalen = data.dsize + sizeof(*header);
+ memcpy(&d->data[key.dsize], header, sizeof(*header));
+ memcpy(&d->data[key.dsize+sizeof(*header)], data.dptr, data.dsize);
return d;
}