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

     1  // automatically generated by stateify.
     2  
     3  package timerfd
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (tfd *TimerFileDescription) StateTypeName() string {
    12  	return "pkg/sentry/fsimpl/timerfd.TimerFileDescription"
    13  }
    14  
    15  func (tfd *TimerFileDescription) StateFields() []string {
    16  	return []string{
    17  		"vfsfd",
    18  		"FileDescriptionDefaultImpl",
    19  		"DentryMetadataFileDescriptionImpl",
    20  		"NoLockFD",
    21  		"events",
    22  		"timer",
    23  		"val",
    24  	}
    25  }
    26  
    27  func (tfd *TimerFileDescription) beforeSave() {}
    28  
    29  // +checklocksignore
    30  func (tfd *TimerFileDescription) StateSave(stateSinkObject state.Sink) {
    31  	tfd.beforeSave()
    32  	stateSinkObject.Save(0, &tfd.vfsfd)
    33  	stateSinkObject.Save(1, &tfd.FileDescriptionDefaultImpl)
    34  	stateSinkObject.Save(2, &tfd.DentryMetadataFileDescriptionImpl)
    35  	stateSinkObject.Save(3, &tfd.NoLockFD)
    36  	stateSinkObject.Save(4, &tfd.events)
    37  	stateSinkObject.Save(5, &tfd.timer)
    38  	stateSinkObject.Save(6, &tfd.val)
    39  }
    40  
    41  func (tfd *TimerFileDescription) afterLoad(context.Context) {}
    42  
    43  // +checklocksignore
    44  func (tfd *TimerFileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    45  	stateSourceObject.Load(0, &tfd.vfsfd)
    46  	stateSourceObject.Load(1, &tfd.FileDescriptionDefaultImpl)
    47  	stateSourceObject.Load(2, &tfd.DentryMetadataFileDescriptionImpl)
    48  	stateSourceObject.Load(3, &tfd.NoLockFD)
    49  	stateSourceObject.Load(4, &tfd.events)
    50  	stateSourceObject.Load(5, &tfd.timer)
    51  	stateSourceObject.Load(6, &tfd.val)
    52  }
    53  
    54  func init() {
    55  	state.Register((*TimerFileDescription)(nil))
    56  }