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