/* Datalen, childlen, number of permissions */
hdr = (void *)data.dptr;
+ node->generation = hdr->generation;
node->num_perms = hdr->num_perms;
node->datalen = hdr->datalen;
node->childlen = hdr->childlen;
data.dptr = talloc_size(node, data.dsize);
hdr = (void *)data.dptr;
+ hdr->generation = node->generation;
hdr->num_perms = node->num_perms;
hdr->datalen = node->datalen;
hdr->childlen = node->childlen;
uint32_t id;
/* Generation when transaction started. */
- unsigned int generation;
+ uint64_t generation;
+
+ /* Transaction internal generation. */
+ uint64_t trans_gen;
/* TDB to work on, and filename */
TDB_CONTEXT *tdb;
};
extern int quota_max_transaction;
-static unsigned int generation;
+static uint64_t generation;
/* Return tdb context to use for this connection. */
TDB_CONTEXT *tdb_transaction_context(struct transaction *trans)
if (!conn || !conn->transaction) {
/* They're changing the global database. */
- generation++;
+ node->generation = generation++;
return;
}
trans = conn->transaction;
+ node->generation = generation + trans->trans_gen++;
+
list_for_each_entry(i, &trans->changes, list) {
if (streq(i->node, node->name)) {
if (recurse)
}
/* Attach transaction to input for autofree until it's complete */
- trans = talloc(in, struct transaction);
+ trans = talloc_zero(in, struct transaction);
INIT_LIST_HEAD(&trans->changes);
INIT_LIST_HEAD(&trans->changed_domains);
trans->generation = generation;
/* Fire off the watches for everything that changed. */
list_for_each_entry(i, &trans->changes, list)
fire_watches(conn, in, i->node, i->recurse);
- generation++;
+ generation += trans->trans_gen;
}
send_ack(conn, XS_TRANSACTION_END);
}