Import and structure cleanup.

PiperOrigin-RevId: 281795269
This commit is contained in:
Adin Scannell
2019-11-21 11:41:30 -08:00
committed by gVisor bot
parent b6a00aa375
commit c0f89eba6e
96 changed files with 175 additions and 123 deletions
+1
View File
@@ -25,6 +25,7 @@ go_library(
proto_library(
name = "eventchannel_proto",
srcs = ["event.proto"],
visibility = ["//:sandbox"],
)
go_proto_library(
+1 -1
View File
@@ -19,7 +19,7 @@ go_library(
"//pkg/abi/linux",
"//pkg/log",
"//pkg/memutil",
"//third_party/gvsync",
"//pkg/syncutil",
],
)
+5 -5
View File
@@ -18,7 +18,7 @@ import (
"reflect"
"unsafe"
"gvisor.dev/gvisor/third_party/gvsync"
"gvisor.dev/gvisor/pkg/syncutil"
)
// Packets consist of a 16-byte header followed by an arbitrarily-sized
@@ -75,13 +75,13 @@ func (ep *Endpoint) Data() []byte {
var ioSync int64
func raceBecomeActive() {
if gvsync.RaceEnabled {
gvsync.RaceAcquire((unsafe.Pointer)(&ioSync))
if syncutil.RaceEnabled {
syncutil.RaceAcquire((unsafe.Pointer)(&ioSync))
}
}
func raceBecomeInactive() {
if gvsync.RaceEnabled {
gvsync.RaceReleaseMerge((unsafe.Pointer)(&ioSync))
if syncutil.RaceEnabled {
syncutil.RaceReleaseMerge((unsafe.Pointer)(&ioSync))
}
}
+3
View File
@@ -10,5 +10,8 @@ package_group(
"//runsc/...",
# Code generated by go_marshal relies on go_marshal libraries.
"//tools/go_marshal/...",
# Keep the old paths as a temporary measure.
"//third_party/golang/gvisor/pkg/sentry/...",
],
)
+1 -1
View File
@@ -68,9 +68,9 @@ go_library(
"//pkg/sentry/usage",
"//pkg/sentry/usermem",
"//pkg/state",
"//pkg/syncutil",
"//pkg/syserror",
"//pkg/waiter",
"//third_party/gvsync",
],
)
+1
View File
@@ -25,6 +25,7 @@ import (
"time"
"github.com/google/uuid"
"gvisor.dev/gvisor/pkg/fd"
"gvisor.dev/gvisor/pkg/sentry/context"
"gvisor.dev/gvisor/pkg/sentry/context/contexttest"
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"gvisor.dev/gvisor/pkg/sentry/context"
"gvisor.dev/gvisor/pkg/sentry/memmap"
"gvisor.dev/gvisor/pkg/sentry/usermem"
"gvisor.dev/gvisor/pkg/syncutil"
"gvisor.dev/gvisor/pkg/syserror"
"gvisor.dev/gvisor/third_party/gvsync"
)
// The virtual filesystem implements an overlay configuration. For a high-level
@@ -199,7 +199,7 @@ type overlayEntry struct {
upper *Inode
// dirCacheMu protects dirCache.
dirCacheMu gvsync.DowngradableRWMutex `state:"nosave"`
dirCacheMu syncutil.DowngradableRWMutex `state:"nosave"`
// dirCache is cache of DentAttrs from upper and lower Inodes.
dirCache *SortedDentryMap
+1 -2
View File
@@ -1,10 +1,9 @@
load("//tools/go_stateify:defs.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("//tools/go_generics:defs.bzl", "go_template_instance")
package(licenses = ["notice"])
load("//tools/go_generics:defs.bzl", "go_template_instance")
go_template_instance(
name = "dentry_list",
out = "dentry_list.go",
+2 -2
View File
@@ -35,7 +35,7 @@ go_template_instance(
out = "seqatomic_taskgoroutineschedinfo_unsafe.go",
package = "kernel",
suffix = "TaskGoroutineSchedInfo",
template = "//third_party/gvsync:generic_seqatomic",
template = "//pkg/syncutil:generic_seqatomic",
types = {
"Value": "TaskGoroutineSchedInfo",
},
@@ -209,12 +209,12 @@ go_library(
"//pkg/sentry/usermem",
"//pkg/state",
"//pkg/state/statefile",
"//pkg/syncutil",
"//pkg/syserr",
"//pkg/syserror",
"//pkg/tcpip",
"//pkg/tcpip/stack",
"//pkg/waiter",
"//third_party/gvsync",
],
)
+1 -1
View File
@@ -8,7 +8,7 @@ go_template_instance(
out = "atomicptr_credentials_unsafe.go",
package = "auth",
suffix = "Credentials",
template = "//third_party/gvsync:generic_atomicptr",
template = "//pkg/syncutil:generic_atomicptr",
types = {
"Value": "Credentials",
},
+1 -1
View File
@@ -9,7 +9,7 @@ go_template_instance(
out = "atomicptr_bucket_unsafe.go",
package = "futex",
suffix = "Bucket",
template = "//third_party/gvsync:generic_atomicptr",
template = "//pkg/syncutil:generic_atomicptr",
types = {
"Value": "bucket",
},
+2 -2
View File
@@ -1,7 +1,7 @@
package(licenses = ["notice"])
load("//tools/go_stateify:defs.bzl", "go_library")
package(licenses = ["notice"])
go_library(
name = "signalfd",
srcs = ["signalfd.go"],
+2 -2
View File
@@ -35,8 +35,8 @@ import (
"gvisor.dev/gvisor/pkg/sentry/uniqueid"
"gvisor.dev/gvisor/pkg/sentry/usage"
"gvisor.dev/gvisor/pkg/sentry/usermem"
"gvisor.dev/gvisor/pkg/syncutil"
"gvisor.dev/gvisor/pkg/waiter"
"gvisor.dev/gvisor/third_party/gvsync"
)
// Task represents a thread of execution in the untrusted app. It
@@ -83,7 +83,7 @@ type Task struct {
//
// gosched is protected by goschedSeq. gosched is owned by the task
// goroutine.
goschedSeq gvsync.SeqCount `state:"nosave"`
goschedSeq syncutil.SeqCount `state:"nosave"`
gosched TaskGoroutineSchedInfo
// yieldCount is the number of times the task goroutine has called
+1 -1
View File
@@ -118,9 +118,9 @@ go_library(
"//pkg/sentry/safemem",
"//pkg/sentry/usage",
"//pkg/sentry/usermem",
"//pkg/syncutil",
"//pkg/syserror",
"//pkg/tcpip/buffer",
"//third_party/gvsync",
],
)
+3 -3
View File
@@ -44,7 +44,7 @@ import (
"gvisor.dev/gvisor/pkg/sentry/platform"
"gvisor.dev/gvisor/pkg/sentry/safemem"
"gvisor.dev/gvisor/pkg/sentry/usermem"
"gvisor.dev/gvisor/third_party/gvsync"
"gvisor.dev/gvisor/pkg/syncutil"
)
// MemoryManager implements a virtual address space.
@@ -82,7 +82,7 @@ type MemoryManager struct {
users int32
// mappingMu is analogous to Linux's struct mm_struct::mmap_sem.
mappingMu gvsync.DowngradableRWMutex `state:"nosave"`
mappingMu syncutil.DowngradableRWMutex `state:"nosave"`
// vmas stores virtual memory areas. Since vmas are stored by value,
// clients should usually use vmaIterator.ValuePtr() instead of
@@ -125,7 +125,7 @@ type MemoryManager struct {
// activeMu is loosely analogous to Linux's struct
// mm_struct::page_table_lock.
activeMu gvsync.DowngradableRWMutex `state:"nosave"`
activeMu syncutil.DowngradableRWMutex `state:"nosave"`
// pmas stores platform mapping areas used to implement vmas. Since pmas
// are stored by value, clients should usually use pmaIterator.ValuePtr()
+1 -2
View File
@@ -32,8 +32,7 @@ message Strace {
}
}
message StraceEnter {
}
message StraceEnter {}
message StraceExit {
// Return value formatted as string.
+2 -2
View File
@@ -9,7 +9,7 @@ go_template_instance(
out = "seqatomic_parameters_unsafe.go",
package = "time",
suffix = "Parameters",
template = "//third_party/gvsync:generic_seqatomic",
template = "//pkg/syncutil:generic_seqatomic",
types = {
"Value": "Parameters",
},
@@ -36,8 +36,8 @@ go_library(
deps = [
"//pkg/log",
"//pkg/metric",
"//pkg/syncutil",
"//pkg/syserror",
"//third_party/gvsync",
],
)
+1 -1
View File
@@ -33,9 +33,9 @@ go_library(
"//pkg/sentry/kernel/auth",
"//pkg/sentry/memmap",
"//pkg/sentry/usermem",
"//pkg/syncutil",
"//pkg/syserror",
"//pkg/waiter",
"//third_party/gvsync",
],
)
+2 -2
View File
@@ -26,7 +26,7 @@ import (
"sync/atomic"
"unsafe"
"gvisor.dev/gvisor/third_party/gvsync"
"gvisor.dev/gvisor/pkg/syncutil"
)
// mountKey represents the location at which a Mount is mounted. It is
@@ -72,7 +72,7 @@ type mountTable struct {
// intrinsics and inline assembly, limiting the performance of this
// approach.)
seq gvsync.SeqCount
seq syncutil.SeqCount
seed uint32 // for hashing keys
// size holds both length (number of elements) and capacity (number of
+28 -28
View File
@@ -18,8 +18,8 @@ package gvisor.state.statefile;
// Slice is a slice value.
message Slice {
uint32 length = 1;
uint32 capacity = 2;
uint32 length = 1;
uint32 capacity = 2;
uint64 ref_value = 3;
}
@@ -30,13 +30,13 @@ message Array {
// Map is a map value.
message Map {
repeated Object keys = 1;
repeated Object keys = 1;
repeated Object values = 2;
}
// Interface is an interface value.
message Interface {
string type = 1;
string type = 1;
Object value = 2;
}
@@ -47,7 +47,7 @@ message Struct {
// Field encodes a single field.
message Field {
string name = 1;
string name = 1;
Object value = 2;
}
@@ -113,28 +113,28 @@ message Float32s {
// Note that ref_value references an Object.id, below.
message Object {
oneof value {
bool bool_value = 1;
bytes string_value = 2;
int64 int64_value = 3;
uint64 uint64_value = 4;
double double_value = 5;
uint64 ref_value = 6;
Slice slice_value = 7;
Array array_value = 8;
Interface interface_value = 9;
Struct struct_value = 10;
Map map_value = 11;
bytes byte_array_value = 12;
Uint16s uint16_array_value = 13;
Uint32s uint32_array_value = 14;
Uint64s uint64_array_value = 15;
Uintptrs uintptr_array_value = 16;
Int8s int8_array_value = 17;
Int16s int16_array_value = 18;
Int32s int32_array_value = 19;
Int64s int64_array_value = 20;
Bools bool_array_value = 21;
Float64s float64_array_value = 22;
Float32s float32_array_value = 23;
bool bool_value = 1;
bytes string_value = 2;
int64 int64_value = 3;
uint64 uint64_value = 4;
double double_value = 5;
uint64 ref_value = 6;
Slice slice_value = 7;
Array array_value = 8;
Interface interface_value = 9;
Struct struct_value = 10;
Map map_value = 11;
bytes byte_array_value = 12;
Uint16s uint16_array_value = 13;
Uint32s uint32_array_value = 14;
Uint64s uint64_array_value = 15;
Uintptrs uintptr_array_value = 16;
Int8s int8_array_value = 17;
Int16s int16_array_value = 18;
Int32s int32_array_value = 19;
Int64s int64_array_value = 20;
Bools bool_array_value = 21;
Float64s float64_array_value = 22;
Float32s float32_array_value = 23;
}
}

Some files were not shown because too many files have changed in this diff Show More