github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsutil/fsutil_impl_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package fsutil 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (s *DirtySet) StateTypeName() string { 12 return "pkg/sentry/fsutil.DirtySet" 13 } 14 15 func (s *DirtySet) StateFields() []string { 16 return []string{ 17 "root", 18 } 19 } 20 21 func (s *DirtySet) beforeSave() {} 22 23 // +checklocksignore 24 func (s *DirtySet) StateSave(stateSinkObject state.Sink) { 25 s.beforeSave() 26 var rootValue []DirtyFlatSegment 27 rootValue = s.saveRoot() 28 stateSinkObject.SaveValue(0, rootValue) 29 } 30 31 func (s *DirtySet) afterLoad(context.Context) {} 32 33 // +checklocksignore 34 func (s *DirtySet) StateLoad(ctx context.Context, stateSourceObject state.Source) { 35 stateSourceObject.LoadValue(0, new([]DirtyFlatSegment), func(y any) { s.loadRoot(ctx, y.([]DirtyFlatSegment)) }) 36 } 37 38 func (n *Dirtynode) StateTypeName() string { 39 return "pkg/sentry/fsutil.Dirtynode" 40 } 41 42 func (n *Dirtynode) StateFields() []string { 43 return []string{ 44 "nrSegments", 45 "parent", 46 "parentIndex", 47 "hasChildren", 48 "maxGap", 49 "keys", 50 "values", 51 "children", 52 } 53 } 54 55 func (n *Dirtynode) beforeSave() {} 56 57 // +checklocksignore 58 func (n *Dirtynode) StateSave(stateSinkObject state.Sink) { 59 n.beforeSave() 60 stateSinkObject.Save(0, &n.nrSegments) 61 stateSinkObject.Save(1, &n.parent) 62 stateSinkObject.Save(2, &n.parentIndex) 63 stateSinkObject.Save(3, &n.hasChildren) 64 stateSinkObject.Save(4, &n.maxGap) 65 stateSinkObject.Save(5, &n.keys) 66 stateSinkObject.Save(6, &n.values) 67 stateSinkObject.Save(7, &n.children) 68 } 69 70 func (n *Dirtynode) afterLoad(context.Context) {} 71 72 // +checklocksignore 73 func (n *Dirtynode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 74 stateSourceObject.Load(0, &n.nrSegments) 75 stateSourceObject.Load(1, &n.parent) 76 stateSourceObject.Load(2, &n.parentIndex) 77 stateSourceObject.Load(3, &n.hasChildren) 78 stateSourceObject.Load(4, &n.maxGap) 79 stateSourceObject.Load(5, &n.keys) 80 stateSourceObject.Load(6, &n.values) 81 stateSourceObject.Load(7, &n.children) 82 } 83 84 func (d *DirtyFlatSegment) StateTypeName() string { 85 return "pkg/sentry/fsutil.DirtyFlatSegment" 86 } 87 88 func (d *DirtyFlatSegment) StateFields() []string { 89 return []string{ 90 "Start", 91 "End", 92 "Value", 93 } 94 } 95 96 func (d *DirtyFlatSegment) beforeSave() {} 97 98 // +checklocksignore 99 func (d *DirtyFlatSegment) StateSave(stateSinkObject state.Sink) { 100 d.beforeSave() 101 stateSinkObject.Save(0, &d.Start) 102 stateSinkObject.Save(1, &d.End) 103 stateSinkObject.Save(2, &d.Value) 104 } 105 106 func (d *DirtyFlatSegment) afterLoad(context.Context) {} 107 108 // +checklocksignore 109 func (d *DirtyFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) { 110 stateSourceObject.Load(0, &d.Start) 111 stateSourceObject.Load(1, &d.End) 112 stateSourceObject.Load(2, &d.Value) 113 } 114 115 func (s *FileRangeSet) StateTypeName() string { 116 return "pkg/sentry/fsutil.FileRangeSet" 117 } 118 119 func (s *FileRangeSet) StateFields() []string { 120 return []string{ 121 "root", 122 } 123 } 124 125 func (s *FileRangeSet) beforeSave() {} 126 127 // +checklocksignore 128 func (s *FileRangeSet) StateSave(stateSinkObject state.Sink) { 129 s.beforeSave() 130 var rootValue []FileRangeFlatSegment 131 rootValue = s.saveRoot() 132 stateSinkObject.SaveValue(0, rootValue) 133 } 134 135 func (s *FileRangeSet) afterLoad(context.Context) {} 136 137 // +checklocksignore 138 func (s *FileRangeSet) StateLoad(ctx context.Context, stateSourceObject state.Source) { 139 stateSourceObject.LoadValue(0, new([]FileRangeFlatSegment), func(y any) { s.loadRoot(ctx, y.([]FileRangeFlatSegment)) }) 140 } 141 142 func (n *FileRangenode) StateTypeName() string { 143 return "pkg/sentry/fsutil.FileRangenode" 144 } 145 146 func (n *FileRangenode) StateFields() []string { 147 return []string{ 148 "nrSegments", 149 "parent", 150 "parentIndex", 151 "hasChildren", 152 "maxGap", 153 "keys", 154 "values", 155 "children", 156 } 157 } 158 159 func (n *FileRangenode) beforeSave() {} 160 161 // +checklocksignore 162 func (n *FileRangenode) StateSave(stateSinkObject state.Sink) { 163 n.beforeSave() 164 stateSinkObject.Save(0, &n.nrSegments) 165 stateSinkObject.Save(1, &n.parent) 166 stateSinkObject.Save(2, &n.parentIndex) 167 stateSinkObject.Save(3, &n.hasChildren) 168 stateSinkObject.Save(4, &n.maxGap) 169 stateSinkObject.Save(5, &n.keys) 170 stateSinkObject.Save(6, &n.values) 171 stateSinkObject.Save(7, &n.children) 172 } 173 174 func (n *FileRangenode) afterLoad(context.Context) {} 175 176 // +checklocksignore 177 func (n *FileRangenode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 178 stateSourceObject.Load(0, &n.nrSegments) 179 stateSourceObject.Load(1, &n.parent) 180 stateSourceObject.Load(2, &n.parentIndex) 181 stateSourceObject.Load(3, &n.hasChildren) 182 stateSourceObject.Load(4, &n.maxGap) 183 stateSourceObject.Load(5, &n.keys) 184 stateSourceObject.Load(6, &n.values) 185 stateSourceObject.Load(7, &n.children) 186 } 187 188 func (f *FileRangeFlatSegment) StateTypeName() string { 189 return "pkg/sentry/fsutil.FileRangeFlatSegment" 190 } 191 192 func (f *FileRangeFlatSegment) StateFields() []string { 193 return []string{ 194 "Start", 195 "End", 196 "Value", 197 } 198 } 199 200 func (f *FileRangeFlatSegment) beforeSave() {} 201 202 // +checklocksignore 203 func (f *FileRangeFlatSegment) StateSave(stateSinkObject state.Sink) { 204 f.beforeSave() 205 stateSinkObject.Save(0, &f.Start) 206 stateSinkObject.Save(1, &f.End) 207 stateSinkObject.Save(2, &f.Value) 208 } 209 210 func (f *FileRangeFlatSegment) afterLoad(context.Context) {} 211 212 // +checklocksignore 213 func (f *FileRangeFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) { 214 stateSourceObject.Load(0, &f.Start) 215 stateSourceObject.Load(1, &f.End) 216 stateSourceObject.Load(2, &f.Value) 217 } 218 219 func (s *FrameRefSet) StateTypeName() string { 220 return "pkg/sentry/fsutil.FrameRefSet" 221 } 222 223 func (s *FrameRefSet) StateFields() []string { 224 return []string{ 225 "root", 226 } 227 } 228 229 func (s *FrameRefSet) beforeSave() {} 230 231 // +checklocksignore 232 func (s *FrameRefSet) StateSave(stateSinkObject state.Sink) { 233 s.beforeSave() 234 var rootValue []FrameRefFlatSegment 235 rootValue = s.saveRoot() 236 stateSinkObject.SaveValue(0, rootValue) 237 } 238 239 func (s *FrameRefSet) afterLoad(context.Context) {} 240 241 // +checklocksignore 242 func (s *FrameRefSet) StateLoad(ctx context.Context, stateSourceObject state.Source) { 243 stateSourceObject.LoadValue(0, new([]FrameRefFlatSegment), func(y any) { s.loadRoot(ctx, y.([]FrameRefFlatSegment)) }) 244 } 245 246 func (n *FrameRefnode) StateTypeName() string { 247 return "pkg/sentry/fsutil.FrameRefnode" 248 } 249 250 func (n *FrameRefnode) StateFields() []string { 251 return []string{ 252 "nrSegments", 253 "parent", 254 "parentIndex", 255 "hasChildren", 256 "maxGap", 257 "keys", 258 "values", 259 "children", 260 } 261 } 262 263 func (n *FrameRefnode) beforeSave() {} 264 265 // +checklocksignore 266 func (n *FrameRefnode) StateSave(stateSinkObject state.Sink) { 267 n.beforeSave() 268 stateSinkObject.Save(0, &n.nrSegments) 269 stateSinkObject.Save(1, &n.parent) 270 stateSinkObject.Save(2, &n.parentIndex) 271 stateSinkObject.Save(3, &n.hasChildren) 272 stateSinkObject.Save(4, &n.maxGap) 273 stateSinkObject.Save(5, &n.keys) 274 stateSinkObject.Save(6, &n.values) 275 stateSinkObject.Save(7, &n.children) 276 } 277 278 func (n *FrameRefnode) afterLoad(context.Context) {} 279 280 // +checklocksignore 281 func (n *FrameRefnode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 282 stateSourceObject.Load(0, &n.nrSegments) 283 stateSourceObject.Load(1, &n.parent) 284 stateSourceObject.Load(2, &n.parentIndex) 285 stateSourceObject.Load(3, &n.hasChildren) 286 stateSourceObject.Load(4, &n.maxGap) 287 stateSourceObject.Load(5, &n.keys) 288 stateSourceObject.Load(6, &n.values) 289 stateSourceObject.Load(7, &n.children) 290 } 291 292 func (f *FrameRefFlatSegment) StateTypeName() string { 293 return "pkg/sentry/fsutil.FrameRefFlatSegment" 294 } 295 296 func (f *FrameRefFlatSegment) StateFields() []string { 297 return []string{ 298 "Start", 299 "End", 300 "Value", 301 } 302 } 303 304 func (f *FrameRefFlatSegment) beforeSave() {} 305 306 // +checklocksignore 307 func (f *FrameRefFlatSegment) StateSave(stateSinkObject state.Sink) { 308 f.beforeSave() 309 stateSinkObject.Save(0, &f.Start) 310 stateSinkObject.Save(1, &f.End) 311 stateSinkObject.Save(2, &f.Value) 312 } 313 314 func (f *FrameRefFlatSegment) afterLoad(context.Context) {} 315 316 // +checklocksignore 317 func (f *FrameRefFlatSegment) StateLoad(ctx context.Context, stateSourceObject state.Source) { 318 stateSourceObject.Load(0, &f.Start) 319 stateSourceObject.Load(1, &f.End) 320 stateSourceObject.Load(2, &f.Value) 321 } 322 323 func init() { 324 state.Register((*DirtySet)(nil)) 325 state.Register((*Dirtynode)(nil)) 326 state.Register((*DirtyFlatSegment)(nil)) 327 state.Register((*FileRangeSet)(nil)) 328 state.Register((*FileRangenode)(nil)) 329 state.Register((*FileRangeFlatSegment)(nil)) 330 state.Register((*FrameRefSet)(nil)) 331 state.Register((*FrameRefnode)(nil)) 332 state.Register((*FrameRefFlatSegment)(nil)) 333 }