diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-02-10 12:14:36 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-02-10 14:34:44 +0100 |
| commit | 95871dcc45f6531b4c692ff892aad56bdd95e16f (patch) | |
| tree | 95c8ffe8b8a36b1dc9473cc3a07e7286595e0b2f /pkg/subsystem/entity | |
| parent | 0ee9f5fa4e372b5a2da4ac27418e6c5bccbcaf7a (diff) | |
pkg/subsystem: restructure the package
Remove the entity and match subpackages.
Regenerate the linux.go file.
Diffstat (limited to 'pkg/subsystem/entity')
| -rw-r--r-- | pkg/subsystem/entity/entities.go | 44 |
1 files changed, 0 insertions, 44 deletions
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 == "" -} |
