github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/vfs/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools/go_generics:defs.bzl", "go_template_instance") 3 4 licenses(["notice"]) 5 6 go_template_instance( 7 name = "epoll_interest_list", 8 out = "epoll_interest_list.go", 9 package = "vfs", 10 prefix = "epollInterest", 11 template = "//pkg/ilist:generic_list", 12 types = { 13 "Element": "*epollInterest", 14 "Linker": "*epollInterest", 15 }, 16 ) 17 18 go_template_instance( 19 name = "event_list", 20 out = "event_list.go", 21 package = "vfs", 22 prefix = "event", 23 template = "//pkg/ilist:generic_list", 24 types = { 25 "Element": "*Event", 26 "Linker": "*Event", 27 }, 28 ) 29 30 go_template_instance( 31 name = "file_description_refs", 32 out = "file_description_refs.go", 33 package = "vfs", 34 prefix = "FileDescription", 35 template = "//pkg/refsvfs2:refs_template", 36 types = { 37 "T": "FileDescription", 38 }, 39 ) 40 41 go_template_instance( 42 name = "mount_namespace_refs", 43 out = "mount_namespace_refs.go", 44 package = "vfs", 45 prefix = "MountNamespace", 46 template = "//pkg/refsvfs2:refs_template", 47 types = { 48 "T": "MountNamespace", 49 }, 50 ) 51 52 go_template_instance( 53 name = "filesystem_refs", 54 out = "filesystem_refs.go", 55 package = "vfs", 56 prefix = "Filesystem", 57 template = "//pkg/refsvfs2:refs_template", 58 types = { 59 "T": "Filesystem", 60 }, 61 ) 62 63 go_library( 64 name = "vfs", 65 srcs = [ 66 "anonfs.go", 67 "context.go", 68 "debug.go", 69 "dentry.go", 70 "device.go", 71 "epoll.go", 72 "epoll_interest_list.go", 73 "event_list.go", 74 "file_description.go", 75 "file_description_impl_util.go", 76 "file_description_refs.go", 77 "filesystem.go", 78 "filesystem_impl_util.go", 79 "filesystem_refs.go", 80 "filesystem_type.go", 81 "inotify.go", 82 "lock.go", 83 "mount.go", 84 "mount_namespace_refs.go", 85 "mount_unsafe.go", 86 "opath.go", 87 "options.go", 88 "pathname.go", 89 "permissions.go", 90 "resolving_path.go", 91 "save_restore.go", 92 "vfs.go", 93 ], 94 visibility = ["//pkg/sentry:internal"], 95 deps = [ 96 "//pkg/abi/linux", 97 "//pkg/context", 98 "//pkg/errors/linuxerr", 99 "//pkg/fd", 100 "//pkg/fdnotifier", 101 "//pkg/fspath", 102 "//pkg/gohacks", 103 "//pkg/hostarch", 104 "//pkg/log", 105 "//pkg/refs", 106 "//pkg/refsvfs2", 107 "//pkg/safemem", 108 "//pkg/sentry/arch", 109 "//pkg/sentry/fs", 110 "//pkg/sentry/fs/lock", 111 "//pkg/sentry/fsmetric", 112 "//pkg/sentry/kernel/auth", 113 "//pkg/sentry/kernel/time", 114 "//pkg/sentry/limits", 115 "//pkg/sentry/memmap", 116 "//pkg/sentry/socket/unix/transport", 117 "//pkg/sentry/uniqueid", 118 "//pkg/sync", 119 "//pkg/syserror", 120 "//pkg/usermem", 121 "//pkg/waiter", 122 "@org_golang_x_sys//unix:go_default_library", 123 ], 124 ) 125 126 go_test( 127 name = "vfs_test", 128 size = "small", 129 srcs = [ 130 "file_description_impl_util_test.go", 131 "mount_test.go", 132 ], 133 library = ":vfs", 134 deps = [ 135 "//pkg/abi/linux", 136 "//pkg/context", 137 "//pkg/errors/linuxerr", 138 "//pkg/sentry/contexttest", 139 "//pkg/sync", 140 "//pkg/syserror", 141 "//pkg/usermem", 142 ], 143 )