github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/fsimpl/devtmpfs/devtmpfs_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package devtmpfs
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (fst *FilesystemType) StateTypeName() string {
    12  	return "pkg/sentry/fsimpl/devtmpfs.FilesystemType"
    13  }
    14  
    15  func (fst *FilesystemType) StateFields() []string {
    16  	return []string{
    17  		"initErr",
    18  		"fs",
    19  		"root",
    20  	}
    21  }
    22  
    23  func (fst *FilesystemType) beforeSave() {}
    24  
    25  // +checklocksignore
    26  func (fst *FilesystemType) StateSave(stateSinkObject state.Sink) {
    27  	fst.beforeSave()
    28  	stateSinkObject.Save(0, &fst.initErr)
    29  	stateSinkObject.Save(1, &fst.fs)
    30  	stateSinkObject.Save(2, &fst.root)
    31  }
    32  
    33  // +checklocksignore
    34  func (fst *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.Load(0, &fst.initErr)
    36  	stateSourceObject.Load(1, &fst.fs)
    37  	stateSourceObject.Load(2, &fst.root)
    38  	stateSourceObject.AfterLoad(func() { fst.afterLoad(ctx) })
    39  }
    40  
    41  func init() {
    42  	state.Register((*FilesystemType)(nil))
    43  }