github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/mqfs/mqfs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package mqfs 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (ft *FilesystemType) StateTypeName() string { 12 return "pkg/sentry/fsimpl/mqfs.FilesystemType" 13 } 14 15 func (ft *FilesystemType) StateFields() []string { 16 return []string{} 17 } 18 19 func (ft *FilesystemType) beforeSave() {} 20 21 // +checklocksignore 22 func (ft *FilesystemType) StateSave(stateSinkObject state.Sink) { 23 ft.beforeSave() 24 } 25 26 func (ft *FilesystemType) afterLoad(context.Context) {} 27 28 // +checklocksignore 29 func (ft *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) { 30 } 31 32 func (fs *filesystem) StateTypeName() string { 33 return "pkg/sentry/fsimpl/mqfs.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 (q *queueInode) StateTypeName() string { 61 return "pkg/sentry/fsimpl/mqfs.queueInode" 62 } 63 64 func (q *queueInode) StateFields() []string { 65 return []string{ 66 "DynamicBytesFile", 67 "queue", 68 } 69 } 70 71 func (q *queueInode) beforeSave() {} 72 73 // +checklocksignore 74 func (q *queueInode) StateSave(stateSinkObject state.Sink) { 75 q.beforeSave() 76 stateSinkObject.Save(0, &q.DynamicBytesFile) 77 stateSinkObject.Save(1, &q.queue) 78 } 79 80 func (q *queueInode) afterLoad(context.Context) {} 81 82 // +checklocksignore 83 func (q *queueInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 84 stateSourceObject.Load(0, &q.DynamicBytesFile) 85 stateSourceObject.Load(1, &q.queue) 86 } 87 88 func (fd *queueFD) StateTypeName() string { 89 return "pkg/sentry/fsimpl/mqfs.queueFD" 90 } 91 92 func (fd *queueFD) StateFields() []string { 93 return []string{ 94 "FileDescriptionDefaultImpl", 95 "DynamicBytesFileDescriptionImpl", 96 "LockFD", 97 "vfsfd", 98 "inode", 99 "queue", 100 } 101 } 102 103 func (fd *queueFD) beforeSave() {} 104 105 // +checklocksignore 106 func (fd *queueFD) StateSave(stateSinkObject state.Sink) { 107 fd.beforeSave() 108 stateSinkObject.Save(0, &fd.FileDescriptionDefaultImpl) 109 stateSinkObject.Save(1, &fd.DynamicBytesFileDescriptionImpl) 110 stateSinkObject.Save(2, &fd.LockFD) 111 stateSinkObject.Save(3, &fd.vfsfd) 112 stateSinkObject.Save(4, &fd.inode) 113 stateSinkObject.Save(5, &fd.queue) 114 } 115 116 func (fd *queueFD) afterLoad(context.Context) {} 117 118 // +checklocksignore 119 func (fd *queueFD) StateLoad(ctx context.Context, stateSourceObject state.Source) { 120 stateSourceObject.Load(0, &fd.FileDescriptionDefaultImpl) 121 stateSourceObject.Load(1, &fd.DynamicBytesFileDescriptionImpl) 122 stateSourceObject.Load(2, &fd.LockFD) 123 stateSourceObject.Load(3, &fd.vfsfd) 124 stateSourceObject.Load(4, &fd.inode) 125 stateSourceObject.Load(5, &fd.queue) 126 } 127 128 func (r *RegistryImpl) StateTypeName() string { 129 return "pkg/sentry/fsimpl/mqfs.RegistryImpl" 130 } 131 132 func (r *RegistryImpl) StateFields() []string { 133 return []string{ 134 "root", 135 "fs", 136 "mount", 137 } 138 } 139 140 func (r *RegistryImpl) beforeSave() {} 141 142 // +checklocksignore 143 func (r *RegistryImpl) StateSave(stateSinkObject state.Sink) { 144 r.beforeSave() 145 stateSinkObject.Save(0, &r.root) 146 stateSinkObject.Save(1, &r.fs) 147 stateSinkObject.Save(2, &r.mount) 148 } 149 150 func (r *RegistryImpl) afterLoad(context.Context) {} 151 152 // +checklocksignore 153 func (r *RegistryImpl) StateLoad(ctx context.Context, stateSourceObject state.Source) { 154 stateSourceObject.Load(0, &r.root) 155 stateSourceObject.Load(1, &r.fs) 156 stateSourceObject.Load(2, &r.mount) 157 } 158 159 func (i *rootInode) StateTypeName() string { 160 return "pkg/sentry/fsimpl/mqfs.rootInode" 161 } 162 163 func (i *rootInode) StateFields() []string { 164 return []string{ 165 "rootInodeRefs", 166 "InodeAlwaysValid", 167 "InodeAnonymous", 168 "InodeAttrs", 169 "InodeDirectoryNoNewChildren", 170 "InodeNotSymlink", 171 "InodeTemporary", 172 "InodeWatches", 173 "OrderedChildren", 174 "locks", 175 } 176 } 177 178 func (i *rootInode) beforeSave() {} 179 180 // +checklocksignore 181 func (i *rootInode) StateSave(stateSinkObject state.Sink) { 182 i.beforeSave() 183 stateSinkObject.Save(0, &i.rootInodeRefs) 184 stateSinkObject.Save(1, &i.InodeAlwaysValid) 185 stateSinkObject.Save(2, &i.InodeAnonymous) 186 stateSinkObject.Save(3, &i.InodeAttrs) 187 stateSinkObject.Save(4, &i.InodeDirectoryNoNewChildren) 188 stateSinkObject.Save(5, &i.InodeNotSymlink) 189 stateSinkObject.Save(6, &i.InodeTemporary) 190 stateSinkObject.Save(7, &i.InodeWatches) 191 stateSinkObject.Save(8, &i.OrderedChildren) 192 stateSinkObject.Save(9, &i.locks) 193 } 194 195 func (i *rootInode) afterLoad(context.Context) {} 196 197 // +checklocksignore 198 func (i *rootInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 199 stateSourceObject.Load(0, &i.rootInodeRefs) 200 stateSourceObject.Load(1, &i.InodeAlwaysValid) 201 stateSourceObject.Load(2, &i.InodeAnonymous) 202 stateSourceObject.Load(3, &i.InodeAttrs) 203 stateSourceObject.Load(4, &i.InodeDirectoryNoNewChildren) 204 stateSourceObject.Load(5, &i.InodeNotSymlink) 205 stateSourceObject.Load(6, &i.InodeTemporary) 206 stateSourceObject.Load(7, &i.InodeWatches) 207 stateSourceObject.Load(8, &i.OrderedChildren) 208 stateSourceObject.Load(9, &i.locks) 209 } 210 211 func (r *rootInodeRefs) StateTypeName() string { 212 return "pkg/sentry/fsimpl/mqfs.rootInodeRefs" 213 } 214 215 func (r *rootInodeRefs) StateFields() []string { 216 return []string{ 217 "refCount", 218 } 219 } 220 221 func (r *rootInodeRefs) beforeSave() {} 222 223 // +checklocksignore 224 func (r *rootInodeRefs) StateSave(stateSinkObject state.Sink) { 225 r.beforeSave() 226 stateSinkObject.Save(0, &r.refCount) 227 } 228 229 // +checklocksignore 230 func (r *rootInodeRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 231 stateSourceObject.Load(0, &r.refCount) 232 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 233 } 234 235 func init() { 236 state.Register((*FilesystemType)(nil)) 237 state.Register((*filesystem)(nil)) 238 state.Register((*queueInode)(nil)) 239 state.Register((*queueFD)(nil)) 240 state.Register((*RegistryImpl)(nil)) 241 state.Register((*rootInode)(nil)) 242 state.Register((*rootInodeRefs)(nil)) 243 }