github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/nsfs/nsfs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package nsfs 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (r *inodeRefs) StateTypeName() string { 12 return "pkg/sentry/fsimpl/nsfs.inodeRefs" 13 } 14 15 func (r *inodeRefs) StateFields() []string { 16 return []string{ 17 "refCount", 18 } 19 } 20 21 func (r *inodeRefs) beforeSave() {} 22 23 // +checklocksignore 24 func (r *inodeRefs) StateSave(stateSinkObject state.Sink) { 25 r.beforeSave() 26 stateSinkObject.Save(0, &r.refCount) 27 } 28 29 // +checklocksignore 30 func (r *inodeRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 31 stateSourceObject.Load(0, &r.refCount) 32 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 33 } 34 35 func (f *filesystemType) StateTypeName() string { 36 return "pkg/sentry/fsimpl/nsfs.filesystemType" 37 } 38 39 func (f *filesystemType) StateFields() []string { 40 return []string{} 41 } 42 43 func (f *filesystemType) beforeSave() {} 44 45 // +checklocksignore 46 func (f *filesystemType) StateSave(stateSinkObject state.Sink) { 47 f.beforeSave() 48 } 49 50 func (f *filesystemType) afterLoad(context.Context) {} 51 52 // +checklocksignore 53 func (f *filesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) { 54 } 55 56 func (fs *filesystem) StateTypeName() string { 57 return "pkg/sentry/fsimpl/nsfs.filesystem" 58 } 59 60 func (fs *filesystem) StateFields() []string { 61 return []string{ 62 "Filesystem", 63 "devMinor", 64 } 65 } 66 67 func (fs *filesystem) beforeSave() {} 68 69 // +checklocksignore 70 func (fs *filesystem) StateSave(stateSinkObject state.Sink) { 71 fs.beforeSave() 72 stateSinkObject.Save(0, &fs.Filesystem) 73 stateSinkObject.Save(1, &fs.devMinor) 74 } 75 76 func (fs *filesystem) afterLoad(context.Context) {} 77 78 // +checklocksignore 79 func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) { 80 stateSourceObject.Load(0, &fs.Filesystem) 81 stateSourceObject.Load(1, &fs.devMinor) 82 } 83 84 func (i *Inode) StateTypeName() string { 85 return "pkg/sentry/fsimpl/nsfs.Inode" 86 } 87 88 func (i *Inode) StateFields() []string { 89 return []string{ 90 "InodeAttrs", 91 "InodeAnonymous", 92 "InodeNotDirectory", 93 "InodeNotSymlink", 94 "InodeWatches", 95 "inodeRefs", 96 "locks", 97 "namespace", 98 "mnt", 99 } 100 } 101 102 func (i *Inode) beforeSave() {} 103 104 // +checklocksignore 105 func (i *Inode) StateSave(stateSinkObject state.Sink) { 106 i.beforeSave() 107 stateSinkObject.Save(0, &i.InodeAttrs) 108 stateSinkObject.Save(1, &i.InodeAnonymous) 109 stateSinkObject.Save(2, &i.InodeNotDirectory) 110 stateSinkObject.Save(3, &i.InodeNotSymlink) 111 stateSinkObject.Save(4, &i.InodeWatches) 112 stateSinkObject.Save(5, &i.inodeRefs) 113 stateSinkObject.Save(6, &i.locks) 114 stateSinkObject.Save(7, &i.namespace) 115 stateSinkObject.Save(8, &i.mnt) 116 } 117 118 func (i *Inode) afterLoad(context.Context) {} 119 120 // +checklocksignore 121 func (i *Inode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 122 stateSourceObject.Load(0, &i.InodeAttrs) 123 stateSourceObject.Load(1, &i.InodeAnonymous) 124 stateSourceObject.Load(2, &i.InodeNotDirectory) 125 stateSourceObject.Load(3, &i.InodeNotSymlink) 126 stateSourceObject.Load(4, &i.InodeWatches) 127 stateSourceObject.Load(5, &i.inodeRefs) 128 stateSourceObject.Load(6, &i.locks) 129 stateSourceObject.Load(7, &i.namespace) 130 stateSourceObject.Load(8, &i.mnt) 131 } 132 133 func (fd *namespaceFD) StateTypeName() string { 134 return "pkg/sentry/fsimpl/nsfs.namespaceFD" 135 } 136 137 func (fd *namespaceFD) StateFields() []string { 138 return []string{ 139 "FileDescriptionDefaultImpl", 140 "LockFD", 141 "vfsfd", 142 "inode", 143 } 144 } 145 146 func (fd *namespaceFD) beforeSave() {} 147 148 // +checklocksignore 149 func (fd *namespaceFD) StateSave(stateSinkObject state.Sink) { 150 fd.beforeSave() 151 stateSinkObject.Save(0, &fd.FileDescriptionDefaultImpl) 152 stateSinkObject.Save(1, &fd.LockFD) 153 stateSinkObject.Save(2, &fd.vfsfd) 154 stateSinkObject.Save(3, &fd.inode) 155 } 156 157 func (fd *namespaceFD) afterLoad(context.Context) {} 158 159 // +checklocksignore 160 func (fd *namespaceFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 161 stateSourceObject.Load(0, &fd.FileDescriptionDefaultImpl) 162 stateSourceObject.Load(1, &fd.LockFD) 163 stateSourceObject.Load(2, &fd.vfsfd) 164 stateSourceObject.Load(3, &fd.inode) 165 } 166 167 func init() { 168 state.Register((*inodeRefs)(nil)) 169 state.Register((*filesystemType)(nil)) 170 state.Register((*filesystem)(nil)) 171 state.Register((*Inode)(nil)) 172 state.Register((*namespaceFD)(nil)) 173 }