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/fsimpl | |
parent | cab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff) | |
parent | 364ac92baf83f2352f78b718090472639bd92a76 (diff) |
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/fsimpl')
-rw-r--r-- | pkg/sentry/fsimpl/devpts/devpts_state_autogen.go | 157 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/gofer/dentry_list.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/gofer/gofer_state_autogen.go | 54 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/host/host_state_autogen.go | 37 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/kernfs_state_autogen.go | 190 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/slot_list.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/proc/proc_state_autogen.go | 1276 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/dentry_list.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go | 54 |
9 files changed, 1281 insertions, 505 deletions
diff --git a/pkg/sentry/fsimpl/devpts/devpts_state_autogen.go b/pkg/sentry/fsimpl/devpts/devpts_state_autogen.go index 90cd7937c..5942f7bac 100644 --- a/pkg/sentry/fsimpl/devpts/devpts_state_autogen.go +++ b/pkg/sentry/fsimpl/devpts/devpts_state_autogen.go @@ -6,89 +6,156 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *lineDiscipline) StateTypeName() string { + return "pkg/sentry/fsimpl/devpts.lineDiscipline" +} + +func (x *lineDiscipline) StateFields() []string { + return []string{ + "size", + "inQueue", + "outQueue", + "termios", + "column", + } +} + func (x *lineDiscipline) beforeSave() {} -func (x *lineDiscipline) save(m state.Map) { + +func (x *lineDiscipline) StateSave(m state.Sink) { x.beforeSave() if !state.IsZeroValue(&x.masterWaiter) { - m.Failf("masterWaiter is %#v, expected zero", &x.masterWaiter) + state.Failf("masterWaiter is %#v, expected zero", &x.masterWaiter) } if !state.IsZeroValue(&x.slaveWaiter) { - m.Failf("slaveWaiter is %#v, expected zero", &x.slaveWaiter) + state.Failf("slaveWaiter is %#v, expected zero", &x.slaveWaiter) } - m.Save("size", &x.size) - m.Save("inQueue", &x.inQueue) - m.Save("outQueue", &x.outQueue) - m.Save("termios", &x.termios) - m.Save("column", &x.column) + m.Save(0, &x.size) + m.Save(1, &x.inQueue) + m.Save(2, &x.outQueue) + m.Save(3, &x.termios) + m.Save(4, &x.column) } func (x *lineDiscipline) afterLoad() {} -func (x *lineDiscipline) load(m state.Map) { - m.Load("size", &x.size) - m.Load("inQueue", &x.inQueue) - m.Load("outQueue", &x.outQueue) - m.Load("termios", &x.termios) - m.Load("column", &x.column) + +func (x *lineDiscipline) StateLoad(m state.Source) { + m.Load(0, &x.size) + m.Load(1, &x.inQueue) + m.Load(2, &x.outQueue) + m.Load(3, &x.termios) + m.Load(4, &x.column) +} + +func (x *outputQueueTransformer) StateTypeName() string { + return "pkg/sentry/fsimpl/devpts.outputQueueTransformer" +} + +func (x *outputQueueTransformer) StateFields() []string { + return []string{} } func (x *outputQueueTransformer) beforeSave() {} -func (x *outputQueueTransformer) save(m state.Map) { + +func (x *outputQueueTransformer) StateSave(m state.Sink) { x.beforeSave() } func (x *outputQueueTransformer) afterLoad() {} -func (x *outputQueueTransformer) load(m state.Map) { + +func (x *outputQueueTransformer) StateLoad(m state.Source) { +} + +func (x *inputQueueTransformer) StateTypeName() string { + return "pkg/sentry/fsimpl/devpts.inputQueueTransformer" +} + +func (x *inputQueueTransformer) StateFields() []string { + return []string{} } func (x *inputQueueTransformer) beforeSave() {} -func (x *inputQueueTransformer) save(m state.Map) { + +func (x *inputQueueTransformer) StateSave(m state.Sink) { x.beforeSave() } func (x *inputQueueTransformer) afterLoad() {} -func (x *inputQueueTransformer) load(m state.Map) { + +func (x *inputQueueTransformer) StateLoad(m state.Source) { +} + +func (x *queue) StateTypeName() string { + return "pkg/sentry/fsimpl/devpts.queue" +} + +func (x *queue) StateFields() []string { + return []string{ + "readBuf", + "waitBuf", + "waitBufLen", + "readable", + "transformer", + } } func (x *queue) beforeSave() {} -func (x *queue) save(m state.Map) { + +func (x *queue) StateSave(m state.Sink) { x.beforeSave() - m.Save("readBuf", &x.readBuf) - m.Save("waitBuf", &x.waitBuf) - m.Save("waitBufLen", &x.waitBufLen) - m.Save("readable", &x.readable) - m.Save("transformer", &x.transformer) + m.Save(0, &x.readBuf) + m.Save(1, &x.waitBuf) + m.Save(2, &x.waitBufLen) + m.Save(3, &x.readable) + m.Save(4, &x.transformer) } func (x *queue) afterLoad() {} -func (x *queue) load(m state.Map) { - m.Load("readBuf", &x.readBuf) - m.Load("waitBuf", &x.waitBuf) - m.Load("waitBufLen", &x.waitBufLen) - m.Load("readable", &x.readable) - m.Load("transformer", &x.transformer) + +func (x *queue) StateLoad(m state.Source) { + m.Load(0, &x.readBuf) + m.Load(1, &x.waitBuf) + m.Load(2, &x.waitBufLen) + m.Load(3, &x.readable) + m.Load(4, &x.transformer) +} + +func (x *Terminal) StateTypeName() string { + return "pkg/sentry/fsimpl/devpts.Terminal" +} + +func (x *Terminal) StateFields() []string { + return []string{ + "n", + "ld", + "masterKTTY", + "slaveKTTY", + } } func (x *Terminal) beforeSave() {} -func (x *Terminal) save(m state.Map) { + +func (x *Terminal) StateSave(m state.Sink) { x.beforeSave() - m.Save("n", &x.n) - m.Save("ld", &x.ld) - m.Save("masterKTTY", &x.masterKTTY) - m.Save("slaveKTTY", &x.slaveKTTY) + m.Save(0, &x.n) + m.Save(1, &x.ld) + m.Save(2, &x.masterKTTY) + m.Save(3, &x.slaveKTTY) } func (x *Terminal) afterLoad() {} -func (x *Terminal) load(m state.Map) { - m.Load("n", &x.n) - m.Load("ld", &x.ld) - m.Load("masterKTTY", &x.masterKTTY) - m.Load("slaveKTTY", &x.slaveKTTY) + +func (x *Terminal) StateLoad(m state.Source) { + m.Load(0, &x.n) + m.Load(1, &x.ld) + m.Load(2, &x.masterKTTY) + m.Load(3, &x.slaveKTTY) } func init() { - state.Register("pkg/sentry/fsimpl/devpts.lineDiscipline", (*lineDiscipline)(nil), state.Fns{Save: (*lineDiscipline).save, Load: (*lineDiscipline).load}) - state.Register("pkg/sentry/fsimpl/devpts.outputQueueTransformer", (*outputQueueTransformer)(nil), state.Fns{Save: (*outputQueueTransformer).save, Load: (*outputQueueTransformer).load}) - state.Register("pkg/sentry/fsimpl/devpts.inputQueueTransformer", (*inputQueueTransformer)(nil), state.Fns{Save: (*inputQueueTransformer).save, Load: (*inputQueueTransformer).load}) - state.Register("pkg/sentry/fsimpl/devpts.queue", (*queue)(nil), state.Fns{Save: (*queue).save, Load: (*queue).load}) - state.Register("pkg/sentry/fsimpl/devpts.Terminal", (*Terminal)(nil), state.Fns{Save: (*Terminal).save, Load: (*Terminal).load}) + state.Register((*lineDiscipline)(nil)) + state.Register((*outputQueueTransformer)(nil)) + state.Register((*inputQueueTransformer)(nil)) + state.Register((*queue)(nil)) + state.Register((*Terminal)(nil)) } diff --git a/pkg/sentry/fsimpl/gofer/dentry_list.go b/pkg/sentry/fsimpl/gofer/dentry_list.go index fa03e2501..84f839e3a 100644 --- a/pkg/sentry/fsimpl/gofer/dentry_list.go +++ b/pkg/sentry/fsimpl/gofer/dentry_list.go @@ -56,7 +56,7 @@ func (l *dentryList) Back() *dentry { // // NOTE: This is an O(n) operation. func (l *dentryList) Len() (count int) { - for e := l.Front(); e != nil; e = e.Next() { + for e := l.Front(); e != nil; e = (dentryElementMapper{}.linkerFor(e)).Next() { count++ } return count @@ -148,13 +148,13 @@ func (l *dentryList) Remove(e *dentry) { if prev != nil { dentryElementMapper{}.linkerFor(prev).SetNext(next) - } else { + } else if l.head == e { l.head = next } if next != nil { dentryElementMapper{}.linkerFor(next).SetPrev(prev) - } else { + } else if l.tail == e { l.tail = prev } diff --git a/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go b/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go index 546d432c9..19b1eef9e 100644 --- a/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go +++ b/pkg/sentry/fsimpl/gofer/gofer_state_autogen.go @@ -6,33 +6,59 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *dentryList) StateTypeName() string { + return "pkg/sentry/fsimpl/gofer.dentryList" +} + +func (x *dentryList) StateFields() []string { + return []string{ + "head", + "tail", + } +} + func (x *dentryList) beforeSave() {} -func (x *dentryList) save(m state.Map) { + +func (x *dentryList) StateSave(m state.Sink) { x.beforeSave() - m.Save("head", &x.head) - m.Save("tail", &x.tail) + m.Save(0, &x.head) + m.Save(1, &x.tail) } func (x *dentryList) afterLoad() {} -func (x *dentryList) load(m state.Map) { - m.Load("head", &x.head) - m.Load("tail", &x.tail) + +func (x *dentryList) StateLoad(m state.Source) { + m.Load(0, &x.head) + m.Load(1, &x.tail) +} + +func (x *dentryEntry) StateTypeName() string { + return "pkg/sentry/fsimpl/gofer.dentryEntry" +} + +func (x *dentryEntry) StateFields() []string { + return []string{ + "next", + "prev", + } } func (x *dentryEntry) beforeSave() {} -func (x *dentryEntry) save(m state.Map) { + +func (x *dentryEntry) StateSave(m state.Sink) { x.beforeSave() - m.Save("next", &x.next) - m.Save("prev", &x.prev) + m.Save(0, &x.next) + m.Save(1, &x.prev) } func (x *dentryEntry) afterLoad() {} -func (x *dentryEntry) load(m state.Map) { - m.Load("next", &x.next) - m.Load("prev", &x.prev) + +func (x *dentryEntry) StateLoad(m state.Source) { + m.Load(0, &x.next) + m.Load(1, &x.prev) } func init() { - state.Register("pkg/sentry/fsimpl/gofer.dentryList", (*dentryList)(nil), state.Fns{Save: (*dentryList).save, Load: (*dentryList).load}) - state.Register("pkg/sentry/fsimpl/gofer.dentryEntry", (*dentryEntry)(nil), state.Fns{Save: (*dentryEntry).save, Load: (*dentryEntry).load}) + state.Register((*dentryList)(nil)) + state.Register((*dentryEntry)(nil)) } diff --git a/pkg/sentry/fsimpl/host/host_state_autogen.go b/pkg/sentry/fsimpl/host/host_state_autogen.go index 28bc79d04..17320c417 100644 --- a/pkg/sentry/fsimpl/host/host_state_autogen.go +++ b/pkg/sentry/fsimpl/host/host_state_autogen.go @@ -6,23 +6,38 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *ConnectedEndpoint) StateTypeName() string { + return "pkg/sentry/fsimpl/host.ConnectedEndpoint" +} + +func (x *ConnectedEndpoint) StateFields() []string { + return []string{ + "ref", + "fd", + "addr", + "stype", + } +} + func (x *ConnectedEndpoint) beforeSave() {} -func (x *ConnectedEndpoint) save(m state.Map) { + +func (x *ConnectedEndpoint) StateSave(m state.Sink) { x.beforeSave() - m.Save("ref", &x.ref) - m.Save("fd", &x.fd) - m.Save("addr", &x.addr) - m.Save("stype", &x.stype) + m.Save(0, &x.ref) + m.Save(1, &x.fd) + m.Save(2, &x.addr) + m.Save(3, &x.stype) } func (x *ConnectedEndpoint) afterLoad() {} -func (x *ConnectedEndpoint) load(m state.Map) { - m.Load("ref", &x.ref) - m.Load("fd", &x.fd) - m.Load("addr", &x.addr) - m.Load("stype", &x.stype) + +func (x *ConnectedEndpoint) StateLoad(m state.Source) { + m.Load(0, &x.ref) + m.Load(1, &x.fd) + m.Load(2, &x.addr) + m.Load(3, &x.stype) } func init() { - state.Register("pkg/sentry/fsimpl/host.ConnectedEndpoint", (*ConnectedEndpoint)(nil), state.Fns{Save: (*ConnectedEndpoint).save, Load: (*ConnectedEndpoint).load}) + state.Register((*ConnectedEndpoint)(nil)) } diff --git a/pkg/sentry/fsimpl/kernfs/kernfs_state_autogen.go b/pkg/sentry/fsimpl/kernfs/kernfs_state_autogen.go index 61b2c460f..371b1481c 100644 --- a/pkg/sentry/fsimpl/kernfs/kernfs_state_autogen.go +++ b/pkg/sentry/fsimpl/kernfs/kernfs_state_autogen.go @@ -6,97 +6,173 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *DynamicBytesFile) StateTypeName() string { + return "pkg/sentry/fsimpl/kernfs.DynamicBytesFile" +} + +func (x *DynamicBytesFile) StateFields() []string { + return []string{ + "InodeAttrs", + "InodeNoopRefCount", + "InodeNotDirectory", + "InodeNotSymlink", + "locks", + "data", + } +} + func (x *DynamicBytesFile) beforeSave() {} -func (x *DynamicBytesFile) save(m state.Map) { + +func (x *DynamicBytesFile) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Save("InodeNotDirectory", &x.InodeNotDirectory) - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("locks", &x.locks) - m.Save("data", &x.data) + m.Save(0, &x.InodeAttrs) + m.Save(1, &x.InodeNoopRefCount) + m.Save(2, &x.InodeNotDirectory) + m.Save(3, &x.InodeNotSymlink) + m.Save(4, &x.locks) + m.Save(5, &x.data) } func (x *DynamicBytesFile) afterLoad() {} -func (x *DynamicBytesFile) load(m state.Map) { - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Load("InodeNotDirectory", &x.InodeNotDirectory) - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("locks", &x.locks) - m.Load("data", &x.data) + +func (x *DynamicBytesFile) StateLoad(m state.Source) { + m.Load(0, &x.InodeAttrs) + m.Load(1, &x.InodeNoopRefCount) + m.Load(2, &x.InodeNotDirectory) + m.Load(3, &x.InodeNotSymlink) + m.Load(4, &x.locks) + m.Load(5, &x.data) +} + +func (x *DynamicBytesFD) StateTypeName() string { + return "pkg/sentry/fsimpl/kernfs.DynamicBytesFD" +} + +func (x *DynamicBytesFD) StateFields() []string { + return []string{ + "FileDescriptionDefaultImpl", + "DynamicBytesFileDescriptionImpl", + "LockFD", + "vfsfd", + "inode", + } } func (x *DynamicBytesFD) beforeSave() {} -func (x *DynamicBytesFD) save(m state.Map) { + +func (x *DynamicBytesFD) StateSave(m state.Sink) { x.beforeSave() - m.Save("FileDescriptionDefaultImpl", &x.FileDescriptionDefaultImpl) - m.Save("DynamicBytesFileDescriptionImpl", &x.DynamicBytesFileDescriptionImpl) - m.Save("LockFD", &x.LockFD) - m.Save("vfsfd", &x.vfsfd) - m.Save("inode", &x.inode) + m.Save(0, &x.FileDescriptionDefaultImpl) + m.Save(1, &x.DynamicBytesFileDescriptionImpl) + m.Save(2, &x.LockFD) + m.Save(3, &x.vfsfd) + m.Save(4, &x.inode) } func (x *DynamicBytesFD) afterLoad() {} -func (x *DynamicBytesFD) load(m state.Map) { - m.Load("FileDescriptionDefaultImpl", &x.FileDescriptionDefaultImpl) - m.Load("DynamicBytesFileDescriptionImpl", &x.DynamicBytesFileDescriptionImpl) - m.Load("LockFD", &x.LockFD) - m.Load("vfsfd", &x.vfsfd) - m.Load("inode", &x.inode) + +func (x *DynamicBytesFD) StateLoad(m state.Source) { + m.Load(0, &x.FileDescriptionDefaultImpl) + m.Load(1, &x.DynamicBytesFileDescriptionImpl) + m.Load(2, &x.LockFD) + m.Load(3, &x.vfsfd) + m.Load(4, &x.inode) +} + +func (x *StaticDirectory) StateTypeName() string { + return "pkg/sentry/fsimpl/kernfs.StaticDirectory" +} + +func (x *StaticDirectory) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeAttrs", + "InodeNoDynamicLookup", + "OrderedChildren", + "locks", + } } func (x *StaticDirectory) beforeSave() {} -func (x *StaticDirectory) save(m state.Map) { + +func (x *StaticDirectory) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("InodeNoDynamicLookup", &x.InodeNoDynamicLookup) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("locks", &x.locks) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeAttrs) + m.Save(3, &x.InodeNoDynamicLookup) + m.Save(4, &x.OrderedChildren) + m.Save(5, &x.locks) } func (x *StaticDirectory) afterLoad() {} -func (x *StaticDirectory) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("InodeNoDynamicLookup", &x.InodeNoDynamicLookup) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("locks", &x.locks) + +func (x *StaticDirectory) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeAttrs) + m.Load(3, &x.InodeNoDynamicLookup) + m.Load(4, &x.OrderedChildren) + m.Load(5, &x.locks) +} + +func (x *slotList) StateTypeName() string { + return "pkg/sentry/fsimpl/kernfs.slotList" +} + +func (x *slotList) StateFields() []string { + return []string{ + "head", + "tail", + } } func (x *slotList) beforeSave() {} -func (x *slotList) save(m state.Map) { + +func (x *slotList) StateSave(m state.Sink) { x.beforeSave() - m.Save("head", &x.head) - m.Save("tail", &x.tail) + m.Save(0, &x.head) + m.Save(1, &x.tail) } func (x *slotList) afterLoad() {} -func (x *slotList) load(m state.Map) { - m.Load("head", &x.head) - m.Load("tail", &x.tail) + +func (x *slotList) StateLoad(m state.Source) { + m.Load(0, &x.head) + m.Load(1, &x.tail) +} + +func (x *slotEntry) StateTypeName() string { + return "pkg/sentry/fsimpl/kernfs.slotEntry" +} + +func (x *slotEntry) StateFields() []string { + return []string{ + "next", + "prev", + } } func (x *slotEntry) beforeSave() {} -func (x *slotEntry) save(m state.Map) { + +func (x *slotEntry) StateSave(m state.Sink) { x.beforeSave() - m.Save("next", &x.next) - m.Save("prev", &x.prev) + m.Save(0, &x.next) + m.Save(1, &x.prev) } func (x *slotEntry) afterLoad() {} -func (x *slotEntry) load(m state.Map) { - m.Load("next", &x.next) - m.Load("prev", &x.prev) + +func (x *slotEntry) StateLoad(m state.Source) { + m.Load(0, &x.next) + m.Load(1, &x.prev) } func init() { - state.Register("pkg/sentry/fsimpl/kernfs.DynamicBytesFile", (*DynamicBytesFile)(nil), state.Fns{Save: (*DynamicBytesFile).save, Load: (*DynamicBytesFile).load}) - state.Register("pkg/sentry/fsimpl/kernfs.DynamicBytesFD", (*DynamicBytesFD)(nil), state.Fns{Save: (*DynamicBytesFD).save, Load: (*DynamicBytesFD).load}) - state.Register("pkg/sentry/fsimpl/kernfs.StaticDirectory", (*StaticDirectory)(nil), state.Fns{Save: (*StaticDirectory).save, Load: (*StaticDirectory).load}) - state.Register("pkg/sentry/fsimpl/kernfs.slotList", (*slotList)(nil), state.Fns{Save: (*slotList).save, Load: (*slotList).load}) - state.Register("pkg/sentry/fsimpl/kernfs.slotEntry", (*slotEntry)(nil), state.Fns{Save: (*slotEntry).save, Load: (*slotEntry).load}) + state.Register((*DynamicBytesFile)(nil)) + state.Register((*DynamicBytesFD)(nil)) + state.Register((*StaticDirectory)(nil)) + state.Register((*slotList)(nil)) + state.Register((*slotEntry)(nil)) } diff --git a/pkg/sentry/fsimpl/kernfs/slot_list.go b/pkg/sentry/fsimpl/kernfs/slot_list.go index 09c30bca7..c6cd74660 100644 --- a/pkg/sentry/fsimpl/kernfs/slot_list.go +++ b/pkg/sentry/fsimpl/kernfs/slot_list.go @@ -56,7 +56,7 @@ func (l *slotList) Back() *slot { // // NOTE: This is an O(n) operation. func (l *slotList) Len() (count int) { - for e := l.Front(); e != nil; e = e.Next() { + for e := l.Front(); e != nil; e = (slotElementMapper{}.linkerFor(e)).Next() { count++ } return count @@ -148,13 +148,13 @@ func (l *slotList) Remove(e *slot) { if prev != nil { slotElementMapper{}.linkerFor(prev).SetNext(next) - } else { + } else if l.head == e { l.head = next } if next != nil { slotElementMapper{}.linkerFor(next).SetPrev(prev) - } else { + } else if l.tail == e { l.tail = prev } diff --git a/pkg/sentry/fsimpl/proc/proc_state_autogen.go b/pkg/sentry/fsimpl/proc/proc_state_autogen.go index b940c9973..e297a6257 100644 --- a/pkg/sentry/fsimpl/proc/proc_state_autogen.go +++ b/pkg/sentry/fsimpl/proc/proc_state_autogen.go @@ -6,647 +6,1213 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *FilesystemType) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.FilesystemType" +} + +func (x *FilesystemType) StateFields() []string { + return []string{} +} + func (x *FilesystemType) beforeSave() {} -func (x *FilesystemType) save(m state.Map) { + +func (x *FilesystemType) StateSave(m state.Sink) { x.beforeSave() } func (x *FilesystemType) afterLoad() {} -func (x *FilesystemType) load(m state.Map) { + +func (x *FilesystemType) StateLoad(m state.Source) { +} + +func (x *subtasksInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.subtasksInode" +} + +func (x *subtasksInode) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeAttrs", + "OrderedChildren", + "AlwaysValid", + "locks", + "fs", + "task", + "pidns", + "cgroupControllers", + } } func (x *subtasksInode) beforeSave() {} -func (x *subtasksInode) save(m state.Map) { + +func (x *subtasksInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("AlwaysValid", &x.AlwaysValid) - m.Save("locks", &x.locks) - m.Save("fs", &x.fs) - m.Save("task", &x.task) - m.Save("pidns", &x.pidns) - m.Save("cgroupControllers", &x.cgroupControllers) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeAttrs) + m.Save(3, &x.OrderedChildren) + m.Save(4, &x.AlwaysValid) + m.Save(5, &x.locks) + m.Save(6, &x.fs) + m.Save(7, &x.task) + m.Save(8, &x.pidns) + m.Save(9, &x.cgroupControllers) } func (x *subtasksInode) afterLoad() {} -func (x *subtasksInode) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("AlwaysValid", &x.AlwaysValid) - m.Load("locks", &x.locks) - m.Load("fs", &x.fs) - m.Load("task", &x.task) - m.Load("pidns", &x.pidns) - m.Load("cgroupControllers", &x.cgroupControllers) + +func (x *subtasksInode) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeAttrs) + m.Load(3, &x.OrderedChildren) + m.Load(4, &x.AlwaysValid) + m.Load(5, &x.locks) + m.Load(6, &x.fs) + m.Load(7, &x.task) + m.Load(8, &x.pidns) + m.Load(9, &x.cgroupControllers) +} + +func (x *taskInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.taskInode" +} + +func (x *taskInode) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeNoDynamicLookup", + "InodeAttrs", + "OrderedChildren", + "locks", + "task", + } } func (x *taskInode) beforeSave() {} -func (x *taskInode) save(m state.Map) { + +func (x *taskInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeNoDynamicLookup", &x.InodeNoDynamicLookup) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("locks", &x.locks) - m.Save("task", &x.task) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeNoDynamicLookup) + m.Save(3, &x.InodeAttrs) + m.Save(4, &x.OrderedChildren) + m.Save(5, &x.locks) + m.Save(6, &x.task) } func (x *taskInode) afterLoad() {} -func (x *taskInode) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeNoDynamicLookup", &x.InodeNoDynamicLookup) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("locks", &x.locks) - m.Load("task", &x.task) + +func (x *taskInode) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeNoDynamicLookup) + m.Load(3, &x.InodeAttrs) + m.Load(4, &x.OrderedChildren) + m.Load(5, &x.locks) + m.Load(6, &x.task) +} + +func (x *fdDirInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.fdDirInode" +} + +func (x *fdDirInode) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeAttrs", + "OrderedChildren", + "AlwaysValid", + "fdDir", + } } func (x *fdDirInode) beforeSave() {} -func (x *fdDirInode) save(m state.Map) { + +func (x *fdDirInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("AlwaysValid", &x.AlwaysValid) - m.Save("fdDir", &x.fdDir) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeAttrs) + m.Save(3, &x.OrderedChildren) + m.Save(4, &x.AlwaysValid) + m.Save(5, &x.fdDir) } func (x *fdDirInode) afterLoad() {} -func (x *fdDirInode) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("AlwaysValid", &x.AlwaysValid) - m.Load("fdDir", &x.fdDir) + +func (x *fdDirInode) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeAttrs) + m.Load(3, &x.OrderedChildren) + m.Load(4, &x.AlwaysValid) + m.Load(5, &x.fdDir) +} + +func (x *fdSymlink) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.fdSymlink" +} + +func (x *fdSymlink) StateFields() []string { + return []string{ + "InodeAttrs", + "InodeNoopRefCount", + "InodeSymlink", + "task", + "fd", + } } func (x *fdSymlink) beforeSave() {} -func (x *fdSymlink) save(m state.Map) { + +func (x *fdSymlink) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Save("InodeSymlink", &x.InodeSymlink) - m.Save("task", &x.task) - m.Save("fd", &x.fd) + m.Save(0, &x.InodeAttrs) + m.Save(1, &x.InodeNoopRefCount) + m.Save(2, &x.InodeSymlink) + m.Save(3, &x.task) + m.Save(4, &x.fd) } func (x *fdSymlink) afterLoad() {} -func (x *fdSymlink) load(m state.Map) { - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Load("InodeSymlink", &x.InodeSymlink) - m.Load("task", &x.task) - m.Load("fd", &x.fd) + +func (x *fdSymlink) StateLoad(m state.Source) { + m.Load(0, &x.InodeAttrs) + m.Load(1, &x.InodeNoopRefCount) + m.Load(2, &x.InodeSymlink) + m.Load(3, &x.task) + m.Load(4, &x.fd) +} + +func (x *fdInfoDirInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.fdInfoDirInode" +} + +func (x *fdInfoDirInode) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeAttrs", + "OrderedChildren", + "AlwaysValid", + "fdDir", + } } func (x *fdInfoDirInode) beforeSave() {} -func (x *fdInfoDirInode) save(m state.Map) { + +func (x *fdInfoDirInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("AlwaysValid", &x.AlwaysValid) - m.Save("fdDir", &x.fdDir) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeAttrs) + m.Save(3, &x.OrderedChildren) + m.Save(4, &x.AlwaysValid) + m.Save(5, &x.fdDir) } func (x *fdInfoDirInode) afterLoad() {} -func (x *fdInfoDirInode) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("AlwaysValid", &x.AlwaysValid) - m.Load("fdDir", &x.fdDir) + +func (x *fdInfoDirInode) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeAttrs) + m.Load(3, &x.OrderedChildren) + m.Load(4, &x.AlwaysValid) + m.Load(5, &x.fdDir) +} + +func (x *fdInfoData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.fdInfoData" +} + +func (x *fdInfoData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "AtomicRefCount", + "task", + "fd", + } } func (x *fdInfoData) beforeSave() {} -func (x *fdInfoData) save(m state.Map) { + +func (x *fdInfoData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("AtomicRefCount", &x.AtomicRefCount) - m.Save("task", &x.task) - m.Save("fd", &x.fd) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.AtomicRefCount) + m.Save(2, &x.task) + m.Save(3, &x.fd) } func (x *fdInfoData) afterLoad() {} -func (x *fdInfoData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("AtomicRefCount", &x.AtomicRefCount) - m.Load("task", &x.task) - m.Load("fd", &x.fd) + +func (x *fdInfoData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.AtomicRefCount) + m.Load(2, &x.task) + m.Load(3, &x.fd) +} + +func (x *auxvData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.auxvData" +} + +func (x *auxvData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *auxvData) beforeSave() {} -func (x *auxvData) save(m state.Map) { + +func (x *auxvData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *auxvData) afterLoad() {} -func (x *auxvData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *auxvData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *cmdlineData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.cmdlineData" +} + +func (x *cmdlineData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + "arg", + } } func (x *cmdlineData) beforeSave() {} -func (x *cmdlineData) save(m state.Map) { + +func (x *cmdlineData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) - m.Save("arg", &x.arg) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) + m.Save(2, &x.arg) } func (x *cmdlineData) afterLoad() {} -func (x *cmdlineData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) - m.Load("arg", &x.arg) + +func (x *cmdlineData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) + m.Load(2, &x.arg) +} + +func (x *commInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.commInode" +} + +func (x *commInode) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *commInode) beforeSave() {} -func (x *commInode) save(m state.Map) { + +func (x *commInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *commInode) afterLoad() {} -func (x *commInode) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *commInode) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *commData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.commData" +} + +func (x *commData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *commData) beforeSave() {} -func (x *commData) save(m state.Map) { + +func (x *commData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *commData) afterLoad() {} -func (x *commData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *commData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *idMapData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.idMapData" +} + +func (x *idMapData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + "gids", + } } func (x *idMapData) beforeSave() {} -func (x *idMapData) save(m state.Map) { + +func (x *idMapData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) - m.Save("gids", &x.gids) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) + m.Save(2, &x.gids) } func (x *idMapData) afterLoad() {} -func (x *idMapData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) - m.Load("gids", &x.gids) + +func (x *idMapData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) + m.Load(2, &x.gids) +} + +func (x *mapsData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.mapsData" +} + +func (x *mapsData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *mapsData) beforeSave() {} -func (x *mapsData) save(m state.Map) { + +func (x *mapsData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *mapsData) afterLoad() {} -func (x *mapsData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *mapsData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *smapsData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.smapsData" +} + +func (x *smapsData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *smapsData) beforeSave() {} -func (x *smapsData) save(m state.Map) { + +func (x *smapsData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *smapsData) afterLoad() {} -func (x *smapsData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *smapsData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *taskStatData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.taskStatData" +} + +func (x *taskStatData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + "tgstats", + "pidns", + } } func (x *taskStatData) beforeSave() {} -func (x *taskStatData) save(m state.Map) { + +func (x *taskStatData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) - m.Save("tgstats", &x.tgstats) - m.Save("pidns", &x.pidns) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) + m.Save(2, &x.tgstats) + m.Save(3, &x.pidns) } func (x *taskStatData) afterLoad() {} -func (x *taskStatData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) - m.Load("tgstats", &x.tgstats) - m.Load("pidns", &x.pidns) + +func (x *taskStatData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) + m.Load(2, &x.tgstats) + m.Load(3, &x.pidns) +} + +func (x *statmData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.statmData" +} + +func (x *statmData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *statmData) beforeSave() {} -func (x *statmData) save(m state.Map) { + +func (x *statmData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *statmData) afterLoad() {} -func (x *statmData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *statmData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *statusData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.statusData" +} + +func (x *statusData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + "pidns", + } } func (x *statusData) beforeSave() {} -func (x *statusData) save(m state.Map) { + +func (x *statusData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) - m.Save("pidns", &x.pidns) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) + m.Save(2, &x.pidns) } func (x *statusData) afterLoad() {} -func (x *statusData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) - m.Load("pidns", &x.pidns) + +func (x *statusData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) + m.Load(2, &x.pidns) +} + +func (x *ioData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.ioData" +} + +func (x *ioData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "ioUsage", + } } func (x *ioData) beforeSave() {} -func (x *ioData) save(m state.Map) { + +func (x *ioData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("ioUsage", &x.ioUsage) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.ioUsage) } func (x *ioData) afterLoad() {} -func (x *ioData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("ioUsage", &x.ioUsage) + +func (x *ioData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.ioUsage) +} + +func (x *oomScoreAdj) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.oomScoreAdj" +} + +func (x *oomScoreAdj) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *oomScoreAdj) beforeSave() {} -func (x *oomScoreAdj) save(m state.Map) { + +func (x *oomScoreAdj) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *oomScoreAdj) afterLoad() {} -func (x *oomScoreAdj) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *oomScoreAdj) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *exeSymlink) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.exeSymlink" +} + +func (x *exeSymlink) StateFields() []string { + return []string{ + "InodeAttrs", + "InodeNoopRefCount", + "InodeSymlink", + "task", + } } func (x *exeSymlink) beforeSave() {} -func (x *exeSymlink) save(m state.Map) { + +func (x *exeSymlink) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Save("InodeSymlink", &x.InodeSymlink) - m.Save("task", &x.task) + m.Save(0, &x.InodeAttrs) + m.Save(1, &x.InodeNoopRefCount) + m.Save(2, &x.InodeSymlink) + m.Save(3, &x.task) } func (x *exeSymlink) afterLoad() {} -func (x *exeSymlink) load(m state.Map) { - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("InodeNoopRefCount", &x.InodeNoopRefCount) - m.Load("InodeSymlink", &x.InodeSymlink) - m.Load("task", &x.task) + +func (x *exeSymlink) StateLoad(m state.Source) { + m.Load(0, &x.InodeAttrs) + m.Load(1, &x.InodeNoopRefCount) + m.Load(2, &x.InodeSymlink) + m.Load(3, &x.task) +} + +func (x *mountInfoData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.mountInfoData" +} + +func (x *mountInfoData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *mountInfoData) beforeSave() {} -func (x *mountInfoData) save(m state.Map) { + +func (x *mountInfoData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *mountInfoData) afterLoad() {} -func (x *mountInfoData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *mountInfoData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *mountsData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.mountsData" +} + +func (x *mountsData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "task", + } } func (x *mountsData) beforeSave() {} -func (x *mountsData) save(m state.Map) { + +func (x *mountsData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("task", &x.task) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.task) } func (x *mountsData) afterLoad() {} -func (x *mountsData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("task", &x.task) + +func (x *mountsData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.task) +} + +func (x *ifinet6) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.ifinet6" +} + +func (x *ifinet6) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + } } func (x *ifinet6) beforeSave() {} -func (x *ifinet6) save(m state.Map) { + +func (x *ifinet6) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) } func (x *ifinet6) afterLoad() {} -func (x *ifinet6) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("stack", &x.stack) + +func (x *ifinet6) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.stack) +} + +func (x *netDevData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netDevData" +} + +func (x *netDevData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + } } func (x *netDevData) beforeSave() {} -func (x *netDevData) save(m state.Map) { + +func (x *netDevData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) } func (x *netDevData) afterLoad() {} -func (x *netDevData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("stack", &x.stack) + +func (x *netDevData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.stack) +} + +func (x *netUnixData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netUnixData" +} + +func (x *netUnixData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "kernel", + } } func (x *netUnixData) beforeSave() {} -func (x *netUnixData) save(m state.Map) { + +func (x *netUnixData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("kernel", &x.kernel) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.kernel) } func (x *netUnixData) afterLoad() {} -func (x *netUnixData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("kernel", &x.kernel) + +func (x *netUnixData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.kernel) +} + +func (x *netTCPData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netTCPData" +} + +func (x *netTCPData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "kernel", + } } func (x *netTCPData) beforeSave() {} -func (x *netTCPData) save(m state.Map) { + +func (x *netTCPData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("kernel", &x.kernel) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.kernel) } func (x *netTCPData) afterLoad() {} -func (x *netTCPData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("kernel", &x.kernel) + +func (x *netTCPData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.kernel) +} + +func (x *netTCP6Data) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netTCP6Data" +} + +func (x *netTCP6Data) StateFields() []string { + return []string{ + "DynamicBytesFile", + "kernel", + } } func (x *netTCP6Data) beforeSave() {} -func (x *netTCP6Data) save(m state.Map) { + +func (x *netTCP6Data) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("kernel", &x.kernel) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.kernel) } func (x *netTCP6Data) afterLoad() {} -func (x *netTCP6Data) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("kernel", &x.kernel) + +func (x *netTCP6Data) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.kernel) +} + +func (x *netUDPData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netUDPData" +} + +func (x *netUDPData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "kernel", + } } func (x *netUDPData) beforeSave() {} -func (x *netUDPData) save(m state.Map) { + +func (x *netUDPData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("kernel", &x.kernel) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.kernel) } func (x *netUDPData) afterLoad() {} -func (x *netUDPData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("kernel", &x.kernel) + +func (x *netUDPData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.kernel) +} + +func (x *netSnmpData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netSnmpData" +} + +func (x *netSnmpData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + } } func (x *netSnmpData) beforeSave() {} -func (x *netSnmpData) save(m state.Map) { + +func (x *netSnmpData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) } func (x *netSnmpData) afterLoad() {} -func (x *netSnmpData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("stack", &x.stack) + +func (x *netSnmpData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.stack) +} + +func (x *netRouteData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netRouteData" +} + +func (x *netRouteData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + } } func (x *netRouteData) beforeSave() {} -func (x *netRouteData) save(m state.Map) { + +func (x *netRouteData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) } func (x *netRouteData) afterLoad() {} -func (x *netRouteData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("stack", &x.stack) + +func (x *netRouteData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.stack) +} + +func (x *netStatData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.netStatData" +} + +func (x *netStatData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + } } func (x *netStatData) beforeSave() {} -func (x *netStatData) save(m state.Map) { + +func (x *netStatData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) } func (x *netStatData) afterLoad() {} -func (x *netStatData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("stack", &x.stack) + +func (x *netStatData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.stack) +} + +func (x *tasksInode) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.tasksInode" +} + +func (x *tasksInode) StateFields() []string { + return []string{ + "InodeNotSymlink", + "InodeDirectoryNoNewChildren", + "InodeAttrs", + "OrderedChildren", + "AlwaysValid", + "locks", + "fs", + "pidns", + "selfSymlink", + "threadSelfSymlink", + "cgroupControllers", + } } func (x *tasksInode) beforeSave() {} -func (x *tasksInode) save(m state.Map) { + +func (x *tasksInode) StateSave(m state.Sink) { x.beforeSave() - m.Save("InodeNotSymlink", &x.InodeNotSymlink) - m.Save("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Save("InodeAttrs", &x.InodeAttrs) - m.Save("OrderedChildren", &x.OrderedChildren) - m.Save("AlwaysValid", &x.AlwaysValid) - m.Save("locks", &x.locks) - m.Save("fs", &x.fs) - m.Save("pidns", &x.pidns) - m.Save("selfSymlink", &x.selfSymlink) - m.Save("threadSelfSymlink", &x.threadSelfSymlink) - m.Save("cgroupControllers", &x.cgroupControllers) + m.Save(0, &x.InodeNotSymlink) + m.Save(1, &x.InodeDirectoryNoNewChildren) + m.Save(2, &x.InodeAttrs) + m.Save(3, &x.OrderedChildren) + m.Save(4, &x.AlwaysValid) + m.Save(5, &x.locks) + m.Save(6, &x.fs) + m.Save(7, &x.pidns) + m.Save(8, &x.selfSymlink) + m.Save(9, &x.threadSelfSymlink) + m.Save(10, &x.cgroupControllers) } func (x *tasksInode) afterLoad() {} -func (x *tasksInode) load(m state.Map) { - m.Load("InodeNotSymlink", &x.InodeNotSymlink) - m.Load("InodeDirectoryNoNewChildren", &x.InodeDirectoryNoNewChildren) - m.Load("InodeAttrs", &x.InodeAttrs) - m.Load("OrderedChildren", &x.OrderedChildren) - m.Load("AlwaysValid", &x.AlwaysValid) - m.Load("locks", &x.locks) - m.Load("fs", &x.fs) - m.Load("pidns", &x.pidns) - m.Load("selfSymlink", &x.selfSymlink) - m.Load("threadSelfSymlink", &x.threadSelfSymlink) - m.Load("cgroupControllers", &x.cgroupControllers) + +func (x *tasksInode) StateLoad(m state.Source) { + m.Load(0, &x.InodeNotSymlink) + m.Load(1, &x.InodeDirectoryNoNewChildren) + m.Load(2, &x.InodeAttrs) + m.Load(3, &x.OrderedChildren) + m.Load(4, &x.AlwaysValid) + m.Load(5, &x.locks) + m.Load(6, &x.fs) + m.Load(7, &x.pidns) + m.Load(8, &x.selfSymlink) + m.Load(9, &x.threadSelfSymlink) + m.Load(10, &x.cgroupControllers) +} + +func (x *statData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.statData" +} + +func (x *statData) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + } } func (x *statData) beforeSave() {} -func (x *statData) save(m state.Map) { + +func (x *statData) StateSave(m state.Sink) { x.beforeSave() - m.Save("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + m.Save(0, &x.dynamicBytesFileSetAttr) } func (x *statData) afterLoad() {} -func (x *statData) load(m state.Map) { - m.Load("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + +func (x *statData) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) +} + +func (x *loadavgData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.loadavgData" +} + +func (x *loadavgData) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + } } func (x *loadavgData) beforeSave() {} -func (x *loadavgData) save(m state.Map) { + +func (x *loadavgData) StateSave(m state.Sink) { x.beforeSave() - m.Save("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + m.Save(0, &x.dynamicBytesFileSetAttr) } func (x *loadavgData) afterLoad() {} -func (x *loadavgData) load(m state.Map) { - m.Load("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + +func (x *loadavgData) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) +} + +func (x *meminfoData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.meminfoData" +} + +func (x *meminfoData) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + } } func (x *meminfoData) beforeSave() {} -func (x *meminfoData) save(m state.Map) { + +func (x *meminfoData) StateSave(m state.Sink) { x.beforeSave() - m.Save("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + m.Save(0, &x.dynamicBytesFileSetAttr) } func (x *meminfoData) afterLoad() {} -func (x *meminfoData) load(m state.Map) { - m.Load("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + +func (x *meminfoData) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) +} + +func (x *uptimeData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.uptimeData" +} + +func (x *uptimeData) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + } } func (x *uptimeData) beforeSave() {} -func (x *uptimeData) save(m state.Map) { + +func (x *uptimeData) StateSave(m state.Sink) { x.beforeSave() - m.Save("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + m.Save(0, &x.dynamicBytesFileSetAttr) } func (x *uptimeData) afterLoad() {} -func (x *uptimeData) load(m state.Map) { - m.Load("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + +func (x *uptimeData) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) +} + +func (x *versionData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.versionData" +} + +func (x *versionData) StateFields() []string { + return []string{ + "dynamicBytesFileSetAttr", + } } func (x *versionData) beforeSave() {} -func (x *versionData) save(m state.Map) { + +func (x *versionData) StateSave(m state.Sink) { x.beforeSave() - m.Save("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + m.Save(0, &x.dynamicBytesFileSetAttr) } func (x *versionData) afterLoad() {} -func (x *versionData) load(m state.Map) { - m.Load("dynamicBytesFileSetAttr", &x.dynamicBytesFileSetAttr) + +func (x *versionData) StateLoad(m state.Source) { + m.Load(0, &x.dynamicBytesFileSetAttr) +} + +func (x *filesystemsData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.filesystemsData" +} + +func (x *filesystemsData) StateFields() []string { + return []string{ + "DynamicBytesFile", + } } func (x *filesystemsData) beforeSave() {} -func (x *filesystemsData) save(m state.Map) { + +func (x *filesystemsData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) + m.Save(0, &x.DynamicBytesFile) } func (x *filesystemsData) afterLoad() {} -func (x *filesystemsData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) + +func (x *filesystemsData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) +} + +func (x *mmapMinAddrData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.mmapMinAddrData" +} + +func (x *mmapMinAddrData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "k", + } } func (x *mmapMinAddrData) beforeSave() {} -func (x *mmapMinAddrData) save(m state.Map) { + +func (x *mmapMinAddrData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("k", &x.k) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.k) } func (x *mmapMinAddrData) afterLoad() {} -func (x *mmapMinAddrData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.Load("k", &x.k) + +func (x *mmapMinAddrData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.Load(1, &x.k) +} + +func (x *hostnameData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.hostnameData" +} + +func (x *hostnameData) StateFields() []string { + return []string{ + "DynamicBytesFile", + } } func (x *hostnameData) beforeSave() {} -func (x *hostnameData) save(m state.Map) { + +func (x *hostnameData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) + m.Save(0, &x.DynamicBytesFile) } func (x *hostnameData) afterLoad() {} -func (x *hostnameData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) + +func (x *hostnameData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) +} + +func (x *tcpSackData) StateTypeName() string { + return "pkg/sentry/fsimpl/proc.tcpSackData" +} + +func (x *tcpSackData) StateFields() []string { + return []string{ + "DynamicBytesFile", + "stack", + "enabled", + } } func (x *tcpSackData) beforeSave() {} -func (x *tcpSackData) save(m state.Map) { + +func (x *tcpSackData) StateSave(m state.Sink) { x.beforeSave() - m.Save("DynamicBytesFile", &x.DynamicBytesFile) - m.Save("stack", &x.stack) - m.Save("enabled", &x.enabled) + m.Save(0, &x.DynamicBytesFile) + m.Save(1, &x.stack) + m.Save(2, &x.enabled) } func (x *tcpSackData) afterLoad() {} -func (x *tcpSackData) load(m state.Map) { - m.Load("DynamicBytesFile", &x.DynamicBytesFile) - m.LoadWait("stack", &x.stack) - m.Load("enabled", &x.enabled) + +func (x *tcpSackData) StateLoad(m state.Source) { + m.Load(0, &x.DynamicBytesFile) + m.LoadWait(1, &x.stack) + m.Load(2, &x.enabled) } func init() { - state.Register("pkg/sentry/fsimpl/proc.FilesystemType", (*FilesystemType)(nil), state.Fns{Save: (*FilesystemType).save, Load: (*FilesystemType).load}) - state.Register("pkg/sentry/fsimpl/proc.subtasksInode", (*subtasksInode)(nil), state.Fns{Save: (*subtasksInode).save, Load: (*subtasksInode).load}) - state.Register("pkg/sentry/fsimpl/proc.taskInode", (*taskInode)(nil), state.Fns{Save: (*taskInode).save, Load: (*taskInode).load}) - state.Register("pkg/sentry/fsimpl/proc.fdDirInode", (*fdDirInode)(nil), state.Fns{Save: (*fdDirInode).save, Load: (*fdDirInode).load}) - state.Register("pkg/sentry/fsimpl/proc.fdSymlink", (*fdSymlink)(nil), state.Fns{Save: (*fdSymlink).save, Load: (*fdSymlink).load}) - state.Register("pkg/sentry/fsimpl/proc.fdInfoDirInode", (*fdInfoDirInode)(nil), state.Fns{Save: (*fdInfoDirInode).save, Load: (*fdInfoDirInode).load}) - state.Register("pkg/sentry/fsimpl/proc.fdInfoData", (*fdInfoData)(nil), state.Fns{Save: (*fdInfoData).save, Load: (*fdInfoData).load}) - state.Register("pkg/sentry/fsimpl/proc.auxvData", (*auxvData)(nil), state.Fns{Save: (*auxvData).save, Load: (*auxvData).load}) - state.Register("pkg/sentry/fsimpl/proc.cmdlineData", (*cmdlineData)(nil), state.Fns{Save: (*cmdlineData).save, Load: (*cmdlineData).load}) - state.Register("pkg/sentry/fsimpl/proc.commInode", (*commInode)(nil), state.Fns{Save: (*commInode).save, Load: (*commInode).load}) - state.Register("pkg/sentry/fsimpl/proc.commData", (*commData)(nil), state.Fns{Save: (*commData).save, Load: (*commData).load}) - state.Register("pkg/sentry/fsimpl/proc.idMapData", (*idMapData)(nil), state.Fns{Save: (*idMapData).save, Load: (*idMapData).load}) - state.Register("pkg/sentry/fsimpl/proc.mapsData", (*mapsData)(nil), state.Fns{Save: (*mapsData).save, Load: (*mapsData).load}) - state.Register("pkg/sentry/fsimpl/proc.smapsData", (*smapsData)(nil), state.Fns{Save: (*smapsData).save, Load: (*smapsData).load}) - state.Register("pkg/sentry/fsimpl/proc.taskStatData", (*taskStatData)(nil), state.Fns{Save: (*taskStatData).save, Load: (*taskStatData).load}) - state.Register("pkg/sentry/fsimpl/proc.statmData", (*statmData)(nil), state.Fns{Save: (*statmData).save, Load: (*statmData).load}) - state.Register("pkg/sentry/fsimpl/proc.statusData", (*statusData)(nil), state.Fns{Save: (*statusData).save, Load: (*statusData).load}) - state.Register("pkg/sentry/fsimpl/proc.ioData", (*ioData)(nil), state.Fns{Save: (*ioData).save, Load: (*ioData).load}) - state.Register("pkg/sentry/fsimpl/proc.oomScoreAdj", (*oomScoreAdj)(nil), state.Fns{Save: (*oomScoreAdj).save, Load: (*oomScoreAdj).load}) - state.Register("pkg/sentry/fsimpl/proc.exeSymlink", (*exeSymlink)(nil), state.Fns{Save: (*exeSymlink).save, Load: (*exeSymlink).load}) - state.Register("pkg/sentry/fsimpl/proc.mountInfoData", (*mountInfoData)(nil), state.Fns{Save: (*mountInfoData).save, Load: (*mountInfoData).load}) - state.Register("pkg/sentry/fsimpl/proc.mountsData", (*mountsData)(nil), state.Fns{Save: (*mountsData).save, Load: (*mountsData).load}) - state.Register("pkg/sentry/fsimpl/proc.ifinet6", (*ifinet6)(nil), state.Fns{Save: (*ifinet6).save, Load: (*ifinet6).load}) - state.Register("pkg/sentry/fsimpl/proc.netDevData", (*netDevData)(nil), state.Fns{Save: (*netDevData).save, Load: (*netDevData).load}) - state.Register("pkg/sentry/fsimpl/proc.netUnixData", (*netUnixData)(nil), state.Fns{Save: (*netUnixData).save, Load: (*netUnixData).load}) - state.Register("pkg/sentry/fsimpl/proc.netTCPData", (*netTCPData)(nil), state.Fns{Save: (*netTCPData).save, Load: (*netTCPData).load}) - state.Register("pkg/sentry/fsimpl/proc.netTCP6Data", (*netTCP6Data)(nil), state.Fns{Save: (*netTCP6Data).save, Load: (*netTCP6Data).load}) - state.Register("pkg/sentry/fsimpl/proc.netUDPData", (*netUDPData)(nil), state.Fns{Save: (*netUDPData).save, Load: (*netUDPData).load}) - state.Register("pkg/sentry/fsimpl/proc.netSnmpData", (*netSnmpData)(nil), state.Fns{Save: (*netSnmpData).save, Load: (*netSnmpData).load}) - state.Register("pkg/sentry/fsimpl/proc.netRouteData", (*netRouteData)(nil), state.Fns{Save: (*netRouteData).save, Load: (*netRouteData).load}) - state.Register("pkg/sentry/fsimpl/proc.netStatData", (*netStatData)(nil), state.Fns{Save: (*netStatData).save, Load: (*netStatData).load}) - state.Register("pkg/sentry/fsimpl/proc.tasksInode", (*tasksInode)(nil), state.Fns{Save: (*tasksInode).save, Load: (*tasksInode).load}) - state.Register("pkg/sentry/fsimpl/proc.statData", (*statData)(nil), state.Fns{Save: (*statData).save, Load: (*statData).load}) - state.Register("pkg/sentry/fsimpl/proc.loadavgData", (*loadavgData)(nil), state.Fns{Save: (*loadavgData).save, Load: (*loadavgData).load}) - state.Register("pkg/sentry/fsimpl/proc.meminfoData", (*meminfoData)(nil), state.Fns{Save: (*meminfoData).save, Load: (*meminfoData).load}) - state.Register("pkg/sentry/fsimpl/proc.uptimeData", (*uptimeData)(nil), state.Fns{Save: (*uptimeData).save, Load: (*uptimeData).load}) - state.Register("pkg/sentry/fsimpl/proc.versionData", (*versionData)(nil), state.Fns{Save: (*versionData).save, Load: (*versionData).load}) - state.Register("pkg/sentry/fsimpl/proc.filesystemsData", (*filesystemsData)(nil), state.Fns{Save: (*filesystemsData).save, Load: (*filesystemsData).load}) - state.Register("pkg/sentry/fsimpl/proc.mmapMinAddrData", (*mmapMinAddrData)(nil), state.Fns{Save: (*mmapMinAddrData).save, Load: (*mmapMinAddrData).load}) - state.Register("pkg/sentry/fsimpl/proc.hostnameData", (*hostnameData)(nil), state.Fns{Save: (*hostnameData).save, Load: (*hostnameData).load}) - state.Register("pkg/sentry/fsimpl/proc.tcpSackData", (*tcpSackData)(nil), state.Fns{Save: (*tcpSackData).save, Load: (*tcpSackData).load}) + state.Register((*FilesystemType)(nil)) + state.Register((*subtasksInode)(nil)) + state.Register((*taskInode)(nil)) + state.Register((*fdDirInode)(nil)) + state.Register((*fdSymlink)(nil)) + state.Register((*fdInfoDirInode)(nil)) + state.Register((*fdInfoData)(nil)) + state.Register((*auxvData)(nil)) + state.Register((*cmdlineData)(nil)) + state.Register((*commInode)(nil)) + state.Register((*commData)(nil)) + state.Register((*idMapData)(nil)) + state.Register((*mapsData)(nil)) + state.Register((*smapsData)(nil)) + state.Register((*taskStatData)(nil)) + state.Register((*statmData)(nil)) + state.Register((*statusData)(nil)) + state.Register((*ioData)(nil)) + state.Register((*oomScoreAdj)(nil)) + state.Register((*exeSymlink)(nil)) + state.Register((*mountInfoData)(nil)) + state.Register((*mountsData)(nil)) + state.Register((*ifinet6)(nil)) + state.Register((*netDevData)(nil)) + state.Register((*netUnixData)(nil)) + state.Register((*netTCPData)(nil)) + state.Register((*netTCP6Data)(nil)) + state.Register((*netUDPData)(nil)) + state.Register((*netSnmpData)(nil)) + state.Register((*netRouteData)(nil)) + state.Register((*netStatData)(nil)) + state.Register((*tasksInode)(nil)) + state.Register((*statData)(nil)) + state.Register((*loadavgData)(nil)) + state.Register((*meminfoData)(nil)) + state.Register((*uptimeData)(nil)) + state.Register((*versionData)(nil)) + state.Register((*filesystemsData)(nil)) + state.Register((*mmapMinAddrData)(nil)) + state.Register((*hostnameData)(nil)) + state.Register((*tcpSackData)(nil)) } diff --git a/pkg/sentry/fsimpl/tmpfs/dentry_list.go b/pkg/sentry/fsimpl/tmpfs/dentry_list.go index 9af621dd3..95e3d13d5 100644 --- a/pkg/sentry/fsimpl/tmpfs/dentry_list.go +++ b/pkg/sentry/fsimpl/tmpfs/dentry_list.go @@ -56,7 +56,7 @@ func (l *dentryList) Back() *dentry { // // NOTE: This is an O(n) operation. func (l *dentryList) Len() (count int) { - for e := l.Front(); e != nil; e = e.Next() { + for e := l.Front(); e != nil; e = (dentryElementMapper{}.linkerFor(e)).Next() { count++ } return count @@ -148,13 +148,13 @@ func (l *dentryList) Remove(e *dentry) { if prev != nil { dentryElementMapper{}.linkerFor(prev).SetNext(next) - } else { + } else if l.head == e { l.head = next } if next != nil { dentryElementMapper{}.linkerFor(next).SetPrev(prev) - } else { + } else if l.tail == e { l.tail = prev } diff --git a/pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go b/pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go index 10d8b49a6..1b617bd35 100644 --- a/pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go +++ b/pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go @@ -6,33 +6,59 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *dentryList) StateTypeName() string { + return "pkg/sentry/fsimpl/tmpfs.dentryList" +} + +func (x *dentryList) StateFields() []string { + return []string{ + "head", + "tail", + } +} + func (x *dentryList) beforeSave() {} -func (x *dentryList) save(m state.Map) { + +func (x *dentryList) StateSave(m state.Sink) { x.beforeSave() - m.Save("head", &x.head) - m.Save("tail", &x.tail) + m.Save(0, &x.head) + m.Save(1, &x.tail) } func (x *dentryList) afterLoad() {} -func (x *dentryList) load(m state.Map) { - m.Load("head", &x.head) - m.Load("tail", &x.tail) + +func (x *dentryList) StateLoad(m state.Source) { + m.Load(0, &x.head) + m.Load(1, &x.tail) +} + +func (x *dentryEntry) StateTypeName() string { + return "pkg/sentry/fsimpl/tmpfs.dentryEntry" +} + +func (x *dentryEntry) StateFields() []string { + return []string{ + "next", + "prev", + } } func (x *dentryEntry) beforeSave() {} -func (x *dentryEntry) save(m state.Map) { + +func (x *dentryEntry) StateSave(m state.Sink) { x.beforeSave() - m.Save("next", &x.next) - m.Save("prev", &x.prev) + m.Save(0, &x.next) + m.Save(1, &x.prev) } func (x *dentryEntry) afterLoad() {} -func (x *dentryEntry) load(m state.Map) { - m.Load("next", &x.next) - m.Load("prev", &x.prev) + +func (x *dentryEntry) StateLoad(m state.Source) { + m.Load(0, &x.next) + m.Load(1, &x.prev) } func init() { - state.Register("pkg/sentry/fsimpl/tmpfs.dentryList", (*dentryList)(nil), state.Fns{Save: (*dentryList).save, Load: (*dentryList).load}) - state.Register("pkg/sentry/fsimpl/tmpfs.dentryEntry", (*dentryEntry)(nil), state.Fns{Save: (*dentryEntry).save, Load: (*dentryEntry).load}) + state.Register((*dentryList)(nil)) + state.Register((*dentryEntry)(nil)) } |