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

     1  // automatically generated by stateify.
     2  
     3  package overlay
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (fd *directoryFD) StateTypeName() string {
    12  	return "pkg/sentry/fsimpl/overlay.directoryFD"
    13  }
    14  
    15  func (fd *directoryFD) StateFields() []string {
    16  	return []string{
    17  		"fileDescription",
    18  		"DirectoryFileDescriptionDefaultImpl",
    19  		"DentryMetadataFileDescriptionImpl",
    20  		"off",
    21  		"dirents",
    22  	}
    23  }
    24  
    25  func (fd *directoryFD) beforeSave() {}
    26  
    27  // +checklocksignore
    28  func (fd *directoryFD) StateSave(stateSinkObject state.Sink) {
    29  	fd.beforeSave()
    30  	stateSinkObject.Save(0, &fd.fileDescription)
    31  	stateSinkObject.Save(1, &fd.DirectoryFileDescriptionDefaultImpl)
    32  	stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl)
    33  	stateSinkObject.Save(3, &fd.off)
    34  	stateSinkObject.Save(4, &fd.dirents)
    35  }
    36  
    37  func (fd *directoryFD) afterLoad(context.Context) {}
    38  
    39  // +checklocksignore
    40  func (fd *directoryFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    41  	stateSourceObject.Load(0, &fd.fileDescription)
    42  	stateSourceObject.Load(1, &fd.DirectoryFileDescriptionDefaultImpl)
    43  	stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl)
    44  	stateSourceObject.Load(3, &fd.off)
    45  	stateSourceObject.Load(4, &fd.dirents)
    46  }
    47  
    48  func (fstype *FilesystemType) StateTypeName() string {
    49  	return "pkg/sentry/fsimpl/overlay.FilesystemType"
    50  }
    51  
    52  func (fstype *FilesystemType) StateFields() []string {
    53  	return []string{}
    54  }
    55  
    56  func (fstype *FilesystemType) beforeSave() {}
    57  
    58  // +checklocksignore
    59  func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink) {
    60  	fstype.beforeSave()
    61  }
    62  
    63  func (fstype *FilesystemType) afterLoad(context.Context) {}
    64  
    65  // +checklocksignore
    66  func (fstype *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    67  }
    68  
    69  func (f *FilesystemOptions) StateTypeName() string {
    70  	return "pkg/sentry/fsimpl/overlay.FilesystemOptions"
    71  }
    72  
    73  func (f *FilesystemOptions) StateFields() []string {
    74  	return []string{
    75  		"UpperRoot",
    76  		"LowerRoots",
    77  	}
    78  }
    79  
    80  func (f *FilesystemOptions) beforeSave() {}
    81  
    82  // +checklocksignore
    83  func (f *FilesystemOptions) StateSave(stateSinkObject state.Sink) {
    84  	f.beforeSave()
    85  	stateSinkObject.Save(0, &f.UpperRoot)
    86  	stateSinkObject.Save(1, &f.LowerRoots)
    87  }
    88  
    89  func (f *FilesystemOptions) afterLoad(context.Context) {}
    90  
    91  // +checklocksignore
    92  func (f *FilesystemOptions) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    93  	stateSourceObject.Load(0, &f.UpperRoot)
    94  	stateSourceObject.Load(1, &f.LowerRoots)
    95  }
    96  
    97  func (fs *filesystem) StateTypeName() string {
    98  	return "pkg/sentry/fsimpl/overlay.filesystem"
    99  }
   100  
   101  func (fs *filesystem) StateFields() []string {
   102  	return []string{
   103  		"vfsfs",
   104  		"opts",
   105  		"creds",
   106  		"dirDevMinor",
   107  		"lowerDevMinors",
   108  		"dirInoCache",
   109  		"lastDirIno",
   110  		"maxFilenameLen",
   111  	}
   112  }
   113  
   114  func (fs *filesystem) beforeSave() {}
   115  
   116  // +checklocksignore
   117  func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
   118  	fs.beforeSave()
   119  	stateSinkObject.Save(0, &fs.vfsfs)
   120  	stateSinkObject.Save(1, &fs.opts)
   121  	stateSinkObject.Save(2, &fs.creds)
   122  	stateSinkObject.Save(3, &fs.dirDevMinor)
   123  	stateSinkObject.Save(4, &fs.lowerDevMinors)
   124  	stateSinkObject.Save(5, &fs.dirInoCache)
   125  	stateSinkObject.Save(6, &fs.lastDirIno)
   126  	stateSinkObject.Save(7, &fs.maxFilenameLen)
   127  }
   128  
   129  func (fs *filesystem) afterLoad(context.Context) {}
   130  
   131  // +checklocksignore
   132  func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   133  	stateSourceObject.Load(0, &fs.vfsfs)
   134  	stateSourceObject.Load(1, &fs.opts)
   135  	stateSourceObject.Load(2, &fs.creds)
   136  	stateSourceObject.Load(3, &fs.dirDevMinor)
   137  	stateSourceObject.Load(4, &fs.lowerDevMinors)
   138  	stateSourceObject.Load(5, &fs.dirInoCache)
   139  	stateSourceObject.Load(6, &fs.lastDirIno)
   140  	stateSourceObject.Load(7, &fs.maxFilenameLen)
   141  }
   142  
   143  func (l *layerDevNumber) StateTypeName() string {
   144  	return "pkg/sentry/fsimpl/overlay.layerDevNumber"
   145  }
   146  
   147  func (l *layerDevNumber) StateFields() []string {
   148  	return []string{
   149  		"major",
   150  		"minor",
   151  	}
   152  }
   153  
   154  func (l *layerDevNumber) beforeSave() {}
   155  
   156  // +checklocksignore
   157  func (l *layerDevNumber) StateSave(stateSinkObject state.Sink) {
   158  	l.beforeSave()
   159  	stateSinkObject.Save(0, &l.major)
   160  	stateSinkObject.Save(1, &l.minor)
   161  }
   162  
   163  func (l *layerDevNumber) afterLoad(context.Context) {}
   164  
   165  // +checklocksignore
   166  func (l *layerDevNumber) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   167  	stateSourceObject.Load(0, &l.major)
   168  	stateSourceObject.Load(1, &l.minor)
   169  }
   170  
   171  func (l *layerDevNoAndIno) StateTypeName() string {
   172  	return "pkg/sentry/fsimpl/overlay.layerDevNoAndIno"
   173  }
   174  
   175  func (l *layerDevNoAndIno) StateFields() []string {
   176  	return []string{
   177  		"layerDevNumber",
   178  		"ino",
   179  	}
   180  }
   181  
   182  func (l *layerDevNoAndIno) beforeSave() {}
   183  
   184  // +checklocksignore
   185  func (l *layerDevNoAndIno) StateSave(stateSinkObject state.Sink) {
   186  	l.beforeSave()
   187  	stateSinkObject.Save(0, &l.layerDevNumber)
   188  	stateSinkObject.Save(1, &l.ino)
   189  }
   190  
   191  func (l *layerDevNoAndIno) afterLoad(context.Context) {}
   192  
   193  // +checklocksignore
   194  func (l *layerDevNoAndIno) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   195  	stateSourceObject.Load(0, &l.layerDevNumber)
   196  	stateSourceObject.Load(1, &l.ino)
   197  }
   198  
   199  func (d *dentry) StateTypeName() string {
   200  	return "pkg/sentry/fsimpl/overlay.dentry"
   201  }
   202  
   203  func (d *dentry) StateFields() []string {
   204  	return []string{
   205  		"vfsd",
   206  		"refs",
   207  		"fs",
   208  		"mode",
   209  		"uid",
   210  		"gid",
   211  		"copiedUp",
   212  		"parent",
   213  		"name",
   214  		"children",
   215  		"dirents",
   216  		"upperVD",
   217  		"lowerVDs",
   218  		"inlineLowerVDs",
   219  		"devMajor",
   220  		"devMinor",
   221  		"ino",
   222  		"lowerMappings",
   223  		"wrappedMappable",
   224  		"isMappable",
   225  		"locks",
   226  		"watches",
   227  	}
   228  }
   229  
   230  func (d *dentry) beforeSave() {}
   231  
   232  // +checklocksignore
   233  func (d *dentry) StateSave(stateSinkObject state.Sink) {
   234  	d.beforeSave()
   235  	var parentValue *dentry
   236  	parentValue = d.saveParent()
   237  	stateSinkObject.SaveValue(7, parentValue)
   238  	stateSinkObject.Save(0, &d.vfsd)
   239  	stateSinkObject.Save(1, &d.refs)
   240  	stateSinkObject.Save(2, &d.fs)
   241  	stateSinkObject.Save(3, &d.mode)
   242  	stateSinkObject.Save(4, &d.uid)
   243  	stateSinkObject.Save(5, &d.gid)
   244  	stateSinkObject.Save(6, &d.copiedUp)
   245  	stateSinkObject.Save(8, &d.name)
   246  	stateSinkObject.Save(9, &d.children)
   247  	stateSinkObject.Save(10, &d.dirents)
   248  	stateSinkObject.Save(11, &d.upperVD)
   249  	stateSinkObject.Save(12, &d.lowerVDs)
   250  	stateSinkObject.Save(13, &d.inlineLowerVDs)
   251  	stateSinkObject.Save(14, &d.devMajor)
   252  	stateSinkObject.Save(15, &d.devMinor)
   253  	stateSinkObject.Save(16, &d.ino)
   254  	stateSinkObject.Save(17, &d.lowerMappings)
   255  	stateSinkObject.Save(18, &d.wrappedMappable)
   256  	stateSinkObject.Save(19, &d.isMappable)
   257  	stateSinkObject.Save(20, &d.locks)
   258  	stateSinkObject.Save(21, &d.watches)
   259  }
   260  
   261  // +checklocksignore
   262  func (d *dentry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   263  	stateSourceObject.Load(0, &d.vfsd)
   264  	stateSourceObject.Load(1, &d.refs)
   265  	stateSourceObject.Load(2, &d.fs)
   266  	stateSourceObject.Load(3, &d.mode)
   267  	stateSourceObject.Load(4, &d.uid)
   268  	stateSourceObject.Load(5, &d.gid)
   269  	stateSourceObject.Load(6, &d.copiedUp)
   270  	stateSourceObject.Load(8, &d.name)
   271  	stateSourceObject.Load(9, &d.children)
   272  	stateSourceObject.Load(10, &d.dirents)
   273  	stateSourceObject.Load(11, &d.upperVD)
   274  	stateSourceObject.Load(12, &d.lowerVDs)
   275  	stateSourceObject.Load(13, &d.inlineLowerVDs)
   276  	stateSourceObject.Load(14, &d.devMajor)
   277  	stateSourceObject.Load(15, &d.devMinor)
   278  	stateSourceObject.Load(16, &d.ino)
   279  	stateSourceObject.Load(17, &d.lowerMappings)
   280  	stateSourceObject.Load(18, &d.wrappedMappable)
   281  	stateSourceObject.Load(19, &d.isMappable)
   282  	stateSourceObject.Load(20, &d.locks)
   283  	stateSourceObject.Load(21, &d.watches)
   284  	stateSourceObject.LoadValue(7, new(*dentry), func(y any) { d.loadParent(ctx, y.(*dentry)) })
   285  	stateSourceObject.AfterLoad(func() { d.afterLoad(ctx) })
   286  }
   287  
   288  func (fd *fileDescription) StateTypeName() string {
   289  	return "pkg/sentry/fsimpl/overlay.fileDescription"
   290  }
   291  
   292  func (fd *fileDescription) StateFields() []string {
   293  	return []string{
   294  		"vfsfd",
   295  		"FileDescriptionDefaultImpl",
   296  		"LockFD",
   297  	}
   298  }
   299  
   300  func (fd *fileDescription) beforeSave() {}
   301  
   302  // +checklocksignore
   303  func (fd *fileDescription) StateSave(stateSinkObject state.Sink) {
   304  	fd.beforeSave()
   305  	stateSinkObject.Save(0, &fd.vfsfd)
   306  	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
   307  	stateSinkObject.Save(2, &fd.LockFD)
   308  }
   309  
   310  func (fd *fileDescription) afterLoad(context.Context) {}
   311  
   312  // +checklocksignore
   313  func (fd *fileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   314  	stateSourceObject.Load(0, &fd.vfsfd)
   315  	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
   316  	stateSourceObject.Load(2, &fd.LockFD)
   317  }
   318  
   319  func (fd *regularFileFD) StateTypeName() string {
   320  	return "pkg/sentry/fsimpl/overlay.regularFileFD"
   321  }
   322  
   323  func (fd *regularFileFD) StateFields() []string {
   324  	return []string{
   325  		"fileDescription",
   326  		"copiedUp",
   327  		"cachedFD",
   328  		"cachedFlags",
   329  	}
   330  }
   331  
   332  func (fd *regularFileFD) beforeSave() {}
   333  
   334  // +checklocksignore
   335  func (fd *regularFileFD) StateSave(stateSinkObject state.Sink) {
   336  	fd.beforeSave()
   337  	stateSinkObject.Save(0, &fd.fileDescription)
   338  	stateSinkObject.Save(1, &fd.copiedUp)
   339  	stateSinkObject.Save(2, &fd.cachedFD)
   340  	stateSinkObject.Save(3, &fd.cachedFlags)
   341  }
   342  
   343  func (fd *regularFileFD) afterLoad(context.Context) {}
   344  
   345  // +checklocksignore
   346  func (fd *regularFileFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   347  	stateSourceObject.Load(0, &fd.fileDescription)
   348  	stateSourceObject.Load(1, &fd.copiedUp)
   349  	stateSourceObject.Load(2, &fd.cachedFD)
   350  	stateSourceObject.Load(3, &fd.cachedFlags)
   351  }
   352  
   353  func init() {
   354  	state.Register((*directoryFD)(nil))
   355  	state.Register((*FilesystemType)(nil))
   356  	state.Register((*FilesystemOptions)(nil))
   357  	state.Register((*filesystem)(nil))
   358  	state.Register((*layerDevNumber)(nil))
   359  	state.Register((*layerDevNoAndIno)(nil))
   360  	state.Register((*dentry)(nil))
   361  	state.Register((*fileDescription)(nil))
   362  	state.Register((*regularFileFD)(nil))
   363  }