summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/sockfs
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-09-24 17:19:53 +0000
committergVisor bot <gvisor-bot@google.com>2020-09-24 17:19:53 +0000
commit61cc049caaa2317eda73e66f65f82b5099dd2bc2 (patch)
tree352bfc9c114c181e052a9656be9f3b2acd5f7b33 /pkg/sentry/fsimpl/sockfs
parent3102024707dc370e025f1b46fa2be12eade2f9cb (diff)
parent0a7075f38a4870ded687e117a299ac4996c0673e (diff)
Merge release-20200914.0-152-g0a7075f38 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/sockfs')
-rw-r--r--pkg/sentry/fsimpl/sockfs/sockfs.go5
-rw-r--r--pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go87
2 files changed, 92 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/sockfs/sockfs.go b/pkg/sentry/fsimpl/sockfs/sockfs.go
index f1e75e277..29e5371d6 100644
--- a/pkg/sentry/fsimpl/sockfs/sockfs.go
+++ b/pkg/sentry/fsimpl/sockfs/sockfs.go
@@ -28,6 +28,8 @@ import (
)
// filesystemType implements vfs.FilesystemType.
+//
+// +stateify savable
type filesystemType struct{}
// GetFilesystem implements vfs.FilesystemType.GetFilesystem.
@@ -44,6 +46,7 @@ func (filesystemType) Name() string {
return "sockfs"
}
+// +stateify savable
type filesystem struct {
kernfs.Filesystem
@@ -80,6 +83,8 @@ func (fs *filesystem) PrependPath(ctx context.Context, vfsroot, vd vfs.VirtualDe
}
// inode implements kernfs.Inode.
+//
+// +stateify savable
type inode struct {
kernfs.InodeAttrs
kernfs.InodeNoopRefCount
diff --git a/pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go b/pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go
index 8d5b85e2c..bbc868a48 100644
--- a/pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go
+++ b/pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go
@@ -1,3 +1,90 @@
// automatically generated by stateify.
package sockfs
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (x *filesystemType) StateTypeName() string {
+ return "pkg/sentry/fsimpl/sockfs.filesystemType"
+}
+
+func (x *filesystemType) StateFields() []string {
+ return []string{}
+}
+
+func (x *filesystemType) beforeSave() {}
+
+func (x *filesystemType) StateSave(m state.Sink) {
+ x.beforeSave()
+}
+
+func (x *filesystemType) afterLoad() {}
+
+func (x *filesystemType) StateLoad(m state.Source) {
+}
+
+func (x *filesystem) StateTypeName() string {
+ return "pkg/sentry/fsimpl/sockfs.filesystem"
+}
+
+func (x *filesystem) StateFields() []string {
+ return []string{
+ "Filesystem",
+ "devMinor",
+ }
+}
+
+func (x *filesystem) beforeSave() {}
+
+func (x *filesystem) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.Filesystem)
+ m.Save(1, &x.devMinor)
+}
+
+func (x *filesystem) afterLoad() {}
+
+func (x *filesystem) StateLoad(m state.Source) {
+ m.Load(0, &x.Filesystem)
+ m.Load(1, &x.devMinor)
+}
+
+func (x *inode) StateTypeName() string {
+ return "pkg/sentry/fsimpl/sockfs.inode"
+}
+
+func (x *inode) StateFields() []string {
+ return []string{
+ "InodeAttrs",
+ "InodeNoopRefCount",
+ "InodeNotDirectory",
+ "InodeNotSymlink",
+ }
+}
+
+func (x *inode) beforeSave() {}
+
+func (x *inode) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.InodeAttrs)
+ m.Save(1, &x.InodeNoopRefCount)
+ m.Save(2, &x.InodeNotDirectory)
+ m.Save(3, &x.InodeNotSymlink)
+}
+
+func (x *inode) afterLoad() {}
+
+func (x *inode) StateLoad(m state.Source) {
+ m.Load(0, &x.InodeAttrs)
+ m.Load(1, &x.InodeNoopRefCount)
+ m.Load(2, &x.InodeNotDirectory)
+ m.Load(3, &x.InodeNotSymlink)
+}
+
+func init() {
+ state.Register((*filesystemType)(nil))
+ state.Register((*filesystem)(nil))
+ state.Register((*inode)(nil))
+}