summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsbridge
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fsbridge')
-rw-r--r--pkg/sentry/fsbridge/BUILD24
-rw-r--r--pkg/sentry/fsbridge/fsbridge_state_autogen.go126
2 files changed, 126 insertions, 24 deletions
diff --git a/pkg/sentry/fsbridge/BUILD b/pkg/sentry/fsbridge/BUILD
deleted file mode 100644
index 4631db2bb..000000000
--- a/pkg/sentry/fsbridge/BUILD
+++ /dev/null
@@ -1,24 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-licenses(["notice"])
-
-go_library(
- name = "fsbridge",
- srcs = [
- "bridge.go",
- "fs.go",
- "vfs.go",
- ],
- visibility = ["//pkg/sentry:internal"],
- deps = [
- "//pkg/abi/linux",
- "//pkg/context",
- "//pkg/errors/linuxerr",
- "//pkg/fspath",
- "//pkg/sentry/fs",
- "//pkg/sentry/kernel/auth",
- "//pkg/sentry/memmap",
- "//pkg/sentry/vfs",
- "//pkg/usermem",
- ],
-)
diff --git a/pkg/sentry/fsbridge/fsbridge_state_autogen.go b/pkg/sentry/fsbridge/fsbridge_state_autogen.go
new file mode 100644
index 000000000..b4b240bfa
--- /dev/null
+++ b/pkg/sentry/fsbridge/fsbridge_state_autogen.go
@@ -0,0 +1,126 @@
+// automatically generated by stateify.
+
+package fsbridge
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (f *fsFile) StateTypeName() string {
+ return "pkg/sentry/fsbridge.fsFile"
+}
+
+func (f *fsFile) StateFields() []string {
+ return []string{
+ "file",
+ }
+}
+
+func (f *fsFile) beforeSave() {}
+
+// +checklocksignore
+func (f *fsFile) StateSave(stateSinkObject state.Sink) {
+ f.beforeSave()
+ stateSinkObject.Save(0, &f.file)
+}
+
+func (f *fsFile) afterLoad() {}
+
+// +checklocksignore
+func (f *fsFile) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &f.file)
+}
+
+func (l *fsLookup) StateTypeName() string {
+ return "pkg/sentry/fsbridge.fsLookup"
+}
+
+func (l *fsLookup) StateFields() []string {
+ return []string{
+ "mntns",
+ "root",
+ "workingDir",
+ }
+}
+
+func (l *fsLookup) beforeSave() {}
+
+// +checklocksignore
+func (l *fsLookup) StateSave(stateSinkObject state.Sink) {
+ l.beforeSave()
+ stateSinkObject.Save(0, &l.mntns)
+ stateSinkObject.Save(1, &l.root)
+ stateSinkObject.Save(2, &l.workingDir)
+}
+
+func (l *fsLookup) afterLoad() {}
+
+// +checklocksignore
+func (l *fsLookup) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &l.mntns)
+ stateSourceObject.Load(1, &l.root)
+ stateSourceObject.Load(2, &l.workingDir)
+}
+
+func (f *VFSFile) StateTypeName() string {
+ return "pkg/sentry/fsbridge.VFSFile"
+}
+
+func (f *VFSFile) StateFields() []string {
+ return []string{
+ "file",
+ }
+}
+
+func (f *VFSFile) beforeSave() {}
+
+// +checklocksignore
+func (f *VFSFile) StateSave(stateSinkObject state.Sink) {
+ f.beforeSave()
+ stateSinkObject.Save(0, &f.file)
+}
+
+func (f *VFSFile) afterLoad() {}
+
+// +checklocksignore
+func (f *VFSFile) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &f.file)
+}
+
+func (l *vfsLookup) StateTypeName() string {
+ return "pkg/sentry/fsbridge.vfsLookup"
+}
+
+func (l *vfsLookup) StateFields() []string {
+ return []string{
+ "mntns",
+ "root",
+ "workingDir",
+ }
+}
+
+func (l *vfsLookup) beforeSave() {}
+
+// +checklocksignore
+func (l *vfsLookup) StateSave(stateSinkObject state.Sink) {
+ l.beforeSave()
+ stateSinkObject.Save(0, &l.mntns)
+ stateSinkObject.Save(1, &l.root)
+ stateSinkObject.Save(2, &l.workingDir)
+}
+
+func (l *vfsLookup) afterLoad() {}
+
+// +checklocksignore
+func (l *vfsLookup) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &l.mntns)
+ stateSourceObject.Load(1, &l.root)
+ stateSourceObject.Load(2, &l.workingDir)
+}
+
+func init() {
+ state.Register((*fsFile)(nil))
+ state.Register((*fsLookup)(nil))
+ state.Register((*VFSFile)(nil))
+ state.Register((*vfsLookup)(nil))
+}