int index;
int i;
- xa_lock(&hierarchy->shapers);
for (i = 0; i < nr_shapers; ++i) {
index = net_shaper_handle_to_index(&shapers[i].handle);
/* ... publish to lockless readers. */
smp_store_release(&cur->valid, true);
}
- xa_unlock(&hierarchy->shapers);
}
/* Rollback all the tentative inserts from the hierarchy. */
if (!hierarchy)
return;
- xa_lock(&hierarchy->shapers);
xa_for_each(&hierarchy->shapers, index, cur) {
if (cur->valid)
continue;
- __xa_erase(&hierarchy->shapers, index);
+ xa_erase(&hierarchy->shapers, index);
kfree_rcu(cur, rcu);
}
- xa_unlock(&hierarchy->shapers);
}
static int net_shaper_parse_handle(const struct nlattr *attr,
if (!hierarchy)
return;
- xa_lock(&hierarchy->shapers);
xa_for_each(&hierarchy->shapers, index, cur) {
- __xa_erase(&hierarchy->shapers, index);
+ xa_erase(&hierarchy->shapers, index);
kfree(cur);
}
- xa_unlock(&hierarchy->shapers);
kfree(hierarchy);
}