summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/kernfs/BUILD
blob: 7bf83ccbad1a9814e50c6f80d3c630cf20d0e974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
load("//tools:defs.bzl", "go_library", "go_test")
load("//tools/go_generics:defs.bzl", "go_template_instance")

licenses(["notice"])

go_template_instance(
    name = "slot_list",
    out = "slot_list.go",
    package = "kernfs",
    prefix = "slot",
    template = "//pkg/ilist:generic_list",
    types = {
        "Element": "*slot",
        "Linker": "*slot",
    },
)

go_library(
    name = "kernfs",
    srcs = [
        "dynamic_bytes_file.go",
        "fd_impl_util.go",
        "filesystem.go",
        "inode_impl_util.go",
        "kernfs.go",
        "slot_list.go",
        "symlink.go",
    ],
    visibility = ["//pkg/sentry:internal"],
    deps = [
        "//pkg/abi/linux",
        "//pkg/fspath",
        "//pkg/log",
        "//pkg/refs",
        "//pkg/sentry/context",
        "//pkg/sentry/kernel/auth",
        "//pkg/sentry/memmap",
        "//pkg/sentry/usermem",
        "//pkg/sentry/vfs",
        "//pkg/sync",
        "//pkg/syserror",
    ],
)

go_test(
    name = "kernfs_test",
    size = "small",
    srcs = ["kernfs_test.go"],
    deps = [
        ":kernfs",
        "//pkg/abi/linux",
        "//pkg/sentry/context",
        "//pkg/sentry/context/contexttest",
        "//pkg/sentry/fsimpl/testutil",
        "//pkg/sentry/kernel/auth",
        "//pkg/sentry/usermem",
        "//pkg/sentry/vfs",
        "//pkg/syserror",
        "@com_github_google_go-cmp//cmp:go_default_library",
    ],
)