github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/cgroupfs/cgroupfs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package cgroupfs 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (c *controllerCommon) StateTypeName() string { 12 return "pkg/sentry/fsimpl/cgroupfs.controllerCommon" 13 } 14 15 func (c *controllerCommon) StateFields() []string { 16 return []string{ 17 "ty", 18 "fs", 19 "parent", 20 } 21 } 22 23 func (c *controllerCommon) beforeSave() {} 24 25 // +checklocksignore 26 func (c *controllerCommon) StateSave(stateSinkObject state.Sink) { 27 c.beforeSave() 28 stateSinkObject.Save(0, &c.ty) 29 stateSinkObject.Save(1, &c.fs) 30 stateSinkObject.Save(2, &c.parent) 31 } 32 33 func (c *controllerCommon) afterLoad(context.Context) {} 34 35 // +checklocksignore 36 func (c *controllerCommon) StateLoad(ctx context.Context, stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &c.ty) 38 stateSourceObject.Load(1, &c.fs) 39 stateSourceObject.Load(2, &c.parent) 40 } 41 42 func (c *cgroupInode) StateTypeName() string { 43 return "pkg/sentry/fsimpl/cgroupfs.cgroupInode" 44 } 45 46 func (c *cgroupInode) StateFields() []string { 47 return []string{ 48 "dir", 49 "id", 50 "controllers", 51 "ts", 52 } 53 } 54 55 func (c *cgroupInode) beforeSave() {} 56 57 // +checklocksignore 58 func (c *cgroupInode) StateSave(stateSinkObject state.Sink) { 59 c.beforeSave() 60 stateSinkObject.Save(0, &c.dir) 61 stateSinkObject.Save(1, &c.id) 62 stateSinkObject.Save(2, &c.controllers) 63 stateSinkObject.Save(3, &c.ts) 64 } 65 66 func (c *cgroupInode) afterLoad(context.Context) {} 67 68 // +checklocksignore 69 func (c *cgroupInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 70 stateSourceObject.Load(0, &c.dir) 71 stateSourceObject.Load(1, &c.id) 72 stateSourceObject.Load(2, &c.controllers) 73 stateSourceObject.Load(3, &c.ts) 74 } 75 76 func (d *cgroupProcsData) StateTypeName() string { 77 return "pkg/sentry/fsimpl/cgroupfs.cgroupProcsData" 78 } 79 80 func (d *cgroupProcsData) StateFields() []string { 81 return []string{ 82 "cgroupInode", 83 } 84 } 85 86 func (d *cgroupProcsData) beforeSave() {} 87 88 // +checklocksignore 89 func (d *cgroupProcsData) StateSave(stateSinkObject state.Sink) { 90 d.beforeSave() 91 stateSinkObject.Save(0, &d.cgroupInode) 92 } 93 94 func (d *cgroupProcsData) afterLoad(context.Context) {} 95 96 // +checklocksignore 97 func (d *cgroupProcsData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 98 stateSourceObject.Load(0, &d.cgroupInode) 99 } 100 101 func (d *tasksData) StateTypeName() string { 102 return "pkg/sentry/fsimpl/cgroupfs.tasksData" 103 } 104 105 func (d *tasksData) StateFields() []string { 106 return []string{ 107 "cgroupInode", 108 } 109 } 110 111 func (d *tasksData) beforeSave() {} 112 113 // +checklocksignore 114 func (d *tasksData) StateSave(stateSinkObject state.Sink) { 115 d.beforeSave() 116 stateSinkObject.Save(0, &d.cgroupInode) 117 } 118 119 func (d *tasksData) afterLoad(context.Context) {} 120 121 // +checklocksignore 122 func (d *tasksData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 123 stateSourceObject.Load(0, &d.cgroupInode) 124 } 125 126 func (fsType *FilesystemType) StateTypeName() string { 127 return "pkg/sentry/fsimpl/cgroupfs.FilesystemType" 128 } 129 130 func (fsType *FilesystemType) StateFields() []string { 131 return []string{} 132 } 133 134 func (fsType *FilesystemType) beforeSave() {} 135 136 // +checklocksignore 137 func (fsType *FilesystemType) StateSave(stateSinkObject state.Sink) { 138 fsType.beforeSave() 139 } 140 141 func (fsType *FilesystemType) afterLoad(context.Context) {} 142 143 // +checklocksignore 144 func (fsType *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) { 145 } 146 147 func (i *InitialCgroup) StateTypeName() string { 148 return "pkg/sentry/fsimpl/cgroupfs.InitialCgroup" 149 } 150 151 func (i *InitialCgroup) StateFields() []string { 152 return []string{ 153 "Path", 154 "SetOwner", 155 "UID", 156 "GID", 157 "SetMode", 158 "Mode", 159 } 160 } 161 162 func (i *InitialCgroup) beforeSave() {} 163 164 // +checklocksignore 165 func (i *InitialCgroup) StateSave(stateSinkObject state.Sink) { 166 i.beforeSave() 167 stateSinkObject.Save(0, &i.Path) 168 stateSinkObject.Save(1, &i.SetOwner) 169 stateSinkObject.Save(2, &i.UID) 170 stateSinkObject.Save(3, &i.GID) 171 stateSinkObject.Save(4, &i.SetMode) 172 stateSinkObject.Save(5, &i.Mode) 173 } 174 175 func (i *InitialCgroup) afterLoad(context.Context) {} 176 177 // +checklocksignore 178 func (i *InitialCgroup) StateLoad(ctx context.Context, stateSourceObject state.Source) { 179 stateSourceObject.Load(0, &i.Path) 180 stateSourceObject.Load(1, &i.SetOwner) 181 stateSourceObject.Load(2, &i.UID) 182 stateSourceObject.Load(3, &i.GID) 183 stateSourceObject.Load(4, &i.SetMode) 184 stateSourceObject.Load(5, &i.Mode) 185 } 186 187 func (i *InternalData) StateTypeName() string { 188 return "pkg/sentry/fsimpl/cgroupfs.InternalData" 189 } 190 191 func (i *InternalData) StateFields() []string { 192 return []string{ 193 "DefaultControlValues", 194 "InitialCgroup", 195 } 196 } 197 198 func (i *InternalData) beforeSave() {} 199 200 // +checklocksignore 201 func (i *InternalData) StateSave(stateSinkObject state.Sink) { 202 i.beforeSave() 203 stateSinkObject.Save(0, &i.DefaultControlValues) 204 stateSinkObject.Save(1, &i.InitialCgroup) 205 } 206 207 func (i *InternalData) afterLoad(context.Context) {} 208 209 // +checklocksignore 210 func (i *InternalData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 211 stateSourceObject.Load(0, &i.DefaultControlValues) 212 stateSourceObject.Load(1, &i.InitialCgroup) 213 } 214 215 func (fs *filesystem) StateTypeName() string { 216 return "pkg/sentry/fsimpl/cgroupfs.filesystem" 217 } 218 219 func (fs *filesystem) StateFields() []string { 220 return []string{ 221 "Filesystem", 222 "devMinor", 223 "hierarchyID", 224 "hierarchyName", 225 "controllers", 226 "kcontrollers", 227 "numCgroups", 228 "root", 229 "effectiveRoot", 230 } 231 } 232 233 func (fs *filesystem) beforeSave() {} 234 235 // +checklocksignore 236 func (fs *filesystem) StateSave(stateSinkObject state.Sink) { 237 fs.beforeSave() 238 stateSinkObject.Save(0, &fs.Filesystem) 239 stateSinkObject.Save(1, &fs.devMinor) 240 stateSinkObject.Save(2, &fs.hierarchyID) 241 stateSinkObject.Save(3, &fs.hierarchyName) 242 stateSinkObject.Save(4, &fs.controllers) 243 stateSinkObject.Save(5, &fs.kcontrollers) 244 stateSinkObject.Save(6, &fs.numCgroups) 245 stateSinkObject.Save(7, &fs.root) 246 stateSinkObject.Save(8, &fs.effectiveRoot) 247 } 248 249 func (fs *filesystem) afterLoad(context.Context) {} 250 251 // +checklocksignore 252 func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) { 253 stateSourceObject.Load(0, &fs.Filesystem) 254 stateSourceObject.Load(1, &fs.devMinor) 255 stateSourceObject.Load(2, &fs.hierarchyID) 256 stateSourceObject.Load(3, &fs.hierarchyName) 257 stateSourceObject.Load(4, &fs.controllers) 258 stateSourceObject.Load(5, &fs.kcontrollers) 259 stateSourceObject.Load(6, &fs.numCgroups) 260 stateSourceObject.Load(7, &fs.root) 261 stateSourceObject.Load(8, &fs.effectiveRoot) 262 } 263 264 func (i *implStatFS) StateTypeName() string { 265 return "pkg/sentry/fsimpl/cgroupfs.implStatFS" 266 } 267 268 func (i *implStatFS) StateFields() []string { 269 return []string{} 270 } 271 272 func (i *implStatFS) beforeSave() {} 273 274 // +checklocksignore 275 func (i *implStatFS) StateSave(stateSinkObject state.Sink) { 276 i.beforeSave() 277 } 278 279 func (i *implStatFS) afterLoad(context.Context) {} 280 281 // +checklocksignore 282 func (i *implStatFS) StateLoad(ctx context.Context, stateSourceObject state.Source) { 283 } 284 285 func (d *dir) StateTypeName() string { 286 return "pkg/sentry/fsimpl/cgroupfs.dir" 287 } 288 289 func (d *dir) StateFields() []string { 290 return []string{ 291 "InodeAlwaysValid", 292 "InodeAttrs", 293 "InodeDirectoryNoNewChildren", 294 "InodeNoopRefCount", 295 "InodeNotAnonymous", 296 "InodeNotSymlink", 297 "InodeWatches", 298 "OrderedChildren", 299 "implStatFS", 300 "locks", 301 "fs", 302 "cgi", 303 } 304 } 305 306 func (d *dir) beforeSave() {} 307 308 // +checklocksignore 309 func (d *dir) StateSave(stateSinkObject state.Sink) { 310 d.beforeSave() 311 stateSinkObject.Save(0, &d.InodeAlwaysValid) 312 stateSinkObject.Save(1, &d.InodeAttrs) 313 stateSinkObject.Save(2, &d.InodeDirectoryNoNewChildren) 314 stateSinkObject.Save(3, &d.InodeNoopRefCount) 315 stateSinkObject.Save(4, &d.InodeNotAnonymous) 316 stateSinkObject.Save(5, &d.InodeNotSymlink) 317 stateSinkObject.Save(6, &d.InodeWatches) 318 stateSinkObject.Save(7, &d.OrderedChildren) 319 stateSinkObject.Save(8, &d.implStatFS) 320 stateSinkObject.Save(9, &d.locks) 321 stateSinkObject.Save(10, &d.fs) 322 stateSinkObject.Save(11, &d.cgi) 323 } 324 325 func (d *dir) afterLoad(context.Context) {} 326 327 // +checklocksignore 328 func (d *dir) StateLoad(ctx context.Context, stateSourceObject state.Source) { 329 stateSourceObject.Load(0, &d.InodeAlwaysValid) 330 stateSourceObject.Load(1, &d.InodeAttrs) 331 stateSourceObject.Load(2, &d.InodeDirectoryNoNewChildren) 332 stateSourceObject.Load(3, &d.InodeNoopRefCount) 333 stateSourceObject.Load(4, &d.InodeNotAnonymous) 334 stateSourceObject.Load(5, &d.InodeNotSymlink) 335 stateSourceObject.Load(6, &d.InodeWatches) 336 stateSourceObject.Load(7, &d.OrderedChildren) 337 stateSourceObject.Load(8, &d.implStatFS) 338 stateSourceObject.Load(9, &d.locks) 339 stateSourceObject.Load(10, &d.fs) 340 stateSourceObject.Load(11, &d.cgi) 341 } 342 343 func (f *controllerFile) StateTypeName() string { 344 return "pkg/sentry/fsimpl/cgroupfs.controllerFile" 345 } 346 347 func (f *controllerFile) StateFields() []string { 348 return []string{ 349 "DynamicBytesFile", 350 "implStatFS", 351 "allowBackgroundAccess", 352 } 353 } 354 355 func (f *controllerFile) beforeSave() {} 356 357 // +checklocksignore 358 func (f *controllerFile) StateSave(stateSinkObject state.Sink) { 359 f.beforeSave() 360 stateSinkObject.Save(0, &f.DynamicBytesFile) 361 stateSinkObject.Save(1, &f.implStatFS) 362 stateSinkObject.Save(2, &f.allowBackgroundAccess) 363 } 364 365 func (f *controllerFile) afterLoad(context.Context) {} 366 367 // +checklocksignore 368 func (f *controllerFile) StateLoad(ctx context.Context, stateSourceObject state.Source) { 369 stateSourceObject.Load(0, &f.DynamicBytesFile) 370 stateSourceObject.Load(1, &f.implStatFS) 371 stateSourceObject.Load(2, &f.allowBackgroundAccess) 372 } 373 374 func (f *staticControllerFile) StateTypeName() string { 375 return "pkg/sentry/fsimpl/cgroupfs.staticControllerFile" 376 } 377 378 func (f *staticControllerFile) StateFields() []string { 379 return []string{ 380 "DynamicBytesFile", 381 "StaticData", 382 } 383 } 384 385 func (f *staticControllerFile) beforeSave() {} 386 387 // +checklocksignore 388 func (f *staticControllerFile) StateSave(stateSinkObject state.Sink) { 389 f.beforeSave() 390 stateSinkObject.Save(0, &f.DynamicBytesFile) 391 stateSinkObject.Save(1, &f.StaticData) 392 } 393 394 func (f *staticControllerFile) afterLoad(context.Context) {} 395 396 // +checklocksignore 397 func (f *staticControllerFile) StateLoad(ctx context.Context, stateSourceObject state.Source) { 398 stateSourceObject.Load(0, &f.DynamicBytesFile) 399 stateSourceObject.Load(1, &f.StaticData) 400 } 401 402 func (f *stubControllerFile) StateTypeName() string { 403 return "pkg/sentry/fsimpl/cgroupfs.stubControllerFile" 404 } 405 406 func (f *stubControllerFile) StateFields() []string { 407 return []string{ 408 "controllerFile", 409 "data", 410 } 411 } 412 413 func (f *stubControllerFile) beforeSave() {} 414 415 // +checklocksignore 416 func (f *stubControllerFile) StateSave(stateSinkObject state.Sink) { 417 f.beforeSave() 418 stateSinkObject.Save(0, &f.controllerFile) 419 stateSinkObject.Save(1, &f.data) 420 } 421 422 func (f *stubControllerFile) afterLoad(context.Context) {} 423 424 // +checklocksignore 425 func (f *stubControllerFile) StateLoad(ctx context.Context, stateSourceObject state.Source) { 426 stateSourceObject.Load(0, &f.controllerFile) 427 stateSourceObject.Load(1, &f.data) 428 } 429 430 func (c *cpuController) StateTypeName() string { 431 return "pkg/sentry/fsimpl/cgroupfs.cpuController" 432 } 433 434 func (c *cpuController) StateFields() []string { 435 return []string{ 436 "controllerCommon", 437 "controllerStateless", 438 "controllerNoResource", 439 "cfsPeriod", 440 "cfsQuota", 441 "shares", 442 } 443 } 444 445 func (c *cpuController) beforeSave() {} 446 447 // +checklocksignore 448 func (c *cpuController) StateSave(stateSinkObject state.Sink) { 449 c.beforeSave() 450 stateSinkObject.Save(0, &c.controllerCommon) 451 stateSinkObject.Save(1, &c.controllerStateless) 452 stateSinkObject.Save(2, &c.controllerNoResource) 453 stateSinkObject.Save(3, &c.cfsPeriod) 454 stateSinkObject.Save(4, &c.cfsQuota) 455 stateSinkObject.Save(5, &c.shares) 456 } 457 458 func (c *cpuController) afterLoad(context.Context) {} 459 460 // +checklocksignore 461 func (c *cpuController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 462 stateSourceObject.Load(0, &c.controllerCommon) 463 stateSourceObject.Load(1, &c.controllerStateless) 464 stateSourceObject.Load(2, &c.controllerNoResource) 465 stateSourceObject.Load(3, &c.cfsPeriod) 466 stateSourceObject.Load(4, &c.cfsQuota) 467 stateSourceObject.Load(5, &c.shares) 468 } 469 470 func (c *cpuacctController) StateTypeName() string { 471 return "pkg/sentry/fsimpl/cgroupfs.cpuacctController" 472 } 473 474 func (c *cpuacctController) StateFields() []string { 475 return []string{ 476 "controllerCommon", 477 "controllerNoResource", 478 "taskCommittedCharges", 479 "usage", 480 } 481 } 482 483 func (c *cpuacctController) beforeSave() {} 484 485 // +checklocksignore 486 func (c *cpuacctController) StateSave(stateSinkObject state.Sink) { 487 c.beforeSave() 488 stateSinkObject.Save(0, &c.controllerCommon) 489 stateSinkObject.Save(1, &c.controllerNoResource) 490 stateSinkObject.Save(2, &c.taskCommittedCharges) 491 stateSinkObject.Save(3, &c.usage) 492 } 493 494 func (c *cpuacctController) afterLoad(context.Context) {} 495 496 // +checklocksignore 497 func (c *cpuacctController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 498 stateSourceObject.Load(0, &c.controllerCommon) 499 stateSourceObject.Load(1, &c.controllerNoResource) 500 stateSourceObject.Load(2, &c.taskCommittedCharges) 501 stateSourceObject.Load(3, &c.usage) 502 } 503 504 func (c *cpuacctCgroup) StateTypeName() string { 505 return "pkg/sentry/fsimpl/cgroupfs.cpuacctCgroup" 506 } 507 508 func (c *cpuacctCgroup) StateFields() []string { 509 return []string{ 510 "cgroupInode", 511 } 512 } 513 514 func (c *cpuacctCgroup) beforeSave() {} 515 516 // +checklocksignore 517 func (c *cpuacctCgroup) StateSave(stateSinkObject state.Sink) { 518 c.beforeSave() 519 stateSinkObject.Save(0, &c.cgroupInode) 520 } 521 522 func (c *cpuacctCgroup) afterLoad(context.Context) {} 523 524 // +checklocksignore 525 func (c *cpuacctCgroup) StateLoad(ctx context.Context, stateSourceObject state.Source) { 526 stateSourceObject.Load(0, &c.cgroupInode) 527 } 528 529 func (d *cpuacctStatData) StateTypeName() string { 530 return "pkg/sentry/fsimpl/cgroupfs.cpuacctStatData" 531 } 532 533 func (d *cpuacctStatData) StateFields() []string { 534 return []string{ 535 "cpuacctCgroup", 536 } 537 } 538 539 func (d *cpuacctStatData) beforeSave() {} 540 541 // +checklocksignore 542 func (d *cpuacctStatData) StateSave(stateSinkObject state.Sink) { 543 d.beforeSave() 544 stateSinkObject.Save(0, &d.cpuacctCgroup) 545 } 546 547 func (d *cpuacctStatData) afterLoad(context.Context) {} 548 549 // +checklocksignore 550 func (d *cpuacctStatData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 551 stateSourceObject.Load(0, &d.cpuacctCgroup) 552 } 553 554 func (d *cpuacctUsageData) StateTypeName() string { 555 return "pkg/sentry/fsimpl/cgroupfs.cpuacctUsageData" 556 } 557 558 func (d *cpuacctUsageData) StateFields() []string { 559 return []string{ 560 "cpuacctCgroup", 561 } 562 } 563 564 func (d *cpuacctUsageData) beforeSave() {} 565 566 // +checklocksignore 567 func (d *cpuacctUsageData) StateSave(stateSinkObject state.Sink) { 568 d.beforeSave() 569 stateSinkObject.Save(0, &d.cpuacctCgroup) 570 } 571 572 func (d *cpuacctUsageData) afterLoad(context.Context) {} 573 574 // +checklocksignore 575 func (d *cpuacctUsageData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 576 stateSourceObject.Load(0, &d.cpuacctCgroup) 577 } 578 579 func (d *cpuacctUsageUserData) StateTypeName() string { 580 return "pkg/sentry/fsimpl/cgroupfs.cpuacctUsageUserData" 581 } 582 583 func (d *cpuacctUsageUserData) StateFields() []string { 584 return []string{ 585 "cpuacctCgroup", 586 } 587 } 588 589 func (d *cpuacctUsageUserData) beforeSave() {} 590 591 // +checklocksignore 592 func (d *cpuacctUsageUserData) StateSave(stateSinkObject state.Sink) { 593 d.beforeSave() 594 stateSinkObject.Save(0, &d.cpuacctCgroup) 595 } 596 597 func (d *cpuacctUsageUserData) afterLoad(context.Context) {} 598 599 // +checklocksignore 600 func (d *cpuacctUsageUserData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 601 stateSourceObject.Load(0, &d.cpuacctCgroup) 602 } 603 604 func (d *cpuacctUsageSysData) StateTypeName() string { 605 return "pkg/sentry/fsimpl/cgroupfs.cpuacctUsageSysData" 606 } 607 608 func (d *cpuacctUsageSysData) StateFields() []string { 609 return []string{ 610 "cpuacctCgroup", 611 } 612 } 613 614 func (d *cpuacctUsageSysData) beforeSave() {} 615 616 // +checklocksignore 617 func (d *cpuacctUsageSysData) StateSave(stateSinkObject state.Sink) { 618 d.beforeSave() 619 stateSinkObject.Save(0, &d.cpuacctCgroup) 620 } 621 622 func (d *cpuacctUsageSysData) afterLoad(context.Context) {} 623 624 // +checklocksignore 625 func (d *cpuacctUsageSysData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 626 stateSourceObject.Load(0, &d.cpuacctCgroup) 627 } 628 629 func (c *cpusetController) StateTypeName() string { 630 return "pkg/sentry/fsimpl/cgroupfs.cpusetController" 631 } 632 633 func (c *cpusetController) StateFields() []string { 634 return []string{ 635 "controllerCommon", 636 "controllerStateless", 637 "controllerNoResource", 638 "maxCpus", 639 "maxMems", 640 "cpus", 641 "mems", 642 } 643 } 644 645 func (c *cpusetController) beforeSave() {} 646 647 // +checklocksignore 648 func (c *cpusetController) StateSave(stateSinkObject state.Sink) { 649 c.beforeSave() 650 stateSinkObject.Save(0, &c.controllerCommon) 651 stateSinkObject.Save(1, &c.controllerStateless) 652 stateSinkObject.Save(2, &c.controllerNoResource) 653 stateSinkObject.Save(3, &c.maxCpus) 654 stateSinkObject.Save(4, &c.maxMems) 655 stateSinkObject.Save(5, &c.cpus) 656 stateSinkObject.Save(6, &c.mems) 657 } 658 659 func (c *cpusetController) afterLoad(context.Context) {} 660 661 // +checklocksignore 662 func (c *cpusetController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 663 stateSourceObject.Load(0, &c.controllerCommon) 664 stateSourceObject.Load(1, &c.controllerStateless) 665 stateSourceObject.Load(2, &c.controllerNoResource) 666 stateSourceObject.Load(3, &c.maxCpus) 667 stateSourceObject.Load(4, &c.maxMems) 668 stateSourceObject.Load(5, &c.cpus) 669 stateSourceObject.Load(6, &c.mems) 670 } 671 672 func (d *cpusData) StateTypeName() string { 673 return "pkg/sentry/fsimpl/cgroupfs.cpusData" 674 } 675 676 func (d *cpusData) StateFields() []string { 677 return []string{ 678 "c", 679 } 680 } 681 682 func (d *cpusData) beforeSave() {} 683 684 // +checklocksignore 685 func (d *cpusData) StateSave(stateSinkObject state.Sink) { 686 d.beforeSave() 687 stateSinkObject.Save(0, &d.c) 688 } 689 690 func (d *cpusData) afterLoad(context.Context) {} 691 692 // +checklocksignore 693 func (d *cpusData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 694 stateSourceObject.Load(0, &d.c) 695 } 696 697 func (d *memsData) StateTypeName() string { 698 return "pkg/sentry/fsimpl/cgroupfs.memsData" 699 } 700 701 func (d *memsData) StateFields() []string { 702 return []string{ 703 "c", 704 } 705 } 706 707 func (d *memsData) beforeSave() {} 708 709 // +checklocksignore 710 func (d *memsData) StateSave(stateSinkObject state.Sink) { 711 d.beforeSave() 712 stateSinkObject.Save(0, &d.c) 713 } 714 715 func (d *memsData) afterLoad(context.Context) {} 716 717 // +checklocksignore 718 func (d *memsData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 719 stateSourceObject.Load(0, &d.c) 720 } 721 722 func (d *deviceID) StateTypeName() string { 723 return "pkg/sentry/fsimpl/cgroupfs.deviceID" 724 } 725 726 func (d *deviceID) StateFields() []string { 727 return []string{ 728 "controllerType", 729 "major", 730 "minor", 731 } 732 } 733 734 func (d *deviceID) beforeSave() {} 735 736 // +checklocksignore 737 func (d *deviceID) StateSave(stateSinkObject state.Sink) { 738 d.beforeSave() 739 stateSinkObject.Save(0, &d.controllerType) 740 stateSinkObject.Save(1, &d.major) 741 stateSinkObject.Save(2, &d.minor) 742 } 743 744 func (d *deviceID) afterLoad(context.Context) {} 745 746 // +checklocksignore 747 func (d *deviceID) StateLoad(ctx context.Context, stateSourceObject state.Source) { 748 stateSourceObject.Load(0, &d.controllerType) 749 stateSourceObject.Load(1, &d.major) 750 stateSourceObject.Load(2, &d.minor) 751 } 752 753 func (c *devicesController) StateTypeName() string { 754 return "pkg/sentry/fsimpl/cgroupfs.devicesController" 755 } 756 757 func (c *devicesController) StateFields() []string { 758 return []string{ 759 "controllerCommon", 760 "controllerStateless", 761 "controllerNoResource", 762 "defaultAllow", 763 "deviceRules", 764 } 765 } 766 767 func (c *devicesController) beforeSave() {} 768 769 // +checklocksignore 770 func (c *devicesController) StateSave(stateSinkObject state.Sink) { 771 c.beforeSave() 772 stateSinkObject.Save(0, &c.controllerCommon) 773 stateSinkObject.Save(1, &c.controllerStateless) 774 stateSinkObject.Save(2, &c.controllerNoResource) 775 stateSinkObject.Save(3, &c.defaultAllow) 776 stateSinkObject.Save(4, &c.deviceRules) 777 } 778 779 func (c *devicesController) afterLoad(context.Context) {} 780 781 // +checklocksignore 782 func (c *devicesController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 783 stateSourceObject.Load(0, &c.controllerCommon) 784 stateSourceObject.Load(1, &c.controllerStateless) 785 stateSourceObject.Load(2, &c.controllerNoResource) 786 stateSourceObject.Load(3, &c.defaultAllow) 787 stateSourceObject.Load(4, &c.deviceRules) 788 } 789 790 func (d *allowedDevicesData) StateTypeName() string { 791 return "pkg/sentry/fsimpl/cgroupfs.allowedDevicesData" 792 } 793 794 func (d *allowedDevicesData) StateFields() []string { 795 return []string{ 796 "c", 797 } 798 } 799 800 func (d *allowedDevicesData) beforeSave() {} 801 802 // +checklocksignore 803 func (d *allowedDevicesData) StateSave(stateSinkObject state.Sink) { 804 d.beforeSave() 805 stateSinkObject.Save(0, &d.c) 806 } 807 808 func (d *allowedDevicesData) afterLoad(context.Context) {} 809 810 // +checklocksignore 811 func (d *allowedDevicesData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 812 stateSourceObject.Load(0, &d.c) 813 } 814 815 func (d *deniedDevicesData) StateTypeName() string { 816 return "pkg/sentry/fsimpl/cgroupfs.deniedDevicesData" 817 } 818 819 func (d *deniedDevicesData) StateFields() []string { 820 return []string{ 821 "c", 822 } 823 } 824 825 func (d *deniedDevicesData) beforeSave() {} 826 827 // +checklocksignore 828 func (d *deniedDevicesData) StateSave(stateSinkObject state.Sink) { 829 d.beforeSave() 830 stateSinkObject.Save(0, &d.c) 831 } 832 833 func (d *deniedDevicesData) afterLoad(context.Context) {} 834 835 // +checklocksignore 836 func (d *deniedDevicesData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 837 stateSourceObject.Load(0, &d.c) 838 } 839 840 func (d *controlledDevicesData) StateTypeName() string { 841 return "pkg/sentry/fsimpl/cgroupfs.controlledDevicesData" 842 } 843 844 func (d *controlledDevicesData) StateFields() []string { 845 return []string{ 846 "c", 847 } 848 } 849 850 func (d *controlledDevicesData) beforeSave() {} 851 852 // +checklocksignore 853 func (d *controlledDevicesData) StateSave(stateSinkObject state.Sink) { 854 d.beforeSave() 855 stateSinkObject.Save(0, &d.c) 856 } 857 858 func (d *controlledDevicesData) afterLoad(context.Context) {} 859 860 // +checklocksignore 861 func (d *controlledDevicesData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 862 stateSourceObject.Load(0, &d.c) 863 } 864 865 func (r *dirRefs) StateTypeName() string { 866 return "pkg/sentry/fsimpl/cgroupfs.dirRefs" 867 } 868 869 func (r *dirRefs) StateFields() []string { 870 return []string{ 871 "refCount", 872 } 873 } 874 875 func (r *dirRefs) beforeSave() {} 876 877 // +checklocksignore 878 func (r *dirRefs) StateSave(stateSinkObject state.Sink) { 879 r.beforeSave() 880 stateSinkObject.Save(0, &r.refCount) 881 } 882 883 // +checklocksignore 884 func (r *dirRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 885 stateSourceObject.Load(0, &r.refCount) 886 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 887 } 888 889 func (c *jobController) StateTypeName() string { 890 return "pkg/sentry/fsimpl/cgroupfs.jobController" 891 } 892 893 func (c *jobController) StateFields() []string { 894 return []string{ 895 "controllerCommon", 896 "controllerStateless", 897 "controllerNoResource", 898 "id", 899 } 900 } 901 902 func (c *jobController) beforeSave() {} 903 904 // +checklocksignore 905 func (c *jobController) StateSave(stateSinkObject state.Sink) { 906 c.beforeSave() 907 stateSinkObject.Save(0, &c.controllerCommon) 908 stateSinkObject.Save(1, &c.controllerStateless) 909 stateSinkObject.Save(2, &c.controllerNoResource) 910 stateSinkObject.Save(3, &c.id) 911 } 912 913 func (c *jobController) afterLoad(context.Context) {} 914 915 // +checklocksignore 916 func (c *jobController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 917 stateSourceObject.Load(0, &c.controllerCommon) 918 stateSourceObject.Load(1, &c.controllerStateless) 919 stateSourceObject.Load(2, &c.controllerNoResource) 920 stateSourceObject.Load(3, &c.id) 921 } 922 923 func (c *memoryController) StateTypeName() string { 924 return "pkg/sentry/fsimpl/cgroupfs.memoryController" 925 } 926 927 func (c *memoryController) StateFields() []string { 928 return []string{ 929 "controllerCommon", 930 "controllerNoResource", 931 "limitBytes", 932 "softLimitBytes", 933 "moveChargeAtImmigrate", 934 "pressureLevel", 935 "memCg", 936 } 937 } 938 939 func (c *memoryController) beforeSave() {} 940 941 // +checklocksignore 942 func (c *memoryController) StateSave(stateSinkObject state.Sink) { 943 c.beforeSave() 944 stateSinkObject.Save(0, &c.controllerCommon) 945 stateSinkObject.Save(1, &c.controllerNoResource) 946 stateSinkObject.Save(2, &c.limitBytes) 947 stateSinkObject.Save(3, &c.softLimitBytes) 948 stateSinkObject.Save(4, &c.moveChargeAtImmigrate) 949 stateSinkObject.Save(5, &c.pressureLevel) 950 stateSinkObject.Save(6, &c.memCg) 951 } 952 953 func (c *memoryController) afterLoad(context.Context) {} 954 955 // +checklocksignore 956 func (c *memoryController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 957 stateSourceObject.Load(0, &c.controllerCommon) 958 stateSourceObject.Load(1, &c.controllerNoResource) 959 stateSourceObject.Load(2, &c.limitBytes) 960 stateSourceObject.Load(3, &c.softLimitBytes) 961 stateSourceObject.Load(4, &c.moveChargeAtImmigrate) 962 stateSourceObject.Load(5, &c.pressureLevel) 963 stateSourceObject.Load(6, &c.memCg) 964 } 965 966 func (memCg *memoryCgroup) StateTypeName() string { 967 return "pkg/sentry/fsimpl/cgroupfs.memoryCgroup" 968 } 969 970 func (memCg *memoryCgroup) StateFields() []string { 971 return []string{ 972 "cgroupInode", 973 } 974 } 975 976 func (memCg *memoryCgroup) beforeSave() {} 977 978 // +checklocksignore 979 func (memCg *memoryCgroup) StateSave(stateSinkObject state.Sink) { 980 memCg.beforeSave() 981 stateSinkObject.Save(0, &memCg.cgroupInode) 982 } 983 984 func (memCg *memoryCgroup) afterLoad(context.Context) {} 985 986 // +checklocksignore 987 func (memCg *memoryCgroup) StateLoad(ctx context.Context, stateSourceObject state.Source) { 988 stateSourceObject.Load(0, &memCg.cgroupInode) 989 } 990 991 func (d *memoryUsageInBytesData) StateTypeName() string { 992 return "pkg/sentry/fsimpl/cgroupfs.memoryUsageInBytesData" 993 } 994 995 func (d *memoryUsageInBytesData) StateFields() []string { 996 return []string{ 997 "memCg", 998 } 999 } 1000 1001 func (d *memoryUsageInBytesData) beforeSave() {} 1002 1003 // +checklocksignore 1004 func (d *memoryUsageInBytesData) StateSave(stateSinkObject state.Sink) { 1005 d.beforeSave() 1006 stateSinkObject.Save(0, &d.memCg) 1007 } 1008 1009 func (d *memoryUsageInBytesData) afterLoad(context.Context) {} 1010 1011 // +checklocksignore 1012 func (d *memoryUsageInBytesData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1013 stateSourceObject.Load(0, &d.memCg) 1014 } 1015 1016 func (c *pidsController) StateTypeName() string { 1017 return "pkg/sentry/fsimpl/cgroupfs.pidsController" 1018 } 1019 1020 func (c *pidsController) StateFields() []string { 1021 return []string{ 1022 "controllerCommon", 1023 "isRoot", 1024 "pendingTotal", 1025 "pendingPool", 1026 "committed", 1027 "max", 1028 } 1029 } 1030 1031 func (c *pidsController) beforeSave() {} 1032 1033 // +checklocksignore 1034 func (c *pidsController) StateSave(stateSinkObject state.Sink) { 1035 c.beforeSave() 1036 stateSinkObject.Save(0, &c.controllerCommon) 1037 stateSinkObject.Save(1, &c.isRoot) 1038 stateSinkObject.Save(2, &c.pendingTotal) 1039 stateSinkObject.Save(3, &c.pendingPool) 1040 stateSinkObject.Save(4, &c.committed) 1041 stateSinkObject.Save(5, &c.max) 1042 } 1043 1044 func (c *pidsController) afterLoad(context.Context) {} 1045 1046 // +checklocksignore 1047 func (c *pidsController) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1048 stateSourceObject.Load(0, &c.controllerCommon) 1049 stateSourceObject.Load(1, &c.isRoot) 1050 stateSourceObject.Load(2, &c.pendingTotal) 1051 stateSourceObject.Load(3, &c.pendingPool) 1052 stateSourceObject.Load(4, &c.committed) 1053 stateSourceObject.Load(5, &c.max) 1054 } 1055 1056 func (d *pidsCurrentData) StateTypeName() string { 1057 return "pkg/sentry/fsimpl/cgroupfs.pidsCurrentData" 1058 } 1059 1060 func (d *pidsCurrentData) StateFields() []string { 1061 return []string{ 1062 "c", 1063 } 1064 } 1065 1066 func (d *pidsCurrentData) beforeSave() {} 1067 1068 // +checklocksignore 1069 func (d *pidsCurrentData) StateSave(stateSinkObject state.Sink) { 1070 d.beforeSave() 1071 stateSinkObject.Save(0, &d.c) 1072 } 1073 1074 func (d *pidsCurrentData) afterLoad(context.Context) {} 1075 1076 // +checklocksignore 1077 func (d *pidsCurrentData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1078 stateSourceObject.Load(0, &d.c) 1079 } 1080 1081 func (d *pidsMaxData) StateTypeName() string { 1082 return "pkg/sentry/fsimpl/cgroupfs.pidsMaxData" 1083 } 1084 1085 func (d *pidsMaxData) StateFields() []string { 1086 return []string{ 1087 "c", 1088 } 1089 } 1090 1091 func (d *pidsMaxData) beforeSave() {} 1092 1093 // +checklocksignore 1094 func (d *pidsMaxData) StateSave(stateSinkObject state.Sink) { 1095 d.beforeSave() 1096 stateSinkObject.Save(0, &d.c) 1097 } 1098 1099 func (d *pidsMaxData) afterLoad(context.Context) {} 1100 1101 // +checklocksignore 1102 func (d *pidsMaxData) StateLoad(ctx context.Context, stateSourceObject state.Source) { 1103 stateSourceObject.Load(0, &d.c) 1104 } 1105 1106 func init() { 1107 state.Register((*controllerCommon)(nil)) 1108 state.Register((*cgroupInode)(nil)) 1109 state.Register((*cgroupProcsData)(nil)) 1110 state.Register((*tasksData)(nil)) 1111 state.Register((*FilesystemType)(nil)) 1112 state.Register((*InitialCgroup)(nil)) 1113 state.Register((*InternalData)(nil)) 1114 state.Register((*filesystem)(nil)) 1115 state.Register((*implStatFS)(nil)) 1116 state.Register((*dir)(nil)) 1117 state.Register((*controllerFile)(nil)) 1118 state.Register((*staticControllerFile)(nil)) 1119 state.Register((*stubControllerFile)(nil)) 1120 state.Register((*cpuController)(nil)) 1121 state.Register((*cpuacctController)(nil)) 1122 state.Register((*cpuacctCgroup)(nil)) 1123 state.Register((*cpuacctStatData)(nil)) 1124 state.Register((*cpuacctUsageData)(nil)) 1125 state.Register((*cpuacctUsageUserData)(nil)) 1126 state.Register((*cpuacctUsageSysData)(nil)) 1127 state.Register((*cpusetController)(nil)) 1128 state.Register((*cpusData)(nil)) 1129 state.Register((*memsData)(nil)) 1130 state.Register((*deviceID)(nil)) 1131 state.Register((*devicesController)(nil)) 1132 state.Register((*allowedDevicesData)(nil)) 1133 state.Register((*deniedDevicesData)(nil)) 1134 state.Register((*controlledDevicesData)(nil)) 1135 state.Register((*dirRefs)(nil)) 1136 state.Register((*jobController)(nil)) 1137 state.Register((*memoryController)(nil)) 1138 state.Register((*memoryCgroup)(nil)) 1139 state.Register((*memoryUsageInBytesData)(nil)) 1140 state.Register((*pidsController)(nil)) 1141 state.Register((*pidsCurrentData)(nil)) 1142 state.Register((*pidsMaxData)(nil)) 1143 }