github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/vfs/memxattr/memxattr_state_autogen.go (about)

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