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

     1  // automatically generated by stateify.
     2  
     3  package tmpfs
     4  
     5  import (
     6  	"github.com/ttpreport/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (l *dentryList) StateTypeName() string {
    10  	return "pkg/sentry/fsimpl/tmpfs.dentryList"
    11  }
    12  
    13  func (l *dentryList) StateFields() []string {
    14  	return []string{
    15  		"head",
    16  		"tail",
    17  	}
    18  }
    19  
    20  func (l *dentryList) beforeSave() {}
    21  
    22  // +checklocksignore
    23  func (l *dentryList) StateSave(stateSinkObject state.Sink) {
    24  	l.beforeSave()
    25  	stateSinkObject.Save(0, &l.head)
    26  	stateSinkObject.Save(1, &l.tail)
    27  }
    28  
    29  func (l *dentryList) afterLoad() {}
    30  
    31  // +checklocksignore
    32  func (l *dentryList) StateLoad(stateSourceObject state.Source) {
    33  	stateSourceObject.Load(0, &l.head)
    34  	stateSourceObject.Load(1, &l.tail)
    35  }
    36  
    37  func (e *dentryEntry) StateTypeName() string {
    38  	return "pkg/sentry/fsimpl/tmpfs.dentryEntry"
    39  }
    40  
    41  func (e *dentryEntry) StateFields() []string {
    42  	return []string{
    43  		"next",
    44  		"prev",
    45  	}
    46  }
    47  
    48  func (e *dentryEntry) beforeSave() {}
    49  
    50  // +checklocksignore
    51  func (e *dentryEntry) StateSave(stateSinkObject state.Sink) {
    52  	e.beforeSave()
    53  	stateSinkObject.Save(0, &e.next)
    54  	stateSinkObject.Save(1, &e.prev)
    55  }
    56  
    57  func (e *dentryEntry) afterLoad() {}
    58  
    59  // +checklocksignore
    60  func (e *dentryEntry) StateLoad(stateSourceObject state.Source) {
    61  	stateSourceObject.Load(0, &e.next)
    62  	stateSourceObject.Load(1, &e.prev)
    63  }
    64  
    65  func (d *deviceFile) StateTypeName() string {
    66  	return "pkg/sentry/fsimpl/tmpfs.deviceFile"
    67  }
    68  
    69  func (d *deviceFile) StateFields() []string {
    70  	return []string{
    71  		"inode",
    72  		"kind",
    73  		"major",
    74  		"minor",
    75  	}
    76  }
    77  
    78  func (d *deviceFile) beforeSave() {}
    79  
    80  // +checklocksignore
    81  func (d *deviceFile) StateSave(stateSinkObject state.Sink) {
    82  	d.beforeSave()
    83  	stateSinkObject.Save(0, &d.inode)
    84  	stateSinkObject.Save(1, &d.kind)
    85  	stateSinkObject.Save(2, &d.major)
    86  	stateSinkObject.Save(3, &d.minor)
    87  }
    88  
    89  func (d *deviceFile) afterLoad() {}
    90  
    91  // +checklocksignore
    92  func (d *deviceFile) StateLoad(stateSourceObject state.Source) {
    93  	stateSourceObject.Load(0, &d.inode)
    94  	stateSourceObject.Load(1, &d.kind)
    95  	stateSourceObject.Load(2, &d.major)
    96  	stateSourceObject.Load(3, &d.minor)
    97  }
    98  
    99  func (dir *directory) StateTypeName() string {
   100  	return "pkg/sentry/fsimpl/tmpfs.directory"
   101  }
   102  
   103  func (dir *directory) StateFields() []string {
   104  	return []string{
   105  		"dentry",
   106  		"inode",
   107  		"childMap",
   108  		"numChildren",
   109  		"childList",
   110  	}
   111  }
   112  
   113  func (dir *directory) beforeSave() {}
   114  
   115  // +checklocksignore
   116  func (dir *directory) StateSave(stateSinkObject state.Sink) {
   117  	dir.beforeSave()
   118  	stateSinkObject.Save(0, &dir.dentry)
   119  	stateSinkObject.Save(1, &dir.inode)
   120  	stateSinkObject.Save(2, &dir.childMap)
   121  	stateSinkObject.Save(3, &dir.numChildren)
   122  	stateSinkObject.Save(4, &dir.childList)
   123  }
   124  
   125  func (dir *directory) afterLoad() {}
   126  
   127  // +checklocksignore
   128  func (dir *directory) StateLoad(stateSourceObject state.Source) {
   129  	stateSourceObject.Load(0, &dir.dentry)
   130  	stateSourceObject.Load(1, &dir.inode)
   131  	stateSourceObject.Load(2, &dir.childMap)
   132  	stateSourceObject.Load(3, &dir.numChildren)
   133  	stateSourceObject.Load(4, &dir.childList)
   134  }
   135  
   136  func (fd *directoryFD) StateTypeName() string {
   137  	return "pkg/sentry/fsimpl/tmpfs.directoryFD"
   138  }
   139  
   140  func (fd *directoryFD) StateFields() []string {
   141  	return []string{
   142  		"fileDescription",
   143  		"DirectoryFileDescriptionDefaultImpl",
   144  		"iter",
   145  		"off",
   146  	}
   147  }
   148  
   149  func (fd *directoryFD) beforeSave() {}
   150  
   151  // +checklocksignore
   152  func (fd *directoryFD) StateSave(stateSinkObject state.Sink) {
   153  	fd.beforeSave()
   154  	stateSinkObject.Save(0, &fd.fileDescription)
   155  	stateSinkObject.Save(1, &fd.DirectoryFileDescriptionDefaultImpl)
   156  	stateSinkObject.Save(2, &fd.iter)
   157  	stateSinkObject.Save(3, &fd.off)
   158  }
   159  
   160  func (fd *directoryFD) afterLoad() {}
   161  
   162  // +checklocksignore
   163  func (fd *directoryFD) StateLoad(stateSourceObject state.Source) {
   164  	stateSourceObject.Load(0, &fd.fileDescription)
   165  	stateSourceObject.Load(1, &fd.DirectoryFileDescriptionDefaultImpl)
   166  	stateSourceObject.Load(2, &fd.iter)
   167  	stateSourceObject.Load(3, &fd.off)
   168  }
   169  
   170  func (r *inodeRefs) StateTypeName() string {
   171  	return "pkg/sentry/fsimpl/tmpfs.inodeRefs"
   172  }
   173  
   174  func (r *inodeRefs) StateFields() []string {
   175  	return []string{
   176  		"refCount",
   177  	}
   178  }
   179  
   180  func (r *inodeRefs) beforeSave() {}
   181  
   182  // +checklocksignore
   183  func (r *inodeRefs) StateSave(stateSinkObject state.Sink) {
   184  	r.beforeSave()
   185  	stateSinkObject.Save(0, &r.refCount)
   186  }
   187  
   188  // +checklocksignore
   189  func (r *inodeRefs) StateLoad(stateSourceObject state.Source) {
   190  	stateSourceObject.Load(0, &r.refCount)
   191  	stateSourceObject.AfterLoad(r.afterLoad)
   192  }
   193  
   194  func (n *namedPipe) StateTypeName() string {
   195  	return "pkg/sentry/fsimpl/tmpfs.namedPipe"
   196  }
   197  
   198  func (n *namedPipe) StateFields() []string {
   199  	return []string{
   200  		"inode",
   201  		"pipe",
   202  	}
   203  }
   204  
   205  func (n *namedPipe) beforeSave() {}
   206  
   207  // +checklocksignore
   208  func (n *namedPipe) StateSave(stateSinkObject state.Sink) {
   209  	n.beforeSave()
   210  	stateSinkObject.Save(0, &n.inode)
   211  	stateSinkObject.Save(1, &n.pipe)
   212  }
   213  
   214  func (n *namedPipe) afterLoad() {}
   215  
   216  // +checklocksignore
   217  func (n *namedPipe) StateLoad(stateSourceObject state.Source) {
   218  	stateSourceObject.Load(0, &n.inode)
   219  	stateSourceObject.Load(1, &n.pipe)
   220  }
   221  
   222  func (rf *regularFile) StateTypeName() string {
   223  	return "pkg/sentry/fsimpl/tmpfs.regularFile"
   224  }
   225  
   226  func (rf *regularFile) StateFields() []string {
   227  	return []string{
   228  		"inode",
   229  		"memoryUsageKind",
   230  		"mappings",
   231  		"writableMappingPages",
   232  		"data",
   233  		"seals",
   234  		"size",
   235  	}
   236  }
   237  
   238  func (rf *regularFile) beforeSave() {}
   239  
   240  // +checklocksignore
   241  func (rf *regularFile) StateSave(stateSinkObject state.Sink) {
   242  	rf.beforeSave()
   243  	stateSinkObject.Save(0, &rf.inode)
   244  	stateSinkObject.Save(1, &rf.memoryUsageKind)
   245  	stateSinkObject.Save(2, &rf.mappings)
   246  	stateSinkObject.Save(3, &rf.writableMappingPages)
   247  	stateSinkObject.Save(4, &rf.data)
   248  	stateSinkObject.Save(5, &rf.seals)
   249  	stateSinkObject.Save(6, &rf.size)
   250  }
   251  
   252  func (rf *regularFile) afterLoad() {}
   253  
   254  // +checklocksignore
   255  func (rf *regularFile) StateLoad(stateSourceObject state.Source) {
   256  	stateSourceObject.Load(0, &rf.inode)
   257  	stateSourceObject.Load(1, &rf.memoryUsageKind)
   258  	stateSourceObject.Load(2, &rf.mappings)
   259  	stateSourceObject.Load(3, &rf.writableMappingPages)
   260  	stateSourceObject.Load(4, &rf.data)
   261  	stateSourceObject.Load(5, &rf.seals)
   262  	stateSourceObject.Load(6, &rf.size)
   263  }
   264  
   265  func (fd *regularFileFD) StateTypeName() string {
   266  	return "pkg/sentry/fsimpl/tmpfs.regularFileFD"
   267  }
   268  
   269  func (fd *regularFileFD) StateFields() []string {
   270  	return []string{
   271  		"fileDescription",
   272  		"off",
   273  	}
   274  }
   275  
   276  func (fd *regularFileFD) beforeSave() {}
   277  
   278  // +checklocksignore
   279  func (fd *regularFileFD) StateSave(stateSinkObject state.Sink) {
   280  	fd.beforeSave()
   281  	stateSinkObject.Save(0, &fd.fileDescription)
   282  	stateSinkObject.Save(1, &fd.off)
   283  }
   284  
   285  func (fd *regularFileFD) afterLoad() {}
   286  
   287  // +checklocksignore
   288  func (fd *regularFileFD) StateLoad(stateSourceObject state.Source) {
   289  	stateSourceObject.Load(0, &fd.fileDescription)
   290  	stateSourceObject.Load(1, &fd.off)
   291  }
   292  
   293  func (s *socketFile) StateTypeName() string {
   294  	return "pkg/sentry/fsimpl/tmpfs.socketFile"
   295  }
   296  
   297  func (s *socketFile) StateFields() []string {
   298  	return []string{
   299  		"inode",
   300  		"ep",
   301  	}
   302  }
   303  
   304  func (s *socketFile) beforeSave() {}
   305  
   306  // +checklocksignore
   307  func (s *socketFile) StateSave(stateSinkObject state.Sink) {
   308  	s.beforeSave()
   309  	stateSinkObject.Save(0, &s.inode)
   310  	stateSinkObject.Save(1, &s.ep)
   311  }
   312  
   313  func (s *socketFile) afterLoad() {}
   314  
   315  // +checklocksignore
   316  func (s *socketFile) StateLoad(stateSourceObject state.Source) {
   317  	stateSourceObject.Load(0, &s.inode)
   318  	stateSourceObject.Load(1, &s.ep)
   319  }
   320  
   321  func (s *symlink) StateTypeName() string {
   322  	return "pkg/sentry/fsimpl/tmpfs.symlink"
   323  }
   324  
   325  func (s *symlink) StateFields() []string {
   326  	return []string{
   327  		"inode",
   328  		"target",
   329  	}
   330  }
   331  
   332  func (s *symlink) beforeSave() {}
   333  
   334  // +checklocksignore
   335  func (s *symlink) StateSave(stateSinkObject state.Sink) {
   336  	s.beforeSave()
   337  	stateSinkObject.Save(0, &s.inode)
   338  	stateSinkObject.Save(1, &s.target)
   339  }
   340  
   341  func (s *symlink) afterLoad() {}
   342  
   343  // +checklocksignore
   344  func (s *symlink) StateLoad(stateSourceObject state.Source) {
   345  	stateSourceObject.Load(0, &s.inode)
   346  	stateSourceObject.Load(1, &s.target)
   347  }
   348  
   349  func (fstype *FilesystemType) StateTypeName() string {
   350  	return "pkg/sentry/fsimpl/tmpfs.FilesystemType"
   351  }
   352  
   353  func (fstype *FilesystemType) StateFields() []string {
   354  	return []string{}
   355  }
   356  
   357  func (fstype *FilesystemType) beforeSave() {}
   358  
   359  // +checklocksignore
   360  func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink) {
   361  	fstype.beforeSave()
   362  }
   363  
   364  func (fstype *FilesystemType) afterLoad() {}
   365  
   366  // +checklocksignore
   367  func (fstype *FilesystemType) StateLoad(stateSourceObject state.Source) {
   368  }
   369  
   370  func (fs *filesystem) StateTypeName() string {
   371  	return "pkg/sentry/fsimpl/tmpfs.filesystem"
   372  }
   373  
   374  func (fs *filesystem) StateFields() []string {
   375  	return []string{
   376  		"vfsfs",
   377  		"privateMF",
   378  		"mfp",
   379  		"clock",
   380  		"devMinor",
   381  		"mopts",
   382  		"usage",
   383  		"nextInoMinusOne",
   384  		"root",
   385  		"maxFilenameLen",
   386  		"maxSizeInPages",
   387  		"pagesUsed",
   388  	}
   389  }
   390  
   391  func (fs *filesystem) beforeSave() {}
   392  
   393  // +checklocksignore
   394  func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
   395  	fs.beforeSave()
   396  	stateSinkObject.Save(0, &fs.vfsfs)
   397  	stateSinkObject.Save(1, &fs.privateMF)
   398  	stateSinkObject.Save(2, &fs.mfp)
   399  	stateSinkObject.Save(3, &fs.clock)
   400  	stateSinkObject.Save(4, &fs.devMinor)
   401  	stateSinkObject.Save(5, &fs.mopts)
   402  	stateSinkObject.Save(6, &fs.usage)
   403  	stateSinkObject.Save(7, &fs.nextInoMinusOne)
   404  	stateSinkObject.Save(8, &fs.root)
   405  	stateSinkObject.Save(9, &fs.maxFilenameLen)
   406  	stateSinkObject.Save(10, &fs.maxSizeInPages)
   407  	stateSinkObject.Save(11, &fs.pagesUsed)
   408  }
   409  
   410  // +checklocksignore
   411  func (fs *filesystem) StateLoad(stateSourceObject state.Source) {
   412  	stateSourceObject.Load(0, &fs.vfsfs)
   413  	stateSourceObject.Load(1, &fs.privateMF)
   414  	stateSourceObject.Load(2, &fs.mfp)
   415  	stateSourceObject.Load(3, &fs.clock)
   416  	stateSourceObject.Load(4, &fs.devMinor)
   417  	stateSourceObject.Load(5, &fs.mopts)
   418  	stateSourceObject.Load(6, &fs.usage)
   419  	stateSourceObject.Load(7, &fs.nextInoMinusOne)
   420  	stateSourceObject.Load(8, &fs.root)
   421  	stateSourceObject.Load(9, &fs.maxFilenameLen)
   422  	stateSourceObject.Load(10, &fs.maxSizeInPages)
   423  	stateSourceObject.Load(11, &fs.pagesUsed)
   424  	stateSourceObject.AfterLoad(fs.afterLoad)
   425  }
   426  
   427  func (f *FilesystemOpts) StateTypeName() string {
   428  	return "pkg/sentry/fsimpl/tmpfs.FilesystemOpts"
   429  }
   430  
   431  func (f *FilesystemOpts) StateFields() []string {
   432  	return []string{
   433  		"RootFileType",
   434  		"RootSymlinkTarget",
   435  		"FilesystemType",
   436  		"Usage",
   437  		"MaxFilenameLen",
   438  		"FilestoreFD",
   439  		"DisableDefaultSizeLimit",
   440  	}
   441  }
   442  
   443  func (f *FilesystemOpts) beforeSave() {}
   444  
   445  // +checklocksignore
   446  func (f *FilesystemOpts) StateSave(stateSinkObject state.Sink) {
   447  	f.beforeSave()
   448  	stateSinkObject.Save(0, &f.RootFileType)
   449  	stateSinkObject.Save(1, &f.RootSymlinkTarget)
   450  	stateSinkObject.Save(2, &f.FilesystemType)
   451  	stateSinkObject.Save(3, &f.Usage)
   452  	stateSinkObject.Save(4, &f.MaxFilenameLen)
   453  	stateSinkObject.Save(5, &f.FilestoreFD)
   454  	stateSinkObject.Save(6, &f.DisableDefaultSizeLimit)
   455  }
   456  
   457  func (f *FilesystemOpts) afterLoad() {}
   458  
   459  // +checklocksignore
   460  func (f *FilesystemOpts) StateLoad(stateSourceObject state.Source) {
   461  	stateSourceObject.Load(0, &f.RootFileType)
   462  	stateSourceObject.Load(1, &f.RootSymlinkTarget)
   463  	stateSourceObject.Load(2, &f.FilesystemType)
   464  	stateSourceObject.Load(3, &f.Usage)
   465  	stateSourceObject.Load(4, &f.MaxFilenameLen)
   466  	stateSourceObject.Load(5, &f.FilestoreFD)
   467  	stateSourceObject.Load(6, &f.DisableDefaultSizeLimit)
   468  }
   469  
   470  func (d *dentry) StateTypeName() string {
   471  	return "pkg/sentry/fsimpl/tmpfs.dentry"
   472  }
   473  
   474  func (d *dentry) StateFields() []string {
   475  	return []string{
   476  		"vfsd",
   477  		"parent",
   478  		"name",
   479  		"dentryEntry",
   480  		"inode",
   481  	}
   482  }
   483  
   484  func (d *dentry) beforeSave() {}
   485  
   486  // +checklocksignore
   487  func (d *dentry) StateSave(stateSinkObject state.Sink) {
   488  	d.beforeSave()
   489  	stateSinkObject.Save(0, &d.vfsd)
   490  	stateSinkObject.Save(1, &d.parent)
   491  	stateSinkObject.Save(2, &d.name)
   492  	stateSinkObject.Save(3, &d.dentryEntry)
   493  	stateSinkObject.Save(4, &d.inode)
   494  }
   495  
   496  func (d *dentry) afterLoad() {}
   497  
   498  // +checklocksignore
   499  func (d *dentry) StateLoad(stateSourceObject state.Source) {
   500  	stateSourceObject.Load(0, &d.vfsd)
   501  	stateSourceObject.Load(1, &d.parent)
   502  	stateSourceObject.Load(2, &d.name)
   503  	stateSourceObject.Load(3, &d.dentryEntry)
   504  	stateSourceObject.Load(4, &d.inode)
   505  }
   506  
   507  func (i *inode) StateTypeName() string {
   508  	return "pkg/sentry/fsimpl/tmpfs.inode"
   509  }
   510  
   511  func (i *inode) StateFields() []string {
   512  	return []string{
   513  		"fs",
   514  		"refs",
   515  		"xattrs",
   516  		"mode",
   517  		"nlink",
   518  		"uid",
   519  		"gid",
   520  		"ino",
   521  		"atime",
   522  		"ctime",
   523  		"mtime",
   524  		"locks",
   525  		"watches",
   526  		"impl",
   527  	}
   528  }
   529  
   530  func (i *inode) beforeSave() {}
   531  
   532  // +checklocksignore
   533  func (i *inode) StateSave(stateSinkObject state.Sink) {
   534  	i.beforeSave()
   535  	stateSinkObject.Save(0, &i.fs)
   536  	stateSinkObject.Save(1, &i.refs)
   537  	stateSinkObject.Save(2, &i.xattrs)
   538  	stateSinkObject.Save(3, &i.mode)
   539  	stateSinkObject.Save(4, &i.nlink)
   540  	stateSinkObject.Save(5, &i.uid)
   541  	stateSinkObject.Save(6, &i.gid)
   542  	stateSinkObject.Save(7, &i.ino)
   543  	stateSinkObject.Save(8, &i.atime)
   544  	stateSinkObject.Save(9, &i.ctime)
   545  	stateSinkObject.Save(10, &i.mtime)
   546  	stateSinkObject.Save(11, &i.locks)
   547  	stateSinkObject.Save(12, &i.watches)
   548  	stateSinkObject.Save(13, &i.impl)
   549  }
   550  
   551  func (i *inode) afterLoad() {}
   552  
   553  // +checklocksignore
   554  func (i *inode) StateLoad(stateSourceObject state.Source) {
   555  	stateSourceObject.Load(0, &i.fs)
   556  	stateSourceObject.Load(1, &i.refs)
   557  	stateSourceObject.Load(2, &i.xattrs)
   558  	stateSourceObject.Load(3, &i.mode)
   559  	stateSourceObject.Load(4, &i.nlink)
   560  	stateSourceObject.Load(5, &i.uid)
   561  	stateSourceObject.Load(6, &i.gid)
   562  	stateSourceObject.Load(7, &i.ino)
   563  	stateSourceObject.Load(8, &i.atime)
   564  	stateSourceObject.Load(9, &i.ctime)
   565  	stateSourceObject.Load(10, &i.mtime)
   566  	stateSourceObject.Load(11, &i.locks)
   567  	stateSourceObject.Load(12, &i.watches)
   568  	stateSourceObject.Load(13, &i.impl)
   569  }
   570  
   571  func (fd *fileDescription) StateTypeName() string {
   572  	return "pkg/sentry/fsimpl/tmpfs.fileDescription"
   573  }
   574  
   575  func (fd *fileDescription) StateFields() []string {
   576  	return []string{
   577  		"vfsfd",
   578  		"FileDescriptionDefaultImpl",
   579  		"LockFD",
   580  	}
   581  }
   582  
   583  func (fd *fileDescription) beforeSave() {}
   584  
   585  // +checklocksignore
   586  func (fd *fileDescription) StateSave(stateSinkObject state.Sink) {
   587  	fd.beforeSave()
   588  	stateSinkObject.Save(0, &fd.vfsfd)
   589  	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
   590  	stateSinkObject.Save(2, &fd.LockFD)
   591  }
   592  
   593  func (fd *fileDescription) afterLoad() {}
   594  
   595  // +checklocksignore
   596  func (fd *fileDescription) StateLoad(stateSourceObject state.Source) {
   597  	stateSourceObject.Load(0, &fd.vfsfd)
   598  	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
   599  	stateSourceObject.Load(2, &fd.LockFD)
   600  }
   601  
   602  func init() {
   603  	state.Register((*dentryList)(nil))
   604  	state.Register((*dentryEntry)(nil))
   605  	state.Register((*deviceFile)(nil))
   606  	state.Register((*directory)(nil))
   607  	state.Register((*directoryFD)(nil))
   608  	state.Register((*inodeRefs)(nil))
   609  	state.Register((*namedPipe)(nil))
   610  	state.Register((*regularFile)(nil))
   611  	state.Register((*regularFileFD)(nil))
   612  	state.Register((*socketFile)(nil))
   613  	state.Register((*symlink)(nil))
   614  	state.Register((*FilesystemType)(nil))
   615  	state.Register((*filesystem)(nil))
   616  	state.Register((*FilesystemOpts)(nil))
   617  	state.Register((*dentry)(nil))
   618  	state.Register((*inode)(nil))
   619  	state.Register((*fileDescription)(nil))
   620  }