Skip to content
Snippets Groups Projects
Commit 03cbe604 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

ctl: remove useless RCU locking

Only control operations can change the shared items (conf, log, zonedb).
Zone contents, which is modifiable by events or zone control, must be generally
protected with a centralized access.
parent c73d4825
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@
#include <string.h>
#include <unistd.h>
#include <urcu.h>
#include "knot/common/log.h"
#include "knot/conf/confio.h"
......@@ -95,16 +94,12 @@ static int zones_apply(ctl_args_t *args, int (*fcn)(zone_t *, ctl_args_t *))
{
// Process all configured zones if none is specified.
if (args->data[KNOT_CTL_IDX_ZONE] == NULL) {
rcu_read_lock();
knot_zonedb_foreach(args->server->zone_db, fcn, args);
rcu_read_unlock();
return KNOT_EOK;
}
int ret = KNOT_EOK;
rcu_read_lock();
while (true) {
zone_t *zone;
ret = get_zone(args, &zone);
......@@ -125,8 +120,6 @@ static int zones_apply(ctl_args_t *args, int (*fcn)(zone_t *, ctl_args_t *))
ctl_log_data(&args->data);
}
rcu_read_unlock();
return ret;
}
......@@ -343,9 +336,7 @@ static int zone_txn_commit(zone_t *zone, ctl_args_t *args)
return KNOT_TXN_ENOTEXISTS;
}
rcu_read_unlock();
int ret = zone_update_commit(conf(), zone->control_update);
rcu_read_lock();
if (ret != KNOT_EOK) {
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment