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

     1  // automatically generated by stateify.
     2  
     3  package nsfs
     4  
     5  import (
     6  	"github.com/ttpreport/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (r *inodeRefs) StateTypeName() string {
    10  	return "pkg/sentry/fsimpl/nsfs.inodeRefs"
    11  }
    12  
    13  func (r *inodeRefs) StateFields() []string {
    14  	return []string{
    15  		"refCount",
    16  	}
    17  }
    18  
    19  func (r *inodeRefs) beforeSave() {}
    20  
    21  // +checklocksignore
    22  func (r *inodeRefs) StateSave(stateSinkObject state.Sink) {
    23  	r.beforeSave()
    24  	stateSinkObject.Save(0, &r.refCount)
    25  }
    26  
    27  // +checklocksignore
    28  func (r *inodeRefs) StateLoad(stateSourceObject state.Source) {
    29  	stateSourceObject.Load(0, &r.refCount)
    30  	stateSourceObject.AfterLoad(r.afterLoad)
    31  }
    32  
    33  func (f *filesystemType) StateTypeName() string {
    34  	return "pkg/sentry/fsimpl/nsfs.filesystemType"
    35  }
    36  
    37  func (f *filesystemType) StateFields() []string {
    38  	return []string{}
    39  }
    40  
    41  func (f *filesystemType) beforeSave() {}
    42  
    43  // +checklocksignore
    44  func (f *filesystemType) StateSave(stateSinkObject state.Sink) {
    45  	f.beforeSave()
    46  }
    47  
    48  func (f *filesystemType) afterLoad() {}
    49  
    50  // +checklocksignore
    51  func (f *filesystemType) StateLoad(stateSourceObject state.Source) {
    52  }
    53  
    54  func (fs *filesystem) StateTypeName() string {
    55  	return "pkg/sentry/fsimpl/nsfs.filesystem"
    56  }
    57  
    58  func (fs *filesystem) StateFields() []string {
    59  	return []string{
    60  		"Filesystem",
    61  		"devMinor",
    62  	}
    63  }
    64  
    65  func (fs *filesystem) beforeSave() {}
    66  
    67  // +checklocksignore
    68  func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
    69  	fs.beforeSave()
    70  	stateSinkObject.Save(0, &fs.Filesystem)
    71  	stateSinkObject.Save(1, &fs.devMinor)
    72  }
    73  
    74  func (fs *filesystem) afterLoad() {}
    75  
    76  // +checklocksignore
    77  func (fs *filesystem) StateLoad(stateSourceObject state.Source) {
    78  	stateSourceObject.Load(0, &fs.Filesystem)
    79  	stateSourceObject.Load(1, &fs.devMinor)
    80  }
    81  
    82  func (i *Inode) StateTypeName() string {
    83  	return "pkg/sentry/fsimpl/nsfs.Inode"
    84  }
    85  
    86  func (i *Inode) StateFields() []string {
    87  	return []string{
    88  		"InodeAttrs",
    89  		"InodeNotAnonymous",
    90  		"InodeNotDirectory",
    91  		"InodeNotSymlink",
    92  		"InodeWatches",
    93  		"inodeRefs",
    94  		"locks",
    95  		"namespace",
    96  		"mnt",
    97  	}
    98  }
    99  
   100  func (i *Inode) beforeSave() {}
   101  
   102  // +checklocksignore
   103  func (i *Inode) StateSave(stateSinkObject state.Sink) {
   104  	i.beforeSave()
   105  	stateSinkObject.Save(0, &i.InodeAttrs)
   106  	stateSinkObject.Save(1, &i.InodeNotAnonymous)
   107  	stateSinkObject.Save(2, &i.InodeNotDirectory)
   108  	stateSinkObject.Save(3, &i.InodeNotSymlink)
   109  	stateSinkObject.Save(4, &i.InodeWatches)
   110  	stateSinkObject.Save(5, &i.inodeRefs)
   111  	stateSinkObject.Save(6, &i.locks)
   112  	stateSinkObject.Save(7, &i.namespace)
   113  	stateSinkObject.Save(8, &i.mnt)
   114  }
   115  
   116  func (i *Inode) afterLoad() {}
   117  
   118  // +checklocksignore
   119  func (i *Inode) StateLoad(stateSourceObject state.Source) {
   120  	stateSourceObject.Load(0, &i.InodeAttrs)
   121  	stateSourceObject.Load(1, &i.InodeNotAnonymous)
   122  	stateSourceObject.Load(2, &i.InodeNotDirectory)
   123  	stateSourceObject.Load(3, &i.InodeNotSymlink)
   124  	stateSourceObject.Load(4, &i.InodeWatches)
   125  	stateSourceObject.Load(5, &i.inodeRefs)
   126  	stateSourceObject.Load(6, &i.locks)
   127  	stateSourceObject.Load(7, &i.namespace)
   128  	stateSourceObject.Load(8, &i.mnt)
   129  }
   130  
   131  func (fd *namespaceFD) StateTypeName() string {
   132  	return "pkg/sentry/fsimpl/nsfs.namespaceFD"
   133  }
   134  
   135  func (fd *namespaceFD) StateFields() []string {
   136  	return []string{
   137  		"FileDescriptionDefaultImpl",
   138  		"LockFD",
   139  		"vfsfd",
   140  		"inode",
   141  	}
   142  }
   143  
   144  func (fd *namespaceFD) beforeSave() {}
   145  
   146  // +checklocksignore
   147  func (fd *namespaceFD) StateSave(stateSinkObject state.Sink) {
   148  	fd.beforeSave()
   149  	stateSinkObject.Save(0, &fd.FileDescriptionDefaultImpl)
   150  	stateSinkObject.Save(1, &fd.LockFD)
   151  	stateSinkObject.Save(2, &fd.vfsfd)
   152  	stateSinkObject.Save(3, &fd.inode)
   153  }
   154  
   155  func (fd *namespaceFD) afterLoad() {}
   156  
   157  // +checklocksignore
   158  func (fd *namespaceFD) StateLoad(stateSourceObject state.Source) {
   159  	stateSourceObject.Load(0, &fd.FileDescriptionDefaultImpl)
   160  	stateSourceObject.Load(1, &fd.LockFD)
   161  	stateSourceObject.Load(2, &fd.vfsfd)
   162  	stateSourceObject.Load(3, &fd.inode)
   163  }
   164  
   165  func init() {
   166  	state.Register((*inodeRefs)(nil))
   167  	state.Register((*filesystemType)(nil))
   168  	state.Register((*filesystem)(nil))
   169  	state.Register((*Inode)(nil))
   170  	state.Register((*namespaceFD)(nil))
   171  }