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