gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/fsimpl/overlay/BUILD (about)

     1  load("//pkg/sync/locking:locking.bzl", "declare_mutex", "declare_rwmutex")
     2  load("//tools:defs.bzl", "go_library")
     3  load("//tools/go_generics:defs.bzl", "go_template_instance")
     4  
     5  package(default_applicable_licenses = ["//:license"])
     6  
     7  licenses(["notice"])
     8  
     9  declare_mutex(
    10      name = "dir_mutex",
    11      out = "dir_mutex.go",
    12      nested_lock_names = [
    13          "new",
    14          "replaced",
    15          "child",
    16      ],
    17      package = "overlay",
    18      prefix = "dir",
    19  )
    20  
    21  declare_mutex(
    22      name = "dev_mutex",
    23      out = "dev_mutex.go",
    24      package = "overlay",
    25      prefix = "dev",
    26  )
    27  
    28  declare_mutex(
    29      name = "dir_cache_mutex",
    30      out = "dir_cache_mutex.go",
    31      package = "overlay",
    32      prefix = "dirInoCache",
    33  )
    34  
    35  declare_mutex(
    36      name = "reg_file_fd_mutex",
    37      out = "req_file_fd_mutex.go",
    38      package = "overlay",
    39      prefix = "regularFileFD",
    40  )
    41  
    42  declare_mutex(
    43      name = "dir_fd_mutex",
    44      out = "dir_fd_mutex.go",
    45      package = "overlay",
    46      prefix = "directoryFD",
    47  )
    48  
    49  declare_rwmutex(
    50      name = "rename_rwmutex",
    51      out = "rename_rwmutex.go",
    52      package = "overlay",
    53      prefix = "rename",
    54  )
    55  
    56  declare_rwmutex(
    57      name = "data_rwmutex",
    58      out = "data_rwmutex.go",
    59      package = "overlay",
    60      prefix = "data",
    61  )
    62  
    63  declare_mutex(
    64      name = "maps_mutex",
    65      out = "maps_mutex.go",
    66      package = "overlay",
    67      prefix = "maps",
    68  )
    69  
    70  go_template_instance(
    71      name = "fstree",
    72      out = "fstree.go",
    73      package = "overlay",
    74      prefix = "generic",
    75      template = "//pkg/sentry/vfs/genericfstree:generic_fstree",
    76      types = {
    77          "Dentry": "dentry",
    78      },
    79  )
    80  
    81  go_library(
    82      name = "overlay",
    83      srcs = [
    84          "copy_up.go",
    85          "data_rwmutex.go",
    86          "dev_mutex.go",
    87          "dir_cache_mutex",
    88          "dir_fd_mutex.go",
    89          "dir_mutex.go",
    90          "directory.go",
    91          "filesystem.go",
    92          "fstree.go",
    93          "maps_mutex.go",
    94          "overlay.go",
    95          "regular_file.go",
    96          "rename_rwmutex.go",
    97          "req_file_fd_mutex.go",
    98          "save_restore.go",
    99      ],
   100      visibility = ["//pkg/sentry:internal"],
   101      deps = [
   102          "//pkg/abi/linux",
   103          "//pkg/atomicbitops",
   104          "//pkg/context",
   105          "//pkg/errors/linuxerr",
   106          "//pkg/fspath",
   107          "//pkg/hostarch",
   108          "//pkg/log",
   109          "//pkg/refs",
   110          "//pkg/sentry/arch",
   111          "//pkg/sentry/fsimpl/lock",
   112          "//pkg/sentry/kernel/auth",
   113          "//pkg/sentry/memmap",
   114          "//pkg/sentry/socket/unix/transport",
   115          "//pkg/sentry/vfs",
   116          "//pkg/sync",
   117          "//pkg/sync/locking",
   118          "//pkg/usermem",
   119          "//pkg/waiter",
   120      ],
   121  )