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

     1  // automatically generated by stateify.
     2  
     3  package sys
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (r *dirRefs) StateTypeName() string {
    12  	return "pkg/sentry/fsimpl/sys.dirRefs"
    13  }
    14  
    15  func (r *dirRefs) StateFields() []string {
    16  	return []string{
    17  		"refCount",
    18  	}
    19  }
    20  
    21  func (r *dirRefs) beforeSave() {}
    22  
    23  // +checklocksignore
    24  func (r *dirRefs) StateSave(stateSinkObject state.Sink) {
    25  	r.beforeSave()
    26  	stateSinkObject.Save(0, &r.refCount)
    27  }
    28  
    29  // +checklocksignore
    30  func (r *dirRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    31  	stateSourceObject.Load(0, &r.refCount)
    32  	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
    33  }
    34  
    35  func (i *kcovInode) StateTypeName() string {
    36  	return "pkg/sentry/fsimpl/sys.kcovInode"
    37  }
    38  
    39  func (i *kcovInode) StateFields() []string {
    40  	return []string{
    41  		"InodeAttrs",
    42  		"InodeNoopRefCount",
    43  		"InodeNotAnonymous",
    44  		"InodeNotDirectory",
    45  		"InodeNotSymlink",
    46  		"InodeWatches",
    47  		"implStatFS",
    48  	}
    49  }
    50  
    51  func (i *kcovInode) beforeSave() {}
    52  
    53  // +checklocksignore
    54  func (i *kcovInode) StateSave(stateSinkObject state.Sink) {
    55  	i.beforeSave()
    56  	stateSinkObject.Save(0, &i.InodeAttrs)
    57  	stateSinkObject.Save(1, &i.InodeNoopRefCount)
    58  	stateSinkObject.Save(2, &i.InodeNotAnonymous)
    59  	stateSinkObject.Save(3, &i.InodeNotDirectory)
    60  	stateSinkObject.Save(4, &i.InodeNotSymlink)
    61  	stateSinkObject.Save(5, &i.InodeWatches)
    62  	stateSinkObject.Save(6, &i.implStatFS)
    63  }
    64  
    65  func (i *kcovInode) afterLoad(context.Context) {}
    66  
    67  // +checklocksignore
    68  func (i *kcovInode) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    69  	stateSourceObject.Load(0, &i.InodeAttrs)
    70  	stateSourceObject.Load(1, &i.InodeNoopRefCount)
    71  	stateSourceObject.Load(2, &i.InodeNotAnonymous)
    72  	stateSourceObject.Load(3, &i.InodeNotDirectory)
    73  	stateSourceObject.Load(4, &i.InodeNotSymlink)
    74  	stateSourceObject.Load(5, &i.InodeWatches)
    75  	stateSourceObject.Load(6, &i.implStatFS)
    76  }
    77  
    78  func (fd *kcovFD) StateTypeName() string {
    79  	return "pkg/sentry/fsimpl/sys.kcovFD"
    80  }
    81  
    82  func (fd *kcovFD) StateFields() []string {
    83  	return []string{
    84  		"FileDescriptionDefaultImpl",
    85  		"NoLockFD",
    86  		"vfsfd",
    87  		"inode",
    88  		"kcov",
    89  	}
    90  }
    91  
    92  func (fd *kcovFD) beforeSave() {}
    93  
    94  // +checklocksignore
    95  func (fd *kcovFD) StateSave(stateSinkObject state.Sink) {
    96  	fd.beforeSave()
    97  	stateSinkObject.Save(0, &fd.FileDescriptionDefaultImpl)
    98  	stateSinkObject.Save(1, &fd.NoLockFD)
    99  	stateSinkObject.Save(2, &fd.vfsfd)
   100  	stateSinkObject.Save(3, &fd.inode)
   101  	stateSinkObject.Save(4, &fd.kcov)
   102  }
   103  
   104  func (fd *kcovFD) afterLoad(context.Context) {}
   105  
   106  // +checklocksignore
   107  func (fd *kcovFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   108  	stateSourceObject.Load(0, &fd.FileDescriptionDefaultImpl)
   109  	stateSourceObject.Load(1, &fd.NoLockFD)
   110  	stateSourceObject.Load(2, &fd.vfsfd)
   111  	stateSourceObject.Load(3, &fd.inode)
   112  	stateSourceObject.Load(4, &fd.kcov)
   113  }
   114  
   115  func (gf *groTimeoutFile) StateTypeName() string {
   116  	return "pkg/sentry/fsimpl/sys.groTimeoutFile"
   117  }
   118  
   119  func (gf *groTimeoutFile) StateFields() []string {
   120  	return []string{
   121  		"implStatFS",
   122  		"DynamicBytesFile",
   123  		"idx",
   124  		"stk",
   125  	}
   126  }
   127  
   128  func (gf *groTimeoutFile) beforeSave() {}
   129  
   130  // +checklocksignore
   131  func (gf *groTimeoutFile) StateSave(stateSinkObject state.Sink) {
   132  	gf.beforeSave()
   133  	stateSinkObject.Save(0, &gf.implStatFS)
   134  	stateSinkObject.Save(1, &gf.DynamicBytesFile)
   135  	stateSinkObject.Save(2, &gf.idx)
   136  	stateSinkObject.Save(3, &gf.stk)
   137  }
   138  
   139  func (gf *groTimeoutFile) afterLoad(context.Context) {}
   140  
   141  // +checklocksignore
   142  func (gf *groTimeoutFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   143  	stateSourceObject.Load(0, &gf.implStatFS)
   144  	stateSourceObject.Load(1, &gf.DynamicBytesFile)
   145  	stateSourceObject.Load(2, &gf.idx)
   146  	stateSourceObject.Load(3, &gf.stk)
   147  }
   148  
   149  func (fsType *FilesystemType) StateTypeName() string {
   150  	return "pkg/sentry/fsimpl/sys.FilesystemType"
   151  }
   152  
   153  func (fsType *FilesystemType) StateFields() []string {
   154  	return []string{}
   155  }
   156  
   157  func (fsType *FilesystemType) beforeSave() {}
   158  
   159  // +checklocksignore
   160  func (fsType *FilesystemType) StateSave(stateSinkObject state.Sink) {
   161  	fsType.beforeSave()
   162  }
   163  
   164  func (fsType *FilesystemType) afterLoad(context.Context) {}
   165  
   166  // +checklocksignore
   167  func (fsType *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   168  }
   169  
   170  func (i *InternalData) StateTypeName() string {
   171  	return "pkg/sentry/fsimpl/sys.InternalData"
   172  }
   173  
   174  func (i *InternalData) StateFields() []string {
   175  	return []string{
   176  		"ProductName",
   177  		"EnableTPUProxyPaths",
   178  		"TestSysfsPathPrefix",
   179  	}
   180  }
   181  
   182  func (i *InternalData) beforeSave() {}
   183  
   184  // +checklocksignore
   185  func (i *InternalData) StateSave(stateSinkObject state.Sink) {
   186  	i.beforeSave()
   187  	stateSinkObject.Save(0, &i.ProductName)
   188  	stateSinkObject.Save(1, &i.EnableTPUProxyPaths)
   189  	stateSinkObject.Save(2, &i.TestSysfsPathPrefix)
   190  }
   191  
   192  func (i *InternalData) afterLoad(context.Context) {}
   193  
   194  // +checklocksignore
   195  func (i *InternalData) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   196  	stateSourceObject.Load(0, &i.ProductName)
   197  	stateSourceObject.Load(1, &i.EnableTPUProxyPaths)
   198  	stateSourceObject.Load(2, &i.TestSysfsPathPrefix)
   199  }
   200  
   201  func (fs *filesystem) StateTypeName() string {
   202  	return "pkg/sentry/fsimpl/sys.filesystem"
   203  }
   204  
   205  func (fs *filesystem) StateFields() []string {
   206  	return []string{
   207  		"Filesystem",
   208  		"devMinor",
   209  	}
   210  }
   211  
   212  func (fs *filesystem) beforeSave() {}
   213  
   214  // +checklocksignore
   215  func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
   216  	fs.beforeSave()
   217  	stateSinkObject.Save(0, &fs.Filesystem)
   218  	stateSinkObject.Save(1, &fs.devMinor)
   219  }
   220  
   221  func (fs *filesystem) afterLoad(context.Context) {}
   222  
   223  // +checklocksignore
   224  func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   225  	stateSourceObject.Load(0, &fs.Filesystem)
   226  	stateSourceObject.Load(1, &fs.devMinor)
   227  }
   228  
   229  func (d *dir) StateTypeName() string {
   230  	return "pkg/sentry/fsimpl/sys.dir"
   231  }
   232  
   233  func (d *dir) StateFields() []string {
   234  	return []string{
   235  		"dirRefs",
   236  		"InodeAlwaysValid",
   237  		"InodeAttrs",
   238  		"InodeDirectoryNoNewChildren",
   239  		"InodeNotAnonymous",
   240  		"InodeNotSymlink",
   241  		"InodeTemporary",
   242  		"InodeWatches",
   243  		"OrderedChildren",
   244  		"locks",
   245  	}
   246  }
   247  
   248  func (d *dir) beforeSave() {}
   249  
   250  // +checklocksignore
   251  func (d *dir) StateSave(stateSinkObject state.Sink) {
   252  	d.beforeSave()
   253  	stateSinkObject.Save(0, &d.dirRefs)
   254  	stateSinkObject.Save(1, &d.InodeAlwaysValid)
   255  	stateSinkObject.Save(2, &d.InodeAttrs)
   256  	stateSinkObject.Save(3, &d.InodeDirectoryNoNewChildren)
   257  	stateSinkObject.Save(4, &d.InodeNotAnonymous)
   258  	stateSinkObject.Save(5, &d.InodeNotSymlink)
   259  	stateSinkObject.Save(6, &d.InodeTemporary)
   260  	stateSinkObject.Save(7, &d.InodeWatches)
   261  	stateSinkObject.Save(8, &d.OrderedChildren)
   262  	stateSinkObject.Save(9, &d.locks)
   263  }
   264  
   265  func (d *dir) afterLoad(context.Context) {}
   266  
   267  // +checklocksignore
   268  func (d *dir) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   269  	stateSourceObject.Load(0, &d.dirRefs)
   270  	stateSourceObject.Load(1, &d.InodeAlwaysValid)
   271  	stateSourceObject.Load(2, &d.InodeAttrs)
   272  	stateSourceObject.Load(3, &d.InodeDirectoryNoNewChildren)
   273  	stateSourceObject.Load(4, &d.InodeNotAnonymous)
   274  	stateSourceObject.Load(5, &d.InodeNotSymlink)
   275  	stateSourceObject.Load(6, &d.InodeTemporary)
   276  	stateSourceObject.Load(7, &d.InodeWatches)
   277  	stateSourceObject.Load(8, &d.OrderedChildren)
   278  	stateSourceObject.Load(9, &d.locks)
   279  }
   280  
   281  func (d *cgroupDir) StateTypeName() string {
   282  	return "pkg/sentry/fsimpl/sys.cgroupDir"
   283  }
   284  
   285  func (d *cgroupDir) StateFields() []string {
   286  	return []string{
   287  		"dir",
   288  	}
   289  }
   290  
   291  func (d *cgroupDir) beforeSave() {}
   292  
   293  // +checklocksignore
   294  func (d *cgroupDir) StateSave(stateSinkObject state.Sink) {
   295  	d.beforeSave()
   296  	stateSinkObject.Save(0, &d.dir)
   297  }
   298  
   299  func (d *cgroupDir) afterLoad(context.Context) {}
   300  
   301  // +checklocksignore
   302  func (d *cgroupDir) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   303  	stateSourceObject.Load(0, &d.dir)
   304  }
   305  
   306  func (c *cpuFile) StateTypeName() string {
   307  	return "pkg/sentry/fsimpl/sys.cpuFile"
   308  }
   309  
   310  func (c *cpuFile) StateFields() []string {
   311  	return []string{
   312  		"implStatFS",
   313  		"DynamicBytesFile",
   314  		"maxCores",
   315  	}
   316  }
   317  
   318  func (c *cpuFile) beforeSave() {}
   319  
   320  // +checklocksignore
   321  func (c *cpuFile) StateSave(stateSinkObject state.Sink) {
   322  	c.beforeSave()
   323  	stateSinkObject.Save(0, &c.implStatFS)
   324  	stateSinkObject.Save(1, &c.DynamicBytesFile)
   325  	stateSinkObject.Save(2, &c.maxCores)
   326  }
   327  
   328  func (c *cpuFile) afterLoad(context.Context) {}
   329  
   330  // +checklocksignore
   331  func (c *cpuFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   332  	stateSourceObject.Load(0, &c.implStatFS)
   333  	stateSourceObject.Load(1, &c.DynamicBytesFile)
   334  	stateSourceObject.Load(2, &c.maxCores)
   335  }
   336  
   337  func (i *implStatFS) StateTypeName() string {
   338  	return "pkg/sentry/fsimpl/sys.implStatFS"
   339  }
   340  
   341  func (i *implStatFS) StateFields() []string {
   342  	return []string{}
   343  }
   344  
   345  func (i *implStatFS) beforeSave() {}
   346  
   347  // +checklocksignore
   348  func (i *implStatFS) StateSave(stateSinkObject state.Sink) {
   349  	i.beforeSave()
   350  }
   351  
   352  func (i *implStatFS) afterLoad(context.Context) {}
   353  
   354  // +checklocksignore
   355  func (i *implStatFS) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   356  }
   357  
   358  func (s *staticFile) StateTypeName() string {
   359  	return "pkg/sentry/fsimpl/sys.staticFile"
   360  }
   361  
   362  func (s *staticFile) StateFields() []string {
   363  	return []string{
   364  		"DynamicBytesFile",
   365  		"StaticData",
   366  	}
   367  }
   368  
   369  func (s *staticFile) beforeSave() {}
   370  
   371  // +checklocksignore
   372  func (s *staticFile) StateSave(stateSinkObject state.Sink) {
   373  	s.beforeSave()
   374  	stateSinkObject.Save(0, &s.DynamicBytesFile)
   375  	stateSinkObject.Save(1, &s.StaticData)
   376  }
   377  
   378  func (s *staticFile) afterLoad(context.Context) {}
   379  
   380  // +checklocksignore
   381  func (s *staticFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   382  	stateSourceObject.Load(0, &s.DynamicBytesFile)
   383  	stateSourceObject.Load(1, &s.StaticData)
   384  }
   385  
   386  func (hf *hostFile) StateTypeName() string {
   387  	return "pkg/sentry/fsimpl/sys.hostFile"
   388  }
   389  
   390  func (hf *hostFile) StateFields() []string {
   391  	return []string{
   392  		"DynamicBytesFile",
   393  		"hostPath",
   394  	}
   395  }
   396  
   397  func (hf *hostFile) beforeSave() {}
   398  
   399  // +checklocksignore
   400  func (hf *hostFile) StateSave(stateSinkObject state.Sink) {
   401  	hf.beforeSave()
   402  	stateSinkObject.Save(0, &hf.DynamicBytesFile)
   403  	stateSinkObject.Save(1, &hf.hostPath)
   404  }
   405  
   406  func (hf *hostFile) afterLoad(context.Context) {}
   407  
   408  // +checklocksignore
   409  func (hf *hostFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   410  	stateSourceObject.Load(0, &hf.DynamicBytesFile)
   411  	stateSourceObject.Load(1, &hf.hostPath)
   412  }
   413  
   414  func init() {
   415  	state.Register((*dirRefs)(nil))
   416  	state.Register((*kcovInode)(nil))
   417  	state.Register((*kcovFD)(nil))
   418  	state.Register((*groTimeoutFile)(nil))
   419  	state.Register((*FilesystemType)(nil))
   420  	state.Register((*InternalData)(nil))
   421  	state.Register((*filesystem)(nil))
   422  	state.Register((*dir)(nil))
   423  	state.Register((*cgroupDir)(nil))
   424  	state.Register((*cpuFile)(nil))
   425  	state.Register((*implStatFS)(nil))
   426  	state.Register((*staticFile)(nil))
   427  	state.Register((*hostFile)(nil))
   428  }