Lines Matching refs:num_layers
27 static struct landlock_ruleset *create_ruleset(const u32 num_layers) in create_ruleset() argument
32 kzalloc(struct_size(new_ruleset, fs_access_masks, num_layers), in create_ruleset()
39 new_ruleset->num_layers = num_layers; in create_ruleset()
65 .num_layers = ~0, in build_check_rule()
68 BUILD_BUG_ON(rule.num_layers < LANDLOCK_MAX_NUM_LAYERS); in build_check_rule()
73 const struct landlock_layer (*const layers)[], const u32 num_layers, in create_rule() argument
82 if (WARN_ON_ONCE(num_layers >= LANDLOCK_MAX_NUM_LAYERS)) in create_rule()
84 new_num_layers = num_layers + 1; in create_rule()
86 new_num_layers = num_layers; in create_rule()
95 new_rule->num_layers = new_num_layers; in create_rule()
98 flex_array_size(new_rule, layers, num_layers)); in create_rule()
101 new_rule->layers[new_rule->num_layers - 1] = *new_layer; in create_rule()
118 .num_layers = ~0, in build_check_ruleset()
123 BUILD_BUG_ON(ruleset.num_layers < LANDLOCK_MAX_NUM_LAYERS); in build_check_ruleset()
148 size_t num_layers) in insert_rule() argument
173 if (WARN_ON_ONCE(num_layers != 1)) in insert_rule()
182 if (WARN_ON_ONCE(this->num_layers != 1)) in insert_rule()
197 new_rule = create_rule(object, &this->layers, this->num_layers, in insert_rule()
210 new_rule = create_rule(object, layers, num_layers, NULL); in insert_rule()
280 if (WARN_ON_ONCE(src->num_layers != 1 || dst->num_layers < 1)) { in merge_ruleset()
284 dst->fs_access_masks[dst->num_layers - 1] = src->fs_access_masks[0]; in merge_ruleset()
290 .level = dst->num_layers, in merge_ruleset()
293 if (WARN_ON_ONCE(walker_rule->num_layers != 1)) { in merge_ruleset()
333 walker_rule->num_layers); in inherit_ruleset()
338 if (WARN_ON_ONCE(child->num_layers <= parent->num_layers)) { in inherit_ruleset()
344 flex_array_size(parent, fs_access_masks, parent->num_layers)); in inherit_ruleset()
407 u32 num_layers; in landlock_merge_ruleset() local
415 if (parent->num_layers >= LANDLOCK_MAX_NUM_LAYERS) in landlock_merge_ruleset()
417 num_layers = parent->num_layers + 1; in landlock_merge_ruleset()
419 num_layers = 1; in landlock_merge_ruleset()
423 new_dom = create_ruleset(num_layers); in landlock_merge_ruleset()