github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/sockfs/sockfs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package sockfs 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (fsType *filesystemType) StateTypeName() string { 12 return "pkg/sentry/fsimpl/sockfs.filesystemType" 13 } 14 15 func (fsType *filesystemType) StateFields() []string { 16 return []string{} 17 } 18 19 func (fsType *filesystemType) beforeSave() {} 20 21 // +checklocksignore 22 func (fsType *filesystemType) StateSave(stateSinkObject state.Sink) { 23 fsType.beforeSave() 24 } 25 26 func (fsType *filesystemType) afterLoad(context.Context) {} 27 28 // +checklocksignore 29 func (fsType *filesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) { 30 } 31 32 func (fs *filesystem) StateTypeName() string { 33 return "pkg/sentry/fsimpl/sockfs.filesystem" 34 } 35 36 func (fs *filesystem) StateFields() []string { 37 return []string{ 38 "Filesystem", 39 "devMinor", 40 } 41 } 42 43 func (fs *filesystem) beforeSave() {} 44 45 // +checklocksignore 46 func (fs *filesystem) StateSave(stateSinkObject state.Sink) { 47 fs.beforeSave() 48 stateSinkObject.Save(0, &fs.Filesystem) 49 stateSinkObject.Save(1, &fs.devMinor) 50 } 51 52 func (fs *filesystem) afterLoad(context.Context) {} 53 54 // +checklocksignore 55 func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) { 56 stateSourceObject.Load(0, &fs.Filesystem) 57 stateSourceObject.Load(1, &fs.devMinor) 58 } 59 60 func (i *inode) StateTypeName() string { 61 return "pkg/sentry/fsimpl/sockfs.inode" 62 } 63 64 func (i *inode) StateFields() []string { 65 return []string{ 66 "InodeAnonymous", 67 "InodeAttrs", 68 "InodeNoopRefCount", 69 "InodeNotDirectory", 70 "InodeNotSymlink", 71 "InodeWatches", 72 } 73 } 74 75 func (i *inode) beforeSave() {} 76 77 // +checklocksignore 78 func (i *inode) StateSave(stateSinkObject state.Sink) { 79 i.beforeSave() 80 stateSinkObject.Save(0, &i.InodeAnonymous) 81 stateSinkObject.Save(1, &i.InodeAttrs) 82 stateSinkObject.Save(2, &i.InodeNoopRefCount) 83 stateSinkObject.Save(3, &i.InodeNotDirectory) 84 stateSinkObject.Save(4, &i.InodeNotSymlink) 85 stateSinkObject.Save(5, &i.InodeWatches) 86 } 87 88 func (i *inode) afterLoad(context.Context) {} 89 90 // +checklocksignore 91 func (i *inode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 92 stateSourceObject.Load(0, &i.InodeAnonymous) 93 stateSourceObject.Load(1, &i.InodeAttrs) 94 stateSourceObject.Load(2, &i.InodeNoopRefCount) 95 stateSourceObject.Load(3, &i.InodeNotDirectory) 96 stateSourceObject.Load(4, &i.InodeNotSymlink) 97 stateSourceObject.Load(5, &i.InodeWatches) 98 } 99 100 func init() { 101 state.Register((*filesystemType)(nil)) 102 state.Register((*filesystem)(nil)) 103 state.Register((*inode)(nil)) 104 }