summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_message.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-28 10:50:32 +0200
committerAndrew Tridgell <tridge@samba.org>2007-04-28 10:50:32 +0200
commit353a82f87c974456e4d41ba6ef42006d17008d02 (patch)
treeeeb3b2d20204f31575451ff07d152559e0c2fdf0 /ctdb/common/ctdb_message.c
parenta8de91b83f5b8f5b00016e565f9ebd190291f9a6 (diff)
downloadsamba-353a82f87c974456e4d41ba6ef42006d17008d02.tar.gz
samba-353a82f87c974456e4d41ba6ef42006d17008d02.tar.xz
samba-353a82f87c974456e4d41ba6ef42006d17008d02.zip
factor out the packet allocation code
(This used to be ctdb commit 4cbaf22cc4bede8c95dd9b87e21bbe886307e23b)
Diffstat (limited to 'ctdb/common/ctdb_message.c')
-rw-r--r--ctdb/common/ctdb_message.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ctdb/common/ctdb_message.c b/ctdb/common/ctdb_message.c
index 4f582598906..11d87b09e7e 100644
--- a/ctdb/common/ctdb_message.c
+++ b/ctdb/common/ctdb_message.c
@@ -120,18 +120,11 @@ int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t vnn,
}
len = offsetof(struct ctdb_req_message, data) + data.dsize;
- r = ctdb->methods->allocate_pkt(ctdb, len);
+ r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REQ_MESSAGE, len,
+ struct ctdb_req_message);
CTDB_NO_MEMORY(ctdb, r);
- talloc_set_name_const(r, "req_message packet");
- r->hdr.length = len;
- r->hdr.ctdb_magic = CTDB_MAGIC;
- r->hdr.ctdb_version = CTDB_VERSION;
- r->hdr.generation= ctdb->vnn_map->generation;
- r->hdr.operation = CTDB_REQ_MESSAGE;
r->hdr.destnode = vnn;
- r->hdr.srcnode = ctdb->vnn;
- r->hdr.reqid = 0;
r->srvid = srvid;
r->datalen = data.dsize;
memcpy(&r->data[0], data.dptr, data.dsize);