diff options
Diffstat (limited to 'pkg/sentry/fsbridge')
-rw-r--r-- | pkg/sentry/fsbridge/BUILD | 24 | ||||
-rw-r--r-- | pkg/sentry/fsbridge/fsbridge_state_autogen.go | 118 |
2 files changed, 118 insertions, 24 deletions
diff --git a/pkg/sentry/fsbridge/BUILD b/pkg/sentry/fsbridge/BUILD deleted file mode 100644 index 6c798f0bd..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/fspath", - "//pkg/sentry/fs", - "//pkg/sentry/kernel/auth", - "//pkg/sentry/memmap", - "//pkg/sentry/vfs", - "//pkg/syserror", - "//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..37696303d --- /dev/null +++ b/pkg/sentry/fsbridge/fsbridge_state_autogen.go @@ -0,0 +1,118 @@ +// 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() {} + +func (f *fsFile) StateSave(stateSinkObject state.Sink) { + f.beforeSave() + stateSinkObject.Save(0, &f.file) +} + +func (f *fsFile) afterLoad() {} + +func (f *fsFile) StateLoad(stateSourceObject state.Source) { + stateSourceObject.Load(0, &f.file) +} + +func (f *fsLookup) StateTypeName() string { + return "pkg/sentry/fsbridge.fsLookup" +} + +func (f *fsLookup) StateFields() []string { + return []string{ + "mntns", + "root", + "workingDir", + } +} + +func (f *fsLookup) beforeSave() {} + +func (f *fsLookup) StateSave(stateSinkObject state.Sink) { + f.beforeSave() + stateSinkObject.Save(0, &f.mntns) + stateSinkObject.Save(1, &f.root) + stateSinkObject.Save(2, &f.workingDir) +} + +func (f *fsLookup) afterLoad() {} + +func (f *fsLookup) StateLoad(stateSourceObject state.Source) { + stateSourceObject.Load(0, &f.mntns) + stateSourceObject.Load(1, &f.root) + stateSourceObject.Load(2, &f.workingDir) +} + +func (v *VFSFile) StateTypeName() string { + return "pkg/sentry/fsbridge.VFSFile" +} + +func (v *VFSFile) StateFields() []string { + return []string{ + "file", + } +} + +func (v *VFSFile) beforeSave() {} + +func (v *VFSFile) StateSave(stateSinkObject state.Sink) { + v.beforeSave() + stateSinkObject.Save(0, &v.file) +} + +func (v *VFSFile) afterLoad() {} + +func (v *VFSFile) StateLoad(stateSourceObject state.Source) { + stateSourceObject.Load(0, &v.file) +} + +func (v *vfsLookup) StateTypeName() string { + return "pkg/sentry/fsbridge.vfsLookup" +} + +func (v *vfsLookup) StateFields() []string { + return []string{ + "mntns", + "root", + "workingDir", + } +} + +func (v *vfsLookup) beforeSave() {} + +func (v *vfsLookup) StateSave(stateSinkObject state.Sink) { + v.beforeSave() + stateSinkObject.Save(0, &v.mntns) + stateSinkObject.Save(1, &v.root) + stateSinkObject.Save(2, &v.workingDir) +} + +func (v *vfsLookup) afterLoad() {} + +func (v *vfsLookup) StateLoad(stateSourceObject state.Source) { + stateSourceObject.Load(0, &v.mntns) + stateSourceObject.Load(1, &v.root) + stateSourceObject.Load(2, &v.workingDir) +} + +func init() { + state.Register((*fsFile)(nil)) + state.Register((*fsLookup)(nil)) + state.Register((*VFSFile)(nil)) + state.Register((*vfsLookup)(nil)) +} |