github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/fsimpl/tmpfs/tmpfs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package tmpfs 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/state" 7 ) 8 9 func (l *dentryList) StateTypeName() string { 10 return "pkg/sentry/fsimpl/tmpfs.dentryList" 11 } 12 13 func (l *dentryList) StateFields() []string { 14 return []string{ 15 "head", 16 "tail", 17 } 18 } 19 20 func (l *dentryList) beforeSave() {} 21 22 // +checklocksignore 23 func (l *dentryList) StateSave(stateSinkObject state.Sink) { 24 l.beforeSave() 25 stateSinkObject.Save(0, &l.head) 26 stateSinkObject.Save(1, &l.tail) 27 } 28 29 func (l *dentryList) afterLoad() {} 30 31 // +checklocksignore 32 func (l *dentryList) StateLoad(stateSourceObject state.Source) { 33 stateSourceObject.Load(0, &l.head) 34 stateSourceObject.Load(1, &l.tail) 35 } 36 37 func (e *dentryEntry) StateTypeName() string { 38 return "pkg/sentry/fsimpl/tmpfs.dentryEntry" 39 } 40 41 func (e *dentryEntry) StateFields() []string { 42 return []string{ 43 "next", 44 "prev", 45 } 46 } 47 48 func (e *dentryEntry) beforeSave() {} 49 50 // +checklocksignore 51 func (e *dentryEntry) StateSave(stateSinkObject state.Sink) { 52 e.beforeSave() 53 stateSinkObject.Save(0, &e.next) 54 stateSinkObject.Save(1, &e.prev) 55 } 56 57 func (e *dentryEntry) afterLoad() {} 58 59 // +checklocksignore 60 func (e *dentryEntry) StateLoad(stateSourceObject state.Source) { 61 stateSourceObject.Load(0, &e.next) 62 stateSourceObject.Load(1, &e.prev) 63 } 64 65 func (d *deviceFile) StateTypeName() string { 66 return "pkg/sentry/fsimpl/tmpfs.deviceFile" 67 } 68 69 func (d *deviceFile) StateFields() []string { 70 return []string{ 71 "inode", 72 "kind", 73 "major", 74 "minor", 75 } 76 } 77 78 func (d *deviceFile) beforeSave() {} 79 80 // +checklocksignore 81 func (d *deviceFile) StateSave(stateSinkObject state.Sink) { 82 d.beforeSave() 83 stateSinkObject.Save(0, &d.inode) 84 stateSinkObject.Save(1, &d.kind) 85 stateSinkObject.Save(2, &d.major) 86 stateSinkObject.Save(3, &d.minor) 87 } 88 89 func (d *deviceFile) afterLoad() {} 90 91 // +checklocksignore 92 func (d *deviceFile) StateLoad(stateSourceObject state.Source) { 93 stateSourceObject.Load(0, &d.inode) 94 stateSourceObject.Load(1, &d.kind) 95 stateSourceObject.Load(2, &d.major) 96 stateSourceObject.Load(3, &d.minor) 97 } 98 99 func (dir *directory) StateTypeName() string { 100 return "pkg/sentry/fsimpl/tmpfs.directory" 101 } 102 103 func (dir *directory) StateFields() []string { 104 return []string{ 105 "dentry", 106 "inode", 107 "childMap", 108 "numChildren", 109 "childList", 110 } 111 } 112 113 func (dir *directory) beforeSave() {} 114 115 // +checklocksignore 116 func (dir *directory) StateSave(stateSinkObject state.Sink) { 117 dir.beforeSave() 118 stateSinkObject.Save(0, &dir.dentry) 119 stateSinkObject.Save(1, &dir.inode) 120 stateSinkObject.Save(2, &dir.childMap) 121 stateSinkObject.Save(3, &dir.numChildren) 122 stateSinkObject.Save(4, &dir.childList) 123 } 124 125 func (dir *directory) afterLoad() {} 126 127 // +checklocksignore 128 func (dir *directory) StateLoad(stateSourceObject state.Source) { 129 stateSourceObject.Load(0, &dir.dentry) 130 stateSourceObject.Load(1, &dir.inode) 131 stateSourceObject.Load(2, &dir.childMap) 132 stateSourceObject.Load(3, &dir.numChildren) 133 stateSourceObject.Load(4, &dir.childList) 134 } 135 136 func (fd *directoryFD) StateTypeName() string { 137 return "pkg/sentry/fsimpl/tmpfs.directoryFD" 138 } 139 140 func (fd *directoryFD) StateFields() []string { 141 return []string{ 142 "fileDescription", 143 "DirectoryFileDescriptionDefaultImpl", 144 "iter", 145 "off", 146 } 147 } 148 149 func (fd *directoryFD) beforeSave() {} 150 151 // +checklocksignore 152 func (fd *directoryFD) StateSave(stateSinkObject state.Sink) { 153 fd.beforeSave() 154 stateSinkObject.Save(0, &fd.fileDescription) 155 stateSinkObject.Save(1, &fd.DirectoryFileDescriptionDefaultImpl) 156 stateSinkObject.Save(2, &fd.iter) 157 stateSinkObject.Save(3, &fd.off) 158 } 159 160 func (fd *directoryFD) afterLoad() {} 161 162 // +checklocksignore 163 func (fd *directoryFD) StateLoad(stateSourceObject state.Source) { 164 stateSourceObject.Load(0, &fd.fileDescription) 165 stateSourceObject.Load(1, &fd.DirectoryFileDescriptionDefaultImpl) 166 stateSourceObject.Load(2, &fd.iter) 167 stateSourceObject.Load(3, &fd.off) 168 } 169 170 func (r *inodeRefs) StateTypeName() string { 171 return "pkg/sentry/fsimpl/tmpfs.inodeRefs" 172 } 173 174 func (r *inodeRefs) StateFields() []string { 175 return []string{ 176 "refCount", 177 } 178 } 179 180 func (r *inodeRefs) beforeSave() {} 181 182 // +checklocksignore 183 func (r *inodeRefs) StateSave(stateSinkObject state.Sink) { 184 r.beforeSave() 185 stateSinkObject.Save(0, &r.refCount) 186 } 187 188 // +checklocksignore 189 func (r *inodeRefs) StateLoad(stateSourceObject state.Source) { 190 stateSourceObject.Load(0, &r.refCount) 191 stateSourceObject.AfterLoad(r.afterLoad) 192 } 193 194 func (n *namedPipe) StateTypeName() string { 195 return "pkg/sentry/fsimpl/tmpfs.namedPipe" 196 } 197 198 func (n *namedPipe) StateFields() []string { 199 return []string{ 200 "inode", 201 "pipe", 202 } 203 } 204 205 func (n *namedPipe) beforeSave() {} 206 207 // +checklocksignore 208 func (n *namedPipe) StateSave(stateSinkObject state.Sink) { 209 n.beforeSave() 210 stateSinkObject.Save(0, &n.inode) 211 stateSinkObject.Save(1, &n.pipe) 212 } 213 214 func (n *namedPipe) afterLoad() {} 215 216 // +checklocksignore 217 func (n *namedPipe) StateLoad(stateSourceObject state.Source) { 218 stateSourceObject.Load(0, &n.inode) 219 stateSourceObject.Load(1, &n.pipe) 220 } 221 222 func (rf *regularFile) StateTypeName() string { 223 return "pkg/sentry/fsimpl/tmpfs.regularFile" 224 } 225 226 func (rf *regularFile) StateFields() []string { 227 return []string{ 228 "inode", 229 "memoryUsageKind", 230 "mappings", 231 "writableMappingPages", 232 "data", 233 "seals", 234 "size", 235 } 236 } 237 238 func (rf *regularFile) beforeSave() {} 239 240 // +checklocksignore 241 func (rf *regularFile) StateSave(stateSinkObject state.Sink) { 242 rf.beforeSave() 243 stateSinkObject.Save(0, &rf.inode) 244 stateSinkObject.Save(1, &rf.memoryUsageKind) 245 stateSinkObject.Save(2, &rf.mappings) 246 stateSinkObject.Save(3, &rf.writableMappingPages) 247 stateSinkObject.Save(4, &rf.data) 248 stateSinkObject.Save(5, &rf.seals) 249 stateSinkObject.Save(6, &rf.size) 250 } 251 252 func (rf *regularFile) afterLoad() {} 253 254 // +checklocksignore 255 func (rf *regularFile) StateLoad(stateSourceObject state.Source) { 256 stateSourceObject.Load(0, &rf.inode) 257 stateSourceObject.Load(1, &rf.memoryUsageKind) 258 stateSourceObject.Load(2, &rf.mappings) 259 stateSourceObject.Load(3, &rf.writableMappingPages) 260 stateSourceObject.Load(4, &rf.data) 261 stateSourceObject.Load(5, &rf.seals) 262 stateSourceObject.Load(6, &rf.size) 263 } 264 265 func (fd *regularFileFD) StateTypeName() string { 266 return "pkg/sentry/fsimpl/tmpfs.regularFileFD" 267 } 268 269 func (fd *regularFileFD) StateFields() []string { 270 return []string{ 271 "fileDescription", 272 "off", 273 } 274 } 275 276 func (fd *regularFileFD) beforeSave() {} 277 278 // +checklocksignore 279 func (fd *regularFileFD) StateSave(stateSinkObject state.Sink) { 280 fd.beforeSave() 281 stateSinkObject.Save(0, &fd.fileDescription) 282 stateSinkObject.Save(1, &fd.off) 283 } 284 285 func (fd *regularFileFD) afterLoad() {} 286 287 // +checklocksignore 288 func (fd *regularFileFD) StateLoad(stateSourceObject state.Source) { 289 stateSourceObject.Load(0, &fd.fileDescription) 290 stateSourceObject.Load(1, &fd.off) 291 } 292 293 func (s *socketFile) StateTypeName() string { 294 return "pkg/sentry/fsimpl/tmpfs.socketFile" 295 } 296 297 func (s *socketFile) StateFields() []string { 298 return []string{ 299 "inode", 300 "ep", 301 } 302 } 303 304 func (s *socketFile) beforeSave() {} 305 306 // +checklocksignore 307 func (s *socketFile) StateSave(stateSinkObject state.Sink) { 308 s.beforeSave() 309 stateSinkObject.Save(0, &s.inode) 310 stateSinkObject.Save(1, &s.ep) 311 } 312 313 func (s *socketFile) afterLoad() {} 314 315 // +checklocksignore 316 func (s *socketFile) StateLoad(stateSourceObject state.Source) { 317 stateSourceObject.Load(0, &s.inode) 318 stateSourceObject.Load(1, &s.ep) 319 } 320 321 func (s *symlink) StateTypeName() string { 322 return "pkg/sentry/fsimpl/tmpfs.symlink" 323 } 324 325 func (s *symlink) StateFields() []string { 326 return []string{ 327 "inode", 328 "target", 329 } 330 } 331 332 func (s *symlink) beforeSave() {} 333 334 // +checklocksignore 335 func (s *symlink) StateSave(stateSinkObject state.Sink) { 336 s.beforeSave() 337 stateSinkObject.Save(0, &s.inode) 338 stateSinkObject.Save(1, &s.target) 339 } 340 341 func (s *symlink) afterLoad() {} 342 343 // +checklocksignore 344 func (s *symlink) StateLoad(stateSourceObject state.Source) { 345 stateSourceObject.Load(0, &s.inode) 346 stateSourceObject.Load(1, &s.target) 347 } 348 349 func (fstype *FilesystemType) StateTypeName() string { 350 return "pkg/sentry/fsimpl/tmpfs.FilesystemType" 351 } 352 353 func (fstype *FilesystemType) StateFields() []string { 354 return []string{} 355 } 356 357 func (fstype *FilesystemType) beforeSave() {} 358 359 // +checklocksignore 360 func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink) { 361 fstype.beforeSave() 362 } 363 364 func (fstype *FilesystemType) afterLoad() {} 365 366 // +checklocksignore 367 func (fstype *FilesystemType) StateLoad(stateSourceObject state.Source) { 368 } 369 370 func (fs *filesystem) StateTypeName() string { 371 return "pkg/sentry/fsimpl/tmpfs.filesystem" 372 } 373 374 func (fs *filesystem) StateFields() []string { 375 return []string{ 376 "vfsfs", 377 "privateMF", 378 "mfp", 379 "clock", 380 "devMinor", 381 "mopts", 382 "usage", 383 "nextInoMinusOne", 384 "root", 385 "maxFilenameLen", 386 "maxSizeInPages", 387 "pagesUsed", 388 "allowXattrPrefix", 389 } 390 } 391 392 func (fs *filesystem) beforeSave() {} 393 394 // +checklocksignore 395 func (fs *filesystem) StateSave(stateSinkObject state.Sink) { 396 fs.beforeSave() 397 stateSinkObject.Save(0, &fs.vfsfs) 398 stateSinkObject.Save(1, &fs.privateMF) 399 stateSinkObject.Save(2, &fs.mfp) 400 stateSinkObject.Save(3, &fs.clock) 401 stateSinkObject.Save(4, &fs.devMinor) 402 stateSinkObject.Save(5, &fs.mopts) 403 stateSinkObject.Save(6, &fs.usage) 404 stateSinkObject.Save(7, &fs.nextInoMinusOne) 405 stateSinkObject.Save(8, &fs.root) 406 stateSinkObject.Save(9, &fs.maxFilenameLen) 407 stateSinkObject.Save(10, &fs.maxSizeInPages) 408 stateSinkObject.Save(11, &fs.pagesUsed) 409 stateSinkObject.Save(12, &fs.allowXattrPrefix) 410 } 411 412 // +checklocksignore 413 func (fs *filesystem) StateLoad(stateSourceObject state.Source) { 414 stateSourceObject.Load(0, &fs.vfsfs) 415 stateSourceObject.Load(1, &fs.privateMF) 416 stateSourceObject.Load(2, &fs.mfp) 417 stateSourceObject.Load(3, &fs.clock) 418 stateSourceObject.Load(4, &fs.devMinor) 419 stateSourceObject.Load(5, &fs.mopts) 420 stateSourceObject.Load(6, &fs.usage) 421 stateSourceObject.Load(7, &fs.nextInoMinusOne) 422 stateSourceObject.Load(8, &fs.root) 423 stateSourceObject.Load(9, &fs.maxFilenameLen) 424 stateSourceObject.Load(10, &fs.maxSizeInPages) 425 stateSourceObject.Load(11, &fs.pagesUsed) 426 stateSourceObject.Load(12, &fs.allowXattrPrefix) 427 stateSourceObject.AfterLoad(fs.afterLoad) 428 } 429 430 func (f *FilesystemOpts) StateTypeName() string { 431 return "pkg/sentry/fsimpl/tmpfs.FilesystemOpts" 432 } 433 434 func (f *FilesystemOpts) StateFields() []string { 435 return []string{ 436 "RootFileType", 437 "RootSymlinkTarget", 438 "FilesystemType", 439 "Usage", 440 "MaxFilenameLen", 441 "FilestoreFD", 442 "DisableDefaultSizeLimit", 443 "AllowXattrPrefix", 444 } 445 } 446 447 func (f *FilesystemOpts) beforeSave() {} 448 449 // +checklocksignore 450 func (f *FilesystemOpts) StateSave(stateSinkObject state.Sink) { 451 f.beforeSave() 452 stateSinkObject.Save(0, &f.RootFileType) 453 stateSinkObject.Save(1, &f.RootSymlinkTarget) 454 stateSinkObject.Save(2, &f.FilesystemType) 455 stateSinkObject.Save(3, &f.Usage) 456 stateSinkObject.Save(4, &f.MaxFilenameLen) 457 stateSinkObject.Save(5, &f.FilestoreFD) 458 stateSinkObject.Save(6, &f.DisableDefaultSizeLimit) 459 stateSinkObject.Save(7, &f.AllowXattrPrefix) 460 } 461 462 func (f *FilesystemOpts) afterLoad() {} 463 464 // +checklocksignore 465 func (f *FilesystemOpts) StateLoad(stateSourceObject state.Source) { 466 stateSourceObject.Load(0, &f.RootFileType) 467 stateSourceObject.Load(1, &f.RootSymlinkTarget) 468 stateSourceObject.Load(2, &f.FilesystemType) 469 stateSourceObject.Load(3, &f.Usage) 470 stateSourceObject.Load(4, &f.MaxFilenameLen) 471 stateSourceObject.Load(5, &f.FilestoreFD) 472 stateSourceObject.Load(6, &f.DisableDefaultSizeLimit) 473 stateSourceObject.Load(7, &f.AllowXattrPrefix) 474 } 475 476 func (d *dentry) StateTypeName() string { 477 return "pkg/sentry/fsimpl/tmpfs.dentry" 478 } 479 480 func (d *dentry) StateFields() []string { 481 return []string{ 482 "vfsd", 483 "parent", 484 "name", 485 "dentryEntry", 486 "inode", 487 } 488 } 489 490 func (d *dentry) beforeSave() {} 491 492 // +checklocksignore 493 func (d *dentry) StateSave(stateSinkObject state.Sink) { 494 d.beforeSave() 495 stateSinkObject.Save(0, &d.vfsd) 496 stateSinkObject.Save(1, &d.parent) 497 stateSinkObject.Save(2, &d.name) 498 stateSinkObject.Save(3, &d.dentryEntry) 499 stateSinkObject.Save(4, &d.inode) 500 } 501 502 func (d *dentry) afterLoad() {} 503 504 // +checklocksignore 505 func (d *dentry) StateLoad(stateSourceObject state.Source) { 506 stateSourceObject.Load(0, &d.vfsd) 507 stateSourceObject.Load(1, &d.parent) 508 stateSourceObject.Load(2, &d.name) 509 stateSourceObject.Load(3, &d.dentryEntry) 510 stateSourceObject.Load(4, &d.inode) 511 } 512 513 func (i *inode) StateTypeName() string { 514 return "pkg/sentry/fsimpl/tmpfs.inode" 515 } 516 517 func (i *inode) StateFields() []string { 518 return []string{ 519 "fs", 520 "refs", 521 "xattrs", 522 "mode", 523 "nlink", 524 "uid", 525 "gid", 526 "ino", 527 "atime", 528 "ctime", 529 "mtime", 530 "locks", 531 "watches", 532 "impl", 533 } 534 } 535 536 func (i *inode) beforeSave() {} 537 538 // +checklocksignore 539 func (i *inode) StateSave(stateSinkObject state.Sink) { 540 i.beforeSave() 541 stateSinkObject.Save(0, &i.fs) 542 stateSinkObject.Save(1, &i.refs) 543 stateSinkObject.Save(2, &i.xattrs) 544 stateSinkObject.Save(3, &i.mode) 545 stateSinkObject.Save(4, &i.nlink) 546 stateSinkObject.Save(5, &i.uid) 547 stateSinkObject.Save(6, &i.gid) 548 stateSinkObject.Save(7, &i.ino) 549 stateSinkObject.Save(8, &i.atime) 550 stateSinkObject.Save(9, &i.ctime) 551 stateSinkObject.Save(10, &i.mtime) 552 stateSinkObject.Save(11, &i.locks) 553 stateSinkObject.Save(12, &i.watches) 554 stateSinkObject.Save(13, &i.impl) 555 } 556 557 func (i *inode) afterLoad() {} 558 559 // +checklocksignore 560 func (i *inode) StateLoad(stateSourceObject state.Source) { 561 stateSourceObject.Load(0, &i.fs) 562 stateSourceObject.Load(1, &i.refs) 563 stateSourceObject.Load(2, &i.xattrs) 564 stateSourceObject.Load(3, &i.mode) 565 stateSourceObject.Load(4, &i.nlink) 566 stateSourceObject.Load(5, &i.uid) 567 stateSourceObject.Load(6, &i.gid) 568 stateSourceObject.Load(7, &i.ino) 569 stateSourceObject.Load(8, &i.atime) 570 stateSourceObject.Load(9, &i.ctime) 571 stateSourceObject.Load(10, &i.mtime) 572 stateSourceObject.Load(11, &i.locks) 573 stateSourceObject.Load(12, &i.watches) 574 stateSourceObject.Load(13, &i.impl) 575 } 576 577 func (fd *fileDescription) StateTypeName() string { 578 return "pkg/sentry/fsimpl/tmpfs.fileDescription" 579 } 580 581 func (fd *fileDescription) StateFields() []string { 582 return []string{ 583 "vfsfd", 584 "FileDescriptionDefaultImpl", 585 "LockFD", 586 } 587 } 588 589 func (fd *fileDescription) beforeSave() {} 590 591 // +checklocksignore 592 func (fd *fileDescription) StateSave(stateSinkObject state.Sink) { 593 fd.beforeSave() 594 stateSinkObject.Save(0, &fd.vfsfd) 595 stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl) 596 stateSinkObject.Save(2, &fd.LockFD) 597 } 598 599 func (fd *fileDescription) afterLoad() {} 600 601 // +checklocksignore 602 func (fd *fileDescription) StateLoad(stateSourceObject state.Source) { 603 stateSourceObject.Load(0, &fd.vfsfd) 604 stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl) 605 stateSourceObject.Load(2, &fd.LockFD) 606 } 607 608 func init() { 609 state.Register((*dentryList)(nil)) 610 state.Register((*dentryEntry)(nil)) 611 state.Register((*deviceFile)(nil)) 612 state.Register((*directory)(nil)) 613 state.Register((*directoryFD)(nil)) 614 state.Register((*inodeRefs)(nil)) 615 state.Register((*namedPipe)(nil)) 616 state.Register((*regularFile)(nil)) 617 state.Register((*regularFileFD)(nil)) 618 state.Register((*socketFile)(nil)) 619 state.Register((*symlink)(nil)) 620 state.Register((*FilesystemType)(nil)) 621 state.Register((*filesystem)(nil)) 622 state.Register((*FilesystemOpts)(nil)) 623 state.Register((*dentry)(nil)) 624 state.Register((*inode)(nil)) 625 state.Register((*fileDescription)(nil)) 626 }