summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/host
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-08-01 19:56:12 -0700
committerShentubot <shentubot@google.com>2018-08-01 19:57:32 -0700
commit60add78980737a7330100d98bf6a214892dee3c0 (patch)
tree14433da4615d2010a5d34ade91ff94b938c5a9b5 /pkg/sentry/fs/host
parentb9e1cf8404ce1263176643dee1a1cc835c9d1448 (diff)
Automated rollback of changelist 207007153
PiperOrigin-RevId: 207037226 Change-Id: I8b5f1a056d4f3eab17846f2e0193bb737ecb5428
Diffstat (limited to 'pkg/sentry/fs/host')
-rw-r--r--pkg/sentry/fs/host/BUILD27
-rw-r--r--pkg/sentry/fs/host/descriptor.go2
-rw-r--r--pkg/sentry/fs/host/file.go2
-rw-r--r--pkg/sentry/fs/host/fs.go6
-rw-r--r--pkg/sentry/fs/host/inode.go4
5 files changed, 27 insertions, 14 deletions
diff --git a/pkg/sentry/fs/host/BUILD b/pkg/sentry/fs/host/BUILD
index 29c79284a..23ec66f50 100644
--- a/pkg/sentry/fs/host/BUILD
+++ b/pkg/sentry/fs/host/BUILD
@@ -1,6 +1,23 @@
package(licenses = ["notice"]) # Apache 2.0
-load("//tools/go_stateify:defs.bzl", "go_library", "go_test")
+load("//tools/go_stateify:defs.bzl", "go_library", "go_stateify", "go_test")
+
+go_stateify(
+ name = "host_state",
+ srcs = [
+ "control.go",
+ "descriptor.go",
+ "descriptor_state.go",
+ "file.go",
+ "fs.go",
+ "inode.go",
+ "inode_state.go",
+ "socket.go",
+ "socket_state.go",
+ ],
+ out = "host_state.go",
+ package = "host",
+)
go_library(
name = "host",
@@ -11,6 +28,7 @@ go_library(
"device.go",
"file.go",
"fs.go",
+ "host_state.go",
"inode.go",
"inode_state.go",
"ioctl_unsafe.go",
@@ -24,6 +42,7 @@ go_library(
visibility = ["//pkg/sentry:internal"],
deps = [
"//pkg/abi/linux",
+ "//pkg/amutex",
"//pkg/fd",
"//pkg/log",
"//pkg/refs",
@@ -33,14 +52,20 @@ go_library(
"//pkg/sentry/device",
"//pkg/sentry/fs",
"//pkg/sentry/fs/fsutil",
+ "//pkg/sentry/fs/lock",
"//pkg/sentry/kernel",
"//pkg/sentry/kernel/auth",
"//pkg/sentry/kernel/time",
"//pkg/sentry/memmap",
+ "//pkg/sentry/platform",
"//pkg/sentry/safemem",
+ "//pkg/sentry/socket",
"//pkg/sentry/socket/control",
"//pkg/sentry/socket/unix",
+ "//pkg/sentry/uniqueid",
+ "//pkg/sentry/usage",
"//pkg/sentry/usermem",
+ "//pkg/state",
"//pkg/syserror",
"//pkg/tcpip",
"//pkg/tcpip/link/rawfile",
diff --git a/pkg/sentry/fs/host/descriptor.go b/pkg/sentry/fs/host/descriptor.go
index 3aee4d11c..613bd06e8 100644
--- a/pkg/sentry/fs/host/descriptor.go
+++ b/pkg/sentry/fs/host/descriptor.go
@@ -25,8 +25,6 @@ import (
)
// descriptor wraps a host fd.
-//
-// +stateify savable
type descriptor struct {
// donated is true if the host fd was donated by another process.
donated bool
diff --git a/pkg/sentry/fs/host/file.go b/pkg/sentry/fs/host/file.go
index f9bef6d93..bdf844337 100644
--- a/pkg/sentry/fs/host/file.go
+++ b/pkg/sentry/fs/host/file.go
@@ -37,8 +37,6 @@ import (
)
// fileOperations implements fs.FileOperations for a host file descriptor.
-//
-// +stateify savable
type fileOperations struct {
fsutil.NoopRelease `state:"nosave"`
diff --git a/pkg/sentry/fs/host/fs.go b/pkg/sentry/fs/host/fs.go
index e46ae433c..974700636 100644
--- a/pkg/sentry/fs/host/fs.go
+++ b/pkg/sentry/fs/host/fs.go
@@ -51,8 +51,6 @@ const maxTraversals = 10
// to lock down the configurations. This filesystem should only be mounted at root.
//
// Think twice before exposing this to applications.
-//
-// +stateify savable
type Filesystem struct {
// whitelist is a set of host paths to whitelist.
paths []string
@@ -268,10 +266,8 @@ func newMountSource(ctx context.Context, root string, mounter fs.FileOwner, file
}
// superOperations implements fs.MountSourceOperations.
-//
-// +stateify savable
type superOperations struct {
- fs.SimpleMountSourceOperations
+ fs.SimpleMountSourceOperations `state:"nosave"`
// root is the path of the mount point. All inode mappings
// are relative to this root.
diff --git a/pkg/sentry/fs/host/inode.go b/pkg/sentry/fs/host/inode.go
index 761ccde33..226bc5164 100644
--- a/pkg/sentry/fs/host/inode.go
+++ b/pkg/sentry/fs/host/inode.go
@@ -34,8 +34,6 @@ import (
// inodeOperations implements fs.InodeOperations for an fs.Inodes backed
// by a host file descriptor.
-//
-// +stateify savable
type inodeOperations struct {
fsutil.InodeNotVirtual `state:"nosave"`
fsutil.InodeNoExtendedAttributes `state:"nosave"`
@@ -67,8 +65,6 @@ type inodeOperations struct {
// circular load dependency between it and inodeOperations). Even with
// lazy loading, this approach defines the dependencies between objects
// and the expected load behavior more concretely.
-//
-// +stateify savable
type inodeFileState struct {
// Common file system state.
mops *superOperations `state:"wait"`