github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/devpts/devpts_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package devpts 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (fstype *FilesystemType) StateTypeName() string { 12 return "pkg/sentry/fsimpl/devpts.FilesystemType" 13 } 14 15 func (fstype *FilesystemType) StateFields() []string { 16 return []string{ 17 "initErr", 18 "fs", 19 "root", 20 } 21 } 22 23 func (fstype *FilesystemType) beforeSave() {} 24 25 // +checklocksignore 26 func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink) { 27 fstype.beforeSave() 28 stateSinkObject.Save(0, &fstype.initErr) 29 stateSinkObject.Save(1, &fstype.fs) 30 stateSinkObject.Save(2, &fstype.root) 31 } 32 33 func (fstype *FilesystemType) afterLoad(context.Context) {} 34 35 // +checklocksignore 36 func (fstype *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &fstype.initErr) 38 stateSourceObject.Load(1, &fstype.fs) 39 stateSourceObject.Load(2, &fstype.root) 40 } 41 42 func (fs *filesystem) StateTypeName() string { 43 return "pkg/sentry/fsimpl/devpts.filesystem" 44 } 45 46 func (fs *filesystem) StateFields() []string { 47 return []string{ 48 "Filesystem", 49 "devMinor", 50 } 51 } 52 53 func (fs *filesystem) beforeSave() {} 54 55 // +checklocksignore 56 func (fs *filesystem) StateSave(stateSinkObject state.Sink) { 57 fs.beforeSave() 58 stateSinkObject.Save(0, &fs.Filesystem) 59 stateSinkObject.Save(1, &fs.devMinor) 60 } 61 62 func (fs *filesystem) afterLoad(context.Context) {} 63 64 // +checklocksignore 65 func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) { 66 stateSourceObject.Load(0, &fs.Filesystem) 67 stateSourceObject.Load(1, &fs.devMinor) 68 } 69 70 func (i *rootInode) StateTypeName() string { 71 return "pkg/sentry/fsimpl/devpts.rootInode" 72 } 73 74 func (i *rootInode) StateFields() []string { 75 return []string{ 76 "implStatFS", 77 "InodeAlwaysValid", 78 "InodeAttrs", 79 "InodeDirectoryNoNewChildren", 80 "InodeNotAnonymous", 81 "InodeNotSymlink", 82 "InodeTemporary", 83 "InodeWatches", 84 "OrderedChildren", 85 "rootInodeRefs", 86 "locks", 87 "master", 88 "replicas", 89 "nextIdx", 90 } 91 } 92 93 func (i *rootInode) beforeSave() {} 94 95 // +checklocksignore 96 func (i *rootInode) StateSave(stateSinkObject state.Sink) { 97 i.beforeSave() 98 stateSinkObject.Save(0, &i.implStatFS) 99 stateSinkObject.Save(1, &i.InodeAlwaysValid) 100 stateSinkObject.Save(2, &i.InodeAttrs) 101 stateSinkObject.Save(3, &i.InodeDirectoryNoNewChildren) 102 stateSinkObject.Save(4, &i.InodeNotAnonymous) 103 stateSinkObject.Save(5, &i.InodeNotSymlink) 104 stateSinkObject.Save(6, &i.InodeTemporary) 105 stateSinkObject.Save(7, &i.InodeWatches) 106 stateSinkObject.Save(8, &i.OrderedChildren) 107 stateSinkObject.Save(9, &i.rootInodeRefs) 108 stateSinkObject.Save(10, &i.locks) 109 stateSinkObject.Save(11, &i.master) 110 stateSinkObject.Save(12, &i.replicas) 111 stateSinkObject.Save(13, &i.nextIdx) 112 } 113 114 func (i *rootInode) afterLoad(context.Context) {} 115 116 // +checklocksignore 117 func (i *rootInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 118 stateSourceObject.Load(0, &i.implStatFS) 119 stateSourceObject.Load(1, &i.InodeAlwaysValid) 120 stateSourceObject.Load(2, &i.InodeAttrs) 121 stateSourceObject.Load(3, &i.InodeDirectoryNoNewChildren) 122 stateSourceObject.Load(4, &i.InodeNotAnonymous) 123 stateSourceObject.Load(5, &i.InodeNotSymlink) 124 stateSourceObject.Load(6, &i.InodeTemporary) 125 stateSourceObject.Load(7, &i.InodeWatches) 126 stateSourceObject.Load(8, &i.OrderedChildren) 127 stateSourceObject.Load(9, &i.rootInodeRefs) 128 stateSourceObject.Load(10, &i.locks) 129 stateSourceObject.Load(11, &i.master) 130 stateSourceObject.Load(12, &i.replicas) 131 stateSourceObject.Load(13, &i.nextIdx) 132 } 133 134 func (i *implStatFS) StateTypeName() string { 135 return "pkg/sentry/fsimpl/devpts.implStatFS" 136 } 137 138 func (i *implStatFS) StateFields() []string { 139 return []string{} 140 } 141 142 func (i *implStatFS) beforeSave() {} 143 144 // +checklocksignore 145 func (i *implStatFS) StateSave(stateSinkObject state.Sink) { 146 i.beforeSave() 147 } 148 149 func (i *implStatFS) afterLoad(context.Context) {} 150 151 // +checklocksignore 152 func (i *implStatFS) StateLoad(ctx context.Context, stateSourceObject state.Source) { 153 } 154 155 func (l *lineDiscipline) StateTypeName() string { 156 return "pkg/sentry/fsimpl/devpts.lineDiscipline" 157 } 158 159 func (l *lineDiscipline) StateFields() []string { 160 return []string{ 161 "size", 162 "inQueue", 163 "outQueue", 164 "termios", 165 "column", 166 "numReplicas", 167 "masterWaiter", 168 "replicaWaiter", 169 "terminal", 170 } 171 } 172 173 func (l *lineDiscipline) beforeSave() {} 174 175 // +checklocksignore 176 func (l *lineDiscipline) StateSave(stateSinkObject state.Sink) { 177 l.beforeSave() 178 stateSinkObject.Save(0, &l.size) 179 stateSinkObject.Save(1, &l.inQueue) 180 stateSinkObject.Save(2, &l.outQueue) 181 stateSinkObject.Save(3, &l.termios) 182 stateSinkObject.Save(4, &l.column) 183 stateSinkObject.Save(5, &l.numReplicas) 184 stateSinkObject.Save(6, &l.masterWaiter) 185 stateSinkObject.Save(7, &l.replicaWaiter) 186 stateSinkObject.Save(8, &l.terminal) 187 } 188 189 func (l *lineDiscipline) afterLoad(context.Context) {} 190 191 // +checklocksignore 192 func (l *lineDiscipline) StateLoad(ctx context.Context, stateSourceObject state.Source) { 193 stateSourceObject.Load(0, &l.size) 194 stateSourceObject.Load(1, &l.inQueue) 195 stateSourceObject.Load(2, &l.outQueue) 196 stateSourceObject.Load(3, &l.termios) 197 stateSourceObject.Load(4, &l.column) 198 stateSourceObject.Load(5, &l.numReplicas) 199 stateSourceObject.Load(6, &l.masterWaiter) 200 stateSourceObject.Load(7, &l.replicaWaiter) 201 stateSourceObject.Load(8, &l.terminal) 202 } 203 204 func (o *outputQueueTransformer) StateTypeName() string { 205 return "pkg/sentry/fsimpl/devpts.outputQueueTransformer" 206 } 207 208 func (o *outputQueueTransformer) StateFields() []string { 209 return []string{} 210 } 211 212 func (o *outputQueueTransformer) beforeSave() {} 213 214 // +checklocksignore 215 func (o *outputQueueTransformer) StateSave(stateSinkObject state.Sink) { 216 o.beforeSave() 217 } 218 219 func (o *outputQueueTransformer) afterLoad(context.Context) {} 220 221 // +checklocksignore 222 func (o *outputQueueTransformer) StateLoad(ctx context.Context, stateSourceObject state.Source) { 223 } 224 225 func (i *inputQueueTransformer) StateTypeName() string { 226 return "pkg/sentry/fsimpl/devpts.inputQueueTransformer" 227 } 228 229 func (i *inputQueueTransformer) StateFields() []string { 230 return []string{} 231 } 232 233 func (i *inputQueueTransformer) beforeSave() {} 234 235 // +checklocksignore 236 func (i *inputQueueTransformer) StateSave(stateSinkObject state.Sink) { 237 i.beforeSave() 238 } 239 240 func (i *inputQueueTransformer) afterLoad(context.Context) {} 241 242 // +checklocksignore 243 func (i *inputQueueTransformer) StateLoad(ctx context.Context, stateSourceObject state.Source) { 244 } 245 246 func (mi *masterInode) StateTypeName() string { 247 return "pkg/sentry/fsimpl/devpts.masterInode" 248 } 249 250 func (mi *masterInode) StateFields() []string { 251 return []string{ 252 "implStatFS", 253 "InodeAttrs", 254 "InodeNoopRefCount", 255 "InodeNotAnonymous", 256 "InodeNotDirectory", 257 "InodeNotSymlink", 258 "InodeWatches", 259 "locks", 260 "root", 261 } 262 } 263 264 func (mi *masterInode) beforeSave() {} 265 266 // +checklocksignore 267 func (mi *masterInode) StateSave(stateSinkObject state.Sink) { 268 mi.beforeSave() 269 stateSinkObject.Save(0, &mi.implStatFS) 270 stateSinkObject.Save(1, &mi.InodeAttrs) 271 stateSinkObject.Save(2, &mi.InodeNoopRefCount) 272 stateSinkObject.Save(3, &mi.InodeNotAnonymous) 273 stateSinkObject.Save(4, &mi.InodeNotDirectory) 274 stateSinkObject.Save(5, &mi.InodeNotSymlink) 275 stateSinkObject.Save(6, &mi.InodeWatches) 276 stateSinkObject.Save(7, &mi.locks) 277 stateSinkObject.Save(8, &mi.root) 278 } 279 280 func (mi *masterInode) afterLoad(context.Context) {} 281 282 // +checklocksignore 283 func (mi *masterInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 284 stateSourceObject.Load(0, &mi.implStatFS) 285 stateSourceObject.Load(1, &mi.InodeAttrs) 286 stateSourceObject.Load(2, &mi.InodeNoopRefCount) 287 stateSourceObject.Load(3, &mi.InodeNotAnonymous) 288 stateSourceObject.Load(4, &mi.InodeNotDirectory) 289 stateSourceObject.Load(5, &mi.InodeNotSymlink) 290 stateSourceObject.Load(6, &mi.InodeWatches) 291 stateSourceObject.Load(7, &mi.locks) 292 stateSourceObject.Load(8, &mi.root) 293 } 294 295 func (mfd *masterFileDescription) StateTypeName() string { 296 return "pkg/sentry/fsimpl/devpts.masterFileDescription" 297 } 298 299 func (mfd *masterFileDescription) StateFields() []string { 300 return []string{ 301 "vfsfd", 302 "FileDescriptionDefaultImpl", 303 "LockFD", 304 "inode", 305 "t", 306 } 307 } 308 309 func (mfd *masterFileDescription) beforeSave() {} 310 311 // +checklocksignore 312 func (mfd *masterFileDescription) StateSave(stateSinkObject state.Sink) { 313 mfd.beforeSave() 314 stateSinkObject.Save(0, &mfd.vfsfd) 315 stateSinkObject.Save(1, &mfd.FileDescriptionDefaultImpl) 316 stateSinkObject.Save(2, &mfd.LockFD) 317 stateSinkObject.Save(3, &mfd.inode) 318 stateSinkObject.Save(4, &mfd.t) 319 } 320 321 func (mfd *masterFileDescription) afterLoad(context.Context) {} 322 323 // +checklocksignore 324 func (mfd *masterFileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) { 325 stateSourceObject.Load(0, &mfd.vfsfd) 326 stateSourceObject.Load(1, &mfd.FileDescriptionDefaultImpl) 327 stateSourceObject.Load(2, &mfd.LockFD) 328 stateSourceObject.Load(3, &mfd.inode) 329 stateSourceObject.Load(4, &mfd.t) 330 } 331 332 func (q *queue) StateTypeName() string { 333 return "pkg/sentry/fsimpl/devpts.queue" 334 } 335 336 func (q *queue) StateFields() []string { 337 return []string{ 338 "readBuf", 339 "waitBuf", 340 "waitBufLen", 341 "readable", 342 "transformer", 343 } 344 } 345 346 func (q *queue) beforeSave() {} 347 348 // +checklocksignore 349 func (q *queue) StateSave(stateSinkObject state.Sink) { 350 q.beforeSave() 351 stateSinkObject.Save(0, &q.readBuf) 352 stateSinkObject.Save(1, &q.waitBuf) 353 stateSinkObject.Save(2, &q.waitBufLen) 354 stateSinkObject.Save(3, &q.readable) 355 stateSinkObject.Save(4, &q.transformer) 356 } 357 358 func (q *queue) afterLoad(context.Context) {} 359 360 // +checklocksignore 361 func (q *queue) StateLoad(ctx context.Context, stateSourceObject state.Source) { 362 stateSourceObject.Load(0, &q.readBuf) 363 stateSourceObject.Load(1, &q.waitBuf) 364 stateSourceObject.Load(2, &q.waitBufLen) 365 stateSourceObject.Load(3, &q.readable) 366 stateSourceObject.Load(4, &q.transformer) 367 } 368 369 func (ri *replicaInode) StateTypeName() string { 370 return "pkg/sentry/fsimpl/devpts.replicaInode" 371 } 372 373 func (ri *replicaInode) StateFields() []string { 374 return []string{ 375 "implStatFS", 376 "InodeAttrs", 377 "InodeNoopRefCount", 378 "InodeNotAnonymous", 379 "InodeNotDirectory", 380 "InodeNotSymlink", 381 "InodeWatches", 382 "locks", 383 "root", 384 "t", 385 } 386 } 387 388 func (ri *replicaInode) beforeSave() {} 389 390 // +checklocksignore 391 func (ri *replicaInode) StateSave(stateSinkObject state.Sink) { 392 ri.beforeSave() 393 stateSinkObject.Save(0, &ri.implStatFS) 394 stateSinkObject.Save(1, &ri.InodeAttrs) 395 stateSinkObject.Save(2, &ri.InodeNoopRefCount) 396 stateSinkObject.Save(3, &ri.InodeNotAnonymous) 397 stateSinkObject.Save(4, &ri.InodeNotDirectory) 398 stateSinkObject.Save(5, &ri.InodeNotSymlink) 399 stateSinkObject.Save(6, &ri.InodeWatches) 400 stateSinkObject.Save(7, &ri.locks) 401 stateSinkObject.Save(8, &ri.root) 402 stateSinkObject.Save(9, &ri.t) 403 } 404 405 func (ri *replicaInode) afterLoad(context.Context) {} 406 407 // +checklocksignore 408 func (ri *replicaInode) StateLoad(ctx context.Context, stateSourceObject state.Source) { 409 stateSourceObject.Load(0, &ri.implStatFS) 410 stateSourceObject.Load(1, &ri.InodeAttrs) 411 stateSourceObject.Load(2, &ri.InodeNoopRefCount) 412 stateSourceObject.Load(3, &ri.InodeNotAnonymous) 413 stateSourceObject.Load(4, &ri.InodeNotDirectory) 414 stateSourceObject.Load(5, &ri.InodeNotSymlink) 415 stateSourceObject.Load(6, &ri.InodeWatches) 416 stateSourceObject.Load(7, &ri.locks) 417 stateSourceObject.Load(8, &ri.root) 418 stateSourceObject.Load(9, &ri.t) 419 } 420 421 func (rfd *replicaFileDescription) StateTypeName() string { 422 return "pkg/sentry/fsimpl/devpts.replicaFileDescription" 423 } 424 425 func (rfd *replicaFileDescription) StateFields() []string { 426 return []string{ 427 "vfsfd", 428 "FileDescriptionDefaultImpl", 429 "LockFD", 430 "inode", 431 } 432 } 433 434 func (rfd *replicaFileDescription) beforeSave() {} 435 436 // +checklocksignore 437 func (rfd *replicaFileDescription) StateSave(stateSinkObject state.Sink) { 438 rfd.beforeSave() 439 stateSinkObject.Save(0, &rfd.vfsfd) 440 stateSinkObject.Save(1, &rfd.FileDescriptionDefaultImpl) 441 stateSinkObject.Save(2, &rfd.LockFD) 442 stateSinkObject.Save(3, &rfd.inode) 443 } 444 445 func (rfd *replicaFileDescription) afterLoad(context.Context) {} 446 447 // +checklocksignore 448 func (rfd *replicaFileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) { 449 stateSourceObject.Load(0, &rfd.vfsfd) 450 stateSourceObject.Load(1, &rfd.FileDescriptionDefaultImpl) 451 stateSourceObject.Load(2, &rfd.LockFD) 452 stateSourceObject.Load(3, &rfd.inode) 453 } 454 455 func (r *rootInodeRefs) StateTypeName() string { 456 return "pkg/sentry/fsimpl/devpts.rootInodeRefs" 457 } 458 459 func (r *rootInodeRefs) StateFields() []string { 460 return []string{ 461 "refCount", 462 } 463 } 464 465 func (r *rootInodeRefs) beforeSave() {} 466 467 // +checklocksignore 468 func (r *rootInodeRefs) StateSave(stateSinkObject state.Sink) { 469 r.beforeSave() 470 stateSinkObject.Save(0, &r.refCount) 471 } 472 473 // +checklocksignore 474 func (r *rootInodeRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 475 stateSourceObject.Load(0, &r.refCount) 476 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 477 } 478 479 func (t *Terminal) StateTypeName() string { 480 return "pkg/sentry/fsimpl/devpts.Terminal" 481 } 482 483 func (t *Terminal) StateFields() []string { 484 return []string{ 485 "n", 486 "ld", 487 "masterKTTY", 488 "replicaKTTY", 489 } 490 } 491 492 func (t *Terminal) beforeSave() {} 493 494 // +checklocksignore 495 func (t *Terminal) StateSave(stateSinkObject state.Sink) { 496 t.beforeSave() 497 stateSinkObject.Save(0, &t.n) 498 stateSinkObject.Save(1, &t.ld) 499 stateSinkObject.Save(2, &t.masterKTTY) 500 stateSinkObject.Save(3, &t.replicaKTTY) 501 } 502 503 func (t *Terminal) afterLoad(context.Context) {} 504 505 // +checklocksignore 506 func (t *Terminal) StateLoad(ctx context.Context, stateSourceObject state.Source) { 507 stateSourceObject.Load(0, &t.n) 508 stateSourceObject.Load(1, &t.ld) 509 stateSourceObject.Load(2, &t.masterKTTY) 510 stateSourceObject.Load(3, &t.replicaKTTY) 511 } 512 513 func init() { 514 state.Register((*FilesystemType)(nil)) 515 state.Register((*filesystem)(nil)) 516 state.Register((*rootInode)(nil)) 517 state.Register((*implStatFS)(nil)) 518 state.Register((*lineDiscipline)(nil)) 519 state.Register((*outputQueueTransformer)(nil)) 520 state.Register((*inputQueueTransformer)(nil)) 521 state.Register((*masterInode)(nil)) 522 state.Register((*masterFileDescription)(nil)) 523 state.Register((*queue)(nil)) 524 state.Register((*replicaInode)(nil)) 525 state.Register((*replicaFileDescription)(nil)) 526 state.Register((*rootInodeRefs)(nil)) 527 state.Register((*Terminal)(nil)) 528 }