From 95871dcc45f6531b4c692ff892aad56bdd95e16f Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 10 Feb 2023 12:14:36 +0100 Subject: pkg/subsystem: restructure the package Remove the entity and match subpackages. Regenerate the linux.go file. --- pkg/subsystem/entity/entities.go | 44 ---------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 pkg/subsystem/entity/entities.go (limited to 'pkg/subsystem/entity') diff --git a/pkg/subsystem/entity/entities.go b/pkg/subsystem/entity/entities.go deleted file mode 100644 index e2b29a7f3..000000000 --- a/pkg/subsystem/entity/entities.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2023 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package entity - -type Subsystem struct { - Name string - PathRules []PathRule - Syscalls []string - Lists []string - Maintainers []string - Parents []*Subsystem -} - -// ReachableParents returns the set of subsystems reachable from the current one. -func (subsystem *Subsystem) ReachableParents() map[*Subsystem]struct{} { - ret := make(map[*Subsystem]struct{}) - var dfs func(node *Subsystem) - dfs = func(node *Subsystem) { - if _, visited := ret[node]; visited { - return - } - for _, p := range node.Parents { - if p == subsystem { - panic("loop in the parents relation") - } - ret[p] = struct{}{} - dfs(p) - } - } - dfs(subsystem) - return ret -} - -// PathRule describes the part of the directory tree belonging to a single subsystem. -type PathRule struct { - IncludeRegexp string - // ExcludeRegexps are tested before IncludeRegexp. - ExcludeRegexp string -} - -func (pr *PathRule) IsEmpty() bool { - return pr.IncludeRegexp == "" && pr.ExcludeRegexp == "" -} -- cgit mrf-deployment