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

     1  // automatically generated by stateify.
     2  
     3  package iouringfs
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (fd *FileDescription) StateTypeName() string {
    12  	return "pkg/sentry/fsimpl/iouringfs.FileDescription"
    13  }
    14  
    15  func (fd *FileDescription) StateFields() []string {
    16  	return []string{
    17  		"vfsfd",
    18  		"FileDescriptionDefaultImpl",
    19  		"DentryMetadataFileDescriptionImpl",
    20  		"NoLockFD",
    21  		"rbmf",
    22  		"sqemf",
    23  		"running",
    24  		"ioRings",
    25  		"remap",
    26  	}
    27  }
    28  
    29  // +checklocksignore
    30  func (fd *FileDescription) StateSave(stateSinkObject state.Sink) {
    31  	fd.beforeSave()
    32  	stateSinkObject.Save(0, &fd.vfsfd)
    33  	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
    34  	stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl)
    35  	stateSinkObject.Save(3, &fd.NoLockFD)
    36  	stateSinkObject.Save(4, &fd.rbmf)
    37  	stateSinkObject.Save(5, &fd.sqemf)
    38  	stateSinkObject.Save(6, &fd.running)
    39  	stateSinkObject.Save(7, &fd.ioRings)
    40  	stateSinkObject.Save(8, &fd.remap)
    41  }
    42  
    43  // +checklocksignore
    44  func (fd *FileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    45  	stateSourceObject.Load(0, &fd.vfsfd)
    46  	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
    47  	stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl)
    48  	stateSourceObject.Load(3, &fd.NoLockFD)
    49  	stateSourceObject.Load(4, &fd.rbmf)
    50  	stateSourceObject.Load(5, &fd.sqemf)
    51  	stateSourceObject.Load(6, &fd.running)
    52  	stateSourceObject.Load(7, &fd.ioRings)
    53  	stateSourceObject.Load(8, &fd.remap)
    54  	stateSourceObject.AfterLoad(func() { fd.afterLoad(ctx) })
    55  }
    56  
    57  func (sqemf *sqEntriesFile) StateTypeName() string {
    58  	return "pkg/sentry/fsimpl/iouringfs.sqEntriesFile"
    59  }
    60  
    61  func (sqemf *sqEntriesFile) StateFields() []string {
    62  	return []string{
    63  		"fr",
    64  	}
    65  }
    66  
    67  func (sqemf *sqEntriesFile) beforeSave() {}
    68  
    69  // +checklocksignore
    70  func (sqemf *sqEntriesFile) StateSave(stateSinkObject state.Sink) {
    71  	sqemf.beforeSave()
    72  	stateSinkObject.Save(0, &sqemf.fr)
    73  }
    74  
    75  func (sqemf *sqEntriesFile) afterLoad(context.Context) {}
    76  
    77  // +checklocksignore
    78  func (sqemf *sqEntriesFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    79  	stateSourceObject.Load(0, &sqemf.fr)
    80  }
    81  
    82  func (rbmf *ringsBufferFile) StateTypeName() string {
    83  	return "pkg/sentry/fsimpl/iouringfs.ringsBufferFile"
    84  }
    85  
    86  func (rbmf *ringsBufferFile) StateFields() []string {
    87  	return []string{
    88  		"fr",
    89  	}
    90  }
    91  
    92  func (rbmf *ringsBufferFile) beforeSave() {}
    93  
    94  // +checklocksignore
    95  func (rbmf *ringsBufferFile) StateSave(stateSinkObject state.Sink) {
    96  	rbmf.beforeSave()
    97  	stateSinkObject.Save(0, &rbmf.fr)
    98  }
    99  
   100  func (rbmf *ringsBufferFile) afterLoad(context.Context) {}
   101  
   102  // +checklocksignore
   103  func (rbmf *ringsBufferFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   104  	stateSourceObject.Load(0, &rbmf.fr)
   105  }
   106  
   107  func init() {
   108  	state.Register((*FileDescription)(nil))
   109  	state.Register((*sqEntriesFile)(nil))
   110  	state.Register((*ringsBufferFile)(nil))
   111  }