github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/erofs/erofs_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package erofs
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/sagernet/gvisor/pkg/state"
     9  )
    10  
    11  func (sb *SuperBlock) StateTypeName() string {
    12  	return "pkg/erofs.SuperBlock"
    13  }
    14  
    15  func (sb *SuperBlock) StateFields() []string {
    16  	return []string{
    17  		"Magic",
    18  		"Checksum",
    19  		"FeatureCompat",
    20  		"BlockSizeBits",
    21  		"ExtSlots",
    22  		"RootNid",
    23  		"Inodes",
    24  		"BuildTime",
    25  		"BuildTimeNsec",
    26  		"Blocks",
    27  		"MetaBlockAddr",
    28  		"XattrBlockAddr",
    29  		"UUID",
    30  		"VolumeName",
    31  		"FeatureIncompat",
    32  		"Union1",
    33  		"ExtraDevices",
    34  		"DevTableSlotOff",
    35  		"Reserved",
    36  	}
    37  }
    38  
    39  func (sb *SuperBlock) beforeSave() {}
    40  
    41  // +checklocksignore
    42  func (sb *SuperBlock) StateSave(stateSinkObject state.Sink) {
    43  	sb.beforeSave()
    44  	stateSinkObject.Save(0, &sb.Magic)
    45  	stateSinkObject.Save(1, &sb.Checksum)
    46  	stateSinkObject.Save(2, &sb.FeatureCompat)
    47  	stateSinkObject.Save(3, &sb.BlockSizeBits)
    48  	stateSinkObject.Save(4, &sb.ExtSlots)
    49  	stateSinkObject.Save(5, &sb.RootNid)
    50  	stateSinkObject.Save(6, &sb.Inodes)
    51  	stateSinkObject.Save(7, &sb.BuildTime)
    52  	stateSinkObject.Save(8, &sb.BuildTimeNsec)
    53  	stateSinkObject.Save(9, &sb.Blocks)
    54  	stateSinkObject.Save(10, &sb.MetaBlockAddr)
    55  	stateSinkObject.Save(11, &sb.XattrBlockAddr)
    56  	stateSinkObject.Save(12, &sb.UUID)
    57  	stateSinkObject.Save(13, &sb.VolumeName)
    58  	stateSinkObject.Save(14, &sb.FeatureIncompat)
    59  	stateSinkObject.Save(15, &sb.Union1)
    60  	stateSinkObject.Save(16, &sb.ExtraDevices)
    61  	stateSinkObject.Save(17, &sb.DevTableSlotOff)
    62  	stateSinkObject.Save(18, &sb.Reserved)
    63  }
    64  
    65  func (sb *SuperBlock) afterLoad(context.Context) {}
    66  
    67  // +checklocksignore
    68  func (sb *SuperBlock) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    69  	stateSourceObject.Load(0, &sb.Magic)
    70  	stateSourceObject.Load(1, &sb.Checksum)
    71  	stateSourceObject.Load(2, &sb.FeatureCompat)
    72  	stateSourceObject.Load(3, &sb.BlockSizeBits)
    73  	stateSourceObject.Load(4, &sb.ExtSlots)
    74  	stateSourceObject.Load(5, &sb.RootNid)
    75  	stateSourceObject.Load(6, &sb.Inodes)
    76  	stateSourceObject.Load(7, &sb.BuildTime)
    77  	stateSourceObject.Load(8, &sb.BuildTimeNsec)
    78  	stateSourceObject.Load(9, &sb.Blocks)
    79  	stateSourceObject.Load(10, &sb.MetaBlockAddr)
    80  	stateSourceObject.Load(11, &sb.XattrBlockAddr)
    81  	stateSourceObject.Load(12, &sb.UUID)
    82  	stateSourceObject.Load(13, &sb.VolumeName)
    83  	stateSourceObject.Load(14, &sb.FeatureIncompat)
    84  	stateSourceObject.Load(15, &sb.Union1)
    85  	stateSourceObject.Load(16, &sb.ExtraDevices)
    86  	stateSourceObject.Load(17, &sb.DevTableSlotOff)
    87  	stateSourceObject.Load(18, &sb.Reserved)
    88  }
    89  
    90  func (i *Image) StateTypeName() string {
    91  	return "pkg/erofs.Image"
    92  }
    93  
    94  func (i *Image) StateFields() []string {
    95  	return []string{
    96  		"sb",
    97  	}
    98  }
    99  
   100  func (i *Image) beforeSave() {}
   101  
   102  // +checklocksignore
   103  func (i *Image) StateSave(stateSinkObject state.Sink) {
   104  	i.beforeSave()
   105  	stateSinkObject.Save(0, &i.sb)
   106  }
   107  
   108  func (i *Image) afterLoad(context.Context) {}
   109  
   110  // +checklocksignore
   111  func (i *Image) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   112  	stateSourceObject.Load(0, &i.sb)
   113  }
   114  
   115  func (i *Inode) StateTypeName() string {
   116  	return "pkg/erofs.Inode"
   117  }
   118  
   119  func (i *Inode) StateFields() []string {
   120  	return []string{
   121  		"image",
   122  		"dataOff",
   123  		"idataOff",
   124  		"blocks",
   125  		"format",
   126  		"mode",
   127  		"nid",
   128  		"size",
   129  		"mtime",
   130  		"mtimeNsec",
   131  		"uid",
   132  		"gid",
   133  		"nlink",
   134  	}
   135  }
   136  
   137  func (i *Inode) beforeSave() {}
   138  
   139  // +checklocksignore
   140  func (i *Inode) StateSave(stateSinkObject state.Sink) {
   141  	i.beforeSave()
   142  	stateSinkObject.Save(0, &i.image)
   143  	stateSinkObject.Save(1, &i.dataOff)
   144  	stateSinkObject.Save(2, &i.idataOff)
   145  	stateSinkObject.Save(3, &i.blocks)
   146  	stateSinkObject.Save(4, &i.format)
   147  	stateSinkObject.Save(5, &i.mode)
   148  	stateSinkObject.Save(6, &i.nid)
   149  	stateSinkObject.Save(7, &i.size)
   150  	stateSinkObject.Save(8, &i.mtime)
   151  	stateSinkObject.Save(9, &i.mtimeNsec)
   152  	stateSinkObject.Save(10, &i.uid)
   153  	stateSinkObject.Save(11, &i.gid)
   154  	stateSinkObject.Save(12, &i.nlink)
   155  }
   156  
   157  func (i *Inode) afterLoad(context.Context) {}
   158  
   159  // +checklocksignore
   160  func (i *Inode) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   161  	stateSourceObject.Load(0, &i.image)
   162  	stateSourceObject.Load(1, &i.dataOff)
   163  	stateSourceObject.Load(2, &i.idataOff)
   164  	stateSourceObject.Load(3, &i.blocks)
   165  	stateSourceObject.Load(4, &i.format)
   166  	stateSourceObject.Load(5, &i.mode)
   167  	stateSourceObject.Load(6, &i.nid)
   168  	stateSourceObject.Load(7, &i.size)
   169  	stateSourceObject.Load(8, &i.mtime)
   170  	stateSourceObject.Load(9, &i.mtimeNsec)
   171  	stateSourceObject.Load(10, &i.uid)
   172  	stateSourceObject.Load(11, &i.gid)
   173  	stateSourceObject.Load(12, &i.nlink)
   174  }
   175  
   176  func init() {
   177  	state.Register((*SuperBlock)(nil))
   178  	state.Register((*Image)(nil))
   179  	state.Register((*Inode)(nil))
   180  }