diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-06-24 06:37:35 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-24 06:37:35 +0000 |
commit | 9183888b520beeee8609170819a28bea89202909 (patch) | |
tree | 3cdcfa4de9ced4c539ab7c57e4cf58ffea980f6c /pkg/sentry/fs/fdpipe | |
parent | cab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff) | |
parent | 364ac92baf83f2352f78b718090472639bd92a76 (diff) |
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/fs/fdpipe')
-rw-r--r-- | pkg/sentry/fs/fdpipe/fdpipe_state_autogen.go | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/pkg/sentry/fs/fdpipe/fdpipe_state_autogen.go b/pkg/sentry/fs/fdpipe/fdpipe_state_autogen.go index 9ed7a3d41..359d52e92 100644 --- a/pkg/sentry/fs/fdpipe/fdpipe_state_autogen.go +++ b/pkg/sentry/fs/fdpipe/fdpipe_state_autogen.go @@ -7,21 +7,33 @@ import ( "gvisor.dev/gvisor/pkg/state" ) -func (x *pipeOperations) save(m state.Map) { +func (x *pipeOperations) StateTypeName() string { + return "pkg/sentry/fs/fdpipe.pipeOperations" +} + +func (x *pipeOperations) StateFields() []string { + return []string{ + "flags", + "opener", + "readAheadBuffer", + } +} + +func (x *pipeOperations) StateSave(m state.Sink) { x.beforeSave() var flags fs.FileFlags = x.saveFlags() - m.SaveValue("flags", flags) - m.Save("opener", &x.opener) - m.Save("readAheadBuffer", &x.readAheadBuffer) + m.SaveValue(0, flags) + m.Save(1, &x.opener) + m.Save(2, &x.readAheadBuffer) } -func (x *pipeOperations) load(m state.Map) { - m.LoadWait("opener", &x.opener) - m.Load("readAheadBuffer", &x.readAheadBuffer) - m.LoadValue("flags", new(fs.FileFlags), func(y interface{}) { x.loadFlags(y.(fs.FileFlags)) }) +func (x *pipeOperations) StateLoad(m state.Source) { + m.LoadWait(1, &x.opener) + m.Load(2, &x.readAheadBuffer) + m.LoadValue(0, new(fs.FileFlags), func(y interface{}) { x.loadFlags(y.(fs.FileFlags)) }) m.AfterLoad(x.afterLoad) } func init() { - state.Register("pkg/sentry/fs/fdpipe.pipeOperations", (*pipeOperations)(nil), state.Fns{Save: (*pipeOperations).save, Load: (*pipeOperations).load}) + state.Register((*pipeOperations)(nil)) } |