summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/dev
diff options
context:
space:
mode:
authorZhaozhong Ni <nzz@google.com>2018-08-02 10:41:44 -0700
committerShentubot <shentubot@google.com>2018-08-02 10:42:48 -0700
commit57d0fcbdbf7e9d2d573ce8d4ca2f72b82f778d63 (patch)
tree7d09abd7209c47ea68471588531bc06ff4f8655c /pkg/sentry/fs/dev
parentcf44aff6e08b0e19935d5cd98455b4af98fd8794 (diff)
Automated rollback of changelist 207037226
PiperOrigin-RevId: 207125440 Change-Id: I6c572afb4d693ee72a0c458a988b0e96d191cd49
Diffstat (limited to 'pkg/sentry/fs/dev')
-rw-r--r--pkg/sentry/fs/dev/BUILD20
-rw-r--r--pkg/sentry/fs/dev/dev.go2
-rw-r--r--pkg/sentry/fs/dev/fs.go2
-rw-r--r--pkg/sentry/fs/dev/full.go2
-rw-r--r--pkg/sentry/fs/dev/null.go3
-rw-r--r--pkg/sentry/fs/dev/random.go1
6 files changed, 11 insertions, 19 deletions
diff --git a/pkg/sentry/fs/dev/BUILD b/pkg/sentry/fs/dev/BUILD
index ea41615fd..fc069bb5f 100644
--- a/pkg/sentry/fs/dev/BUILD
+++ b/pkg/sentry/fs/dev/BUILD
@@ -1,25 +1,11 @@
package(licenses = ["notice"]) # Apache 2.0
-load("//tools/go_stateify:defs.bzl", "go_library", "go_stateify")
-
-go_stateify(
- name = "dev_state",
- srcs = [
- "dev.go",
- "fs.go",
- "full.go",
- "null.go",
- "random.go",
- ],
- out = "dev_state.go",
- package = "dev",
-)
+load("//tools/go_stateify:defs.bzl", "go_library")
go_library(
name = "dev",
srcs = [
"dev.go",
- "dev_state.go",
"device.go",
"fs.go",
"full.go",
@@ -30,8 +16,6 @@ go_library(
visibility = ["//pkg/sentry:internal"],
deps = [
"//pkg/abi/linux",
- "//pkg/amutex",
- "//pkg/log",
"//pkg/rand",
"//pkg/sentry/context",
"//pkg/sentry/device",
@@ -45,9 +29,7 @@ go_library(
"//pkg/sentry/mm",
"//pkg/sentry/platform",
"//pkg/sentry/safemem",
- "//pkg/sentry/usage",
"//pkg/sentry/usermem",
- "//pkg/state",
"//pkg/syserror",
],
)
diff --git a/pkg/sentry/fs/dev/dev.go b/pkg/sentry/fs/dev/dev.go
index 36c61bfc2..3f4f2a40a 100644
--- a/pkg/sentry/fs/dev/dev.go
+++ b/pkg/sentry/fs/dev/dev.go
@@ -27,6 +27,8 @@ import (
)
// Dev is the root node.
+//
+// +stateify savable
type Dev struct {
ramfs.Dir
}
diff --git a/pkg/sentry/fs/dev/fs.go b/pkg/sentry/fs/dev/fs.go
index 3c79f3782..2ae49be4e 100644
--- a/pkg/sentry/fs/dev/fs.go
+++ b/pkg/sentry/fs/dev/fs.go
@@ -29,6 +29,8 @@ const binderEnabledKey = "binder_enabled"
const ashmemEnabledKey = "ashmem_enabled"
// filesystem is a devtmpfs.
+//
+// +stateify savable
type filesystem struct{}
func init() {
diff --git a/pkg/sentry/fs/dev/full.go b/pkg/sentry/fs/dev/full.go
index e13eb6c03..492b8eb3a 100644
--- a/pkg/sentry/fs/dev/full.go
+++ b/pkg/sentry/fs/dev/full.go
@@ -26,6 +26,8 @@ import (
)
// fullDevice is used to implement /dev/full.
+//
+// +stateify savable
type fullDevice struct {
ramfs.Entry
}
diff --git a/pkg/sentry/fs/dev/null.go b/pkg/sentry/fs/dev/null.go
index 66b8ba967..2977c8670 100644
--- a/pkg/sentry/fs/dev/null.go
+++ b/pkg/sentry/fs/dev/null.go
@@ -29,6 +29,7 @@ import (
"gvisor.googlesource.com/gvisor/pkg/sentry/usermem"
)
+// +stateify savable
type nullDevice struct {
ramfs.Entry
}
@@ -54,6 +55,7 @@ func (n *nullDevice) Truncate(context.Context, *fs.Inode, int64) error {
return nil
}
+// +stateify savable
type zeroDevice struct {
nullDevice
}
@@ -80,6 +82,7 @@ func (zd *zeroDevice) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.F
}), nil
}
+// +stateify savable
type zeroFileOperations struct {
fs.FileOperations
}
diff --git a/pkg/sentry/fs/dev/random.go b/pkg/sentry/fs/dev/random.go
index 33a045a05..47b76218f 100644
--- a/pkg/sentry/fs/dev/random.go
+++ b/pkg/sentry/fs/dev/random.go
@@ -24,6 +24,7 @@ import (
"gvisor.googlesource.com/gvisor/pkg/sentry/usermem"
)
+// +stateify savable
type randomDevice struct {
ramfs.Entry
}