return 0;
}
-static void lxc_clear_devices(struct lxc_conf *conf)
+static inline void lxc_clear_cgroups_devices(struct lxc_conf *conf)
{
- struct lxc_list *list = &(conf->bpf_devices).device_item;
- struct lxc_list *it, *next;
-
- lxc_list_for_each_safe(it, list, next) {
- lxc_list_del(it);
- free(it);
- }
-
- lxc_list_init(&(conf->bpf_devices).device_item);
+ lxc_clear_cgroup2_devices(&conf->bpf_devices);
}
int lxc_clear_limits(struct lxc_conf *c, const char *key)
lxc_clear_config_keepcaps(conf);
lxc_clear_cgroups(conf, "lxc.cgroup", CGROUP_SUPER_MAGIC);
lxc_clear_cgroups(conf, "lxc.cgroup2", CGROUP2_SUPER_MAGIC);
- lxc_clear_devices(conf);
+ lxc_clear_cgroups_devices(conf);
lxc_clear_hooks(conf, "lxc.hook");
lxc_clear_mount_entries(conf);
lxc_clear_idmaps(conf);
}
}
+static inline void lxc_clear_cgroup2_devices(struct bpf_devices *bpf_devices)
+{
+ struct lxc_list *list = &bpf_devices->device_item;
+ struct lxc_list *it, *next;
+
+ lxc_list_for_each_safe (it, list, next) {
+ lxc_list_del(it);
+ free(it);
+ }
+
+ lxc_list_init(&bpf_devices->device_item);
+}
+
#endif /* __LXC_CONF_H */