Commit 0f81f7ab authored by Daniel Salzman's avatar Daniel Salzman

apply: remove unused code

parent ecc84694
......@@ -387,80 +387,6 @@ int apply_prepare_to_sign(apply_ctx_t *ctx)
return zone_contents_adjust_pointers(ctx->contents);
}
int apply_changesets(apply_ctx_t *ctx, zone_contents_t *old_contents,
list_t *chsets, zone_contents_t **new_contents)
{
if (ctx == NULL || old_contents == NULL || chsets == NULL ||
EMPTY_LIST(*chsets) || new_contents == NULL) {
return KNOT_EINVAL;
}
zone_contents_t *contents_copy = NULL;
int ret = apply_prepare_zone_copy(old_contents, &contents_copy);
if (ret != KNOT_EOK) {
return ret;
}
ctx->contents = contents_copy;
changeset_t *set = NULL;
WALK_LIST(set, *chsets) {
ret = apply_single(ctx, set);
if (ret != KNOT_EOK) {
update_rollback(ctx);
update_free_zone(&ctx->contents);
return ret;
}
}
assert(contents_copy->apex != NULL);
ret = zone_contents_adjust_full(contents_copy);
if (ret != KNOT_EOK) {
update_rollback(ctx);
update_free_zone(&ctx->contents);
return ret;
}
*new_contents = contents_copy;
return KNOT_EOK;
}
int apply_changeset(apply_ctx_t *ctx, zone_contents_t *old_contents,
changeset_t *ch, zone_contents_t **new_contents)
{
if (ctx == NULL || old_contents == NULL || ch == NULL || new_contents == NULL) {
return KNOT_EINVAL;
}
zone_contents_t *contents_copy = NULL;
int ret = apply_prepare_zone_copy(old_contents, &contents_copy);
if (ret != KNOT_EOK) {
return ret;
}
ctx->contents = contents_copy;
ret = apply_single(ctx, ch);
if (ret != KNOT_EOK) {
update_rollback(ctx);
update_free_zone(&ctx->contents);
return ret;
}
ret = zone_contents_adjust_full(contents_copy);
if (ret != KNOT_EOK) {
update_rollback(ctx);
update_free_zone(&ctx->contents);
return ret;
}
*new_contents = contents_copy;
return KNOT_EOK;
}
int apply_changesets_directly(apply_ctx_t *ctx, list_t *chsets)
{
if (ctx == NULL || ctx->contents == NULL || chsets == NULL) {
......
......@@ -94,32 +94,6 @@ int apply_replace_soa(apply_ctx_t *ctx, const changeset_t *ch);
*/
int apply_prepare_to_sign(apply_ctx_t *ctx);
/*!
* \brief Applies changesets to a shallow zone-copy.
*
* \param ctx Apply context.
* \param old_contents Zone to be updated.
* \param chsets List of changesets to be applied.
* \param new_contents Storage for the new zone contents pointer.
*
* \return KNOT_E*
*/
int apply_changesets(apply_ctx_t *ctx, zone_contents_t *old_contents,
list_t *chsets, zone_contents_t **new_contents);
/*!
* \brief Applies changeset to a shallow zone-copy.
*
* \param ctx Apply context.
* \param old_contents Zone to be updated.
* \param ch Changeset to be applied.
* \param new_contents Storage for the new zone contents pointer.
*
* \return KNOT_E*
*/
int apply_changeset(apply_ctx_t *ctx, zone_contents_t *old_contents,
changeset_t *ch, zone_contents_t **new_contents);
/*!
* \brief Applies changesets directly to the zone, without copying it.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment