github.com/ttpreport/gvisor-ligolo@v0.0.0-20240123134145-a858404967ba/pkg/sentry/fsimpl/lock/lock_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package lock
     4  
     5  import (
     6  	"github.com/ttpreport/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (o *OwnerInfo) StateTypeName() string {
    10  	return "pkg/sentry/fsimpl/lock.OwnerInfo"
    11  }
    12  
    13  func (o *OwnerInfo) StateFields() []string {
    14  	return []string{
    15  		"PID",
    16  		"OFD",
    17  	}
    18  }
    19  
    20  func (o *OwnerInfo) beforeSave() {}
    21  
    22  // +checklocksignore
    23  func (o *OwnerInfo) StateSave(stateSinkObject state.Sink) {
    24  	o.beforeSave()
    25  	stateSinkObject.Save(0, &o.PID)
    26  	stateSinkObject.Save(1, &o.OFD)
    27  }
    28  
    29  func (o *OwnerInfo) afterLoad() {}
    30  
    31  // +checklocksignore
    32  func (o *OwnerInfo) StateLoad(stateSourceObject state.Source) {
    33  	stateSourceObject.Load(0, &o.PID)
    34  	stateSourceObject.Load(1, &o.OFD)
    35  }
    36  
    37  func (l *Lock) StateTypeName() string {
    38  	return "pkg/sentry/fsimpl/lock.Lock"
    39  }
    40  
    41  func (l *Lock) StateFields() []string {
    42  	return []string{
    43  		"Readers",
    44  		"Writer",
    45  		"WriterInfo",
    46  	}
    47  }
    48  
    49  func (l *Lock) beforeSave() {}
    50  
    51  // +checklocksignore
    52  func (l *Lock) StateSave(stateSinkObject state.Sink) {
    53  	l.beforeSave()
    54  	stateSinkObject.Save(0, &l.Readers)
    55  	stateSinkObject.Save(1, &l.Writer)
    56  	stateSinkObject.Save(2, &l.WriterInfo)
    57  }
    58  
    59  func (l *Lock) afterLoad() {}
    60  
    61  // +checklocksignore
    62  func (l *Lock) StateLoad(stateSourceObject state.Source) {
    63  	stateSourceObject.Load(0, &l.Readers)
    64  	stateSourceObject.Load(1, &l.Writer)
    65  	stateSourceObject.Load(2, &l.WriterInfo)
    66  }
    67  
    68  func (l *Locks) StateTypeName() string {
    69  	return "pkg/sentry/fsimpl/lock.Locks"
    70  }
    71  
    72  func (l *Locks) StateFields() []string {
    73  	return []string{
    74  		"locks",
    75  		"blockedQueue",
    76  	}
    77  }
    78  
    79  func (l *Locks) beforeSave() {}
    80  
    81  // +checklocksignore
    82  func (l *Locks) StateSave(stateSinkObject state.Sink) {
    83  	l.beforeSave()
    84  	stateSinkObject.Save(0, &l.locks)
    85  	stateSinkObject.Save(1, &l.blockedQueue)
    86  }
    87  
    88  func (l *Locks) afterLoad() {}
    89  
    90  // +checklocksignore
    91  func (l *Locks) StateLoad(stateSourceObject state.Source) {
    92  	stateSourceObject.Load(0, &l.locks)
    93  	stateSourceObject.Load(1, &l.blockedQueue)
    94  }
    95  
    96  func (r *LockRange) StateTypeName() string {
    97  	return "pkg/sentry/fsimpl/lock.LockRange"
    98  }
    99  
   100  func (r *LockRange) StateFields() []string {
   101  	return []string{
   102  		"Start",
   103  		"End",
   104  	}
   105  }
   106  
   107  func (r *LockRange) beforeSave() {}
   108  
   109  // +checklocksignore
   110  func (r *LockRange) StateSave(stateSinkObject state.Sink) {
   111  	r.beforeSave()
   112  	stateSinkObject.Save(0, &r.Start)
   113  	stateSinkObject.Save(1, &r.End)
   114  }
   115  
   116  func (r *LockRange) afterLoad() {}
   117  
   118  // +checklocksignore
   119  func (r *LockRange) StateLoad(stateSourceObject state.Source) {
   120  	stateSourceObject.Load(0, &r.Start)
   121  	stateSourceObject.Load(1, &r.End)
   122  }
   123  
   124  func (s *LockSet) StateTypeName() string {
   125  	return "pkg/sentry/fsimpl/lock.LockSet"
   126  }
   127  
   128  func (s *LockSet) StateFields() []string {
   129  	return []string{
   130  		"root",
   131  	}
   132  }
   133  
   134  func (s *LockSet) beforeSave() {}
   135  
   136  // +checklocksignore
   137  func (s *LockSet) StateSave(stateSinkObject state.Sink) {
   138  	s.beforeSave()
   139  	var rootValue *LockSegmentDataSlices
   140  	rootValue = s.saveRoot()
   141  	stateSinkObject.SaveValue(0, rootValue)
   142  }
   143  
   144  func (s *LockSet) afterLoad() {}
   145  
   146  // +checklocksignore
   147  func (s *LockSet) StateLoad(stateSourceObject state.Source) {
   148  	stateSourceObject.LoadValue(0, new(*LockSegmentDataSlices), func(y any) { s.loadRoot(y.(*LockSegmentDataSlices)) })
   149  }
   150  
   151  func (n *Locknode) StateTypeName() string {
   152  	return "pkg/sentry/fsimpl/lock.Locknode"
   153  }
   154  
   155  func (n *Locknode) StateFields() []string {
   156  	return []string{
   157  		"nrSegments",
   158  		"parent",
   159  		"parentIndex",
   160  		"hasChildren",
   161  		"maxGap",
   162  		"keys",
   163  		"values",
   164  		"children",
   165  	}
   166  }
   167  
   168  func (n *Locknode) beforeSave() {}
   169  
   170  // +checklocksignore
   171  func (n *Locknode) StateSave(stateSinkObject state.Sink) {
   172  	n.beforeSave()
   173  	stateSinkObject.Save(0, &n.nrSegments)
   174  	stateSinkObject.Save(1, &n.parent)
   175  	stateSinkObject.Save(2, &n.parentIndex)
   176  	stateSinkObject.Save(3, &n.hasChildren)
   177  	stateSinkObject.Save(4, &n.maxGap)
   178  	stateSinkObject.Save(5, &n.keys)
   179  	stateSinkObject.Save(6, &n.values)
   180  	stateSinkObject.Save(7, &n.children)
   181  }
   182  
   183  func (n *Locknode) afterLoad() {}
   184  
   185  // +checklocksignore
   186  func (n *Locknode) StateLoad(stateSourceObject state.Source) {
   187  	stateSourceObject.Load(0, &n.nrSegments)
   188  	stateSourceObject.Load(1, &n.parent)
   189  	stateSourceObject.Load(2, &n.parentIndex)
   190  	stateSourceObject.Load(3, &n.hasChildren)
   191  	stateSourceObject.Load(4, &n.maxGap)
   192  	stateSourceObject.Load(5, &n.keys)
   193  	stateSourceObject.Load(6, &n.values)
   194  	stateSourceObject.Load(7, &n.children)
   195  }
   196  
   197  func (l *LockSegmentDataSlices) StateTypeName() string {
   198  	return "pkg/sentry/fsimpl/lock.LockSegmentDataSlices"
   199  }
   200  
   201  func (l *LockSegmentDataSlices) StateFields() []string {
   202  	return []string{
   203  		"Start",
   204  		"End",
   205  		"Values",
   206  	}
   207  }
   208  
   209  func (l *LockSegmentDataSlices) beforeSave() {}
   210  
   211  // +checklocksignore
   212  func (l *LockSegmentDataSlices) StateSave(stateSinkObject state.Sink) {
   213  	l.beforeSave()
   214  	stateSinkObject.Save(0, &l.Start)
   215  	stateSinkObject.Save(1, &l.End)
   216  	stateSinkObject.Save(2, &l.Values)
   217  }
   218  
   219  func (l *LockSegmentDataSlices) afterLoad() {}
   220  
   221  // +checklocksignore
   222  func (l *LockSegmentDataSlices) StateLoad(stateSourceObject state.Source) {
   223  	stateSourceObject.Load(0, &l.Start)
   224  	stateSourceObject.Load(1, &l.End)
   225  	stateSourceObject.Load(2, &l.Values)
   226  }
   227  
   228  func init() {
   229  	state.Register((*OwnerInfo)(nil))
   230  	state.Register((*Lock)(nil))
   231  	state.Register((*Locks)(nil))
   232  	state.Register((*LockRange)(nil))
   233  	state.Register((*LockSet)(nil))
   234  	state.Register((*Locknode)(nil))
   235  	state.Register((*LockSegmentDataSlices)(nil))
   236  }