github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/lisafs/lisafs_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package lisafs 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (r *boundSocketFDRefs) StateTypeName() string { 12 return "pkg/lisafs.boundSocketFDRefs" 13 } 14 15 func (r *boundSocketFDRefs) StateFields() []string { 16 return []string{ 17 "refCount", 18 } 19 } 20 21 func (r *boundSocketFDRefs) beforeSave() {} 22 23 // +checklocksignore 24 func (r *boundSocketFDRefs) StateSave(stateSinkObject state.Sink) { 25 r.beforeSave() 26 stateSinkObject.Save(0, &r.refCount) 27 } 28 29 // +checklocksignore 30 func (r *boundSocketFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 31 stateSourceObject.Load(0, &r.refCount) 32 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 33 } 34 35 func (l *controlFDList) StateTypeName() string { 36 return "pkg/lisafs.controlFDList" 37 } 38 39 func (l *controlFDList) StateFields() []string { 40 return []string{ 41 "head", 42 "tail", 43 } 44 } 45 46 func (l *controlFDList) beforeSave() {} 47 48 // +checklocksignore 49 func (l *controlFDList) StateSave(stateSinkObject state.Sink) { 50 l.beforeSave() 51 stateSinkObject.Save(0, &l.head) 52 stateSinkObject.Save(1, &l.tail) 53 } 54 55 func (l *controlFDList) afterLoad(context.Context) {} 56 57 // +checklocksignore 58 func (l *controlFDList) StateLoad(ctx context.Context, stateSourceObject state.Source) { 59 stateSourceObject.Load(0, &l.head) 60 stateSourceObject.Load(1, &l.tail) 61 } 62 63 func (e *controlFDEntry) StateTypeName() string { 64 return "pkg/lisafs.controlFDEntry" 65 } 66 67 func (e *controlFDEntry) StateFields() []string { 68 return []string{ 69 "next", 70 "prev", 71 } 72 } 73 74 func (e *controlFDEntry) beforeSave() {} 75 76 // +checklocksignore 77 func (e *controlFDEntry) StateSave(stateSinkObject state.Sink) { 78 e.beforeSave() 79 stateSinkObject.Save(0, &e.next) 80 stateSinkObject.Save(1, &e.prev) 81 } 82 83 func (e *controlFDEntry) afterLoad(context.Context) {} 84 85 // +checklocksignore 86 func (e *controlFDEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 87 stateSourceObject.Load(0, &e.next) 88 stateSourceObject.Load(1, &e.prev) 89 } 90 91 func (r *controlFDRefs) StateTypeName() string { 92 return "pkg/lisafs.controlFDRefs" 93 } 94 95 func (r *controlFDRefs) StateFields() []string { 96 return []string{ 97 "refCount", 98 } 99 } 100 101 func (r *controlFDRefs) beforeSave() {} 102 103 // +checklocksignore 104 func (r *controlFDRefs) StateSave(stateSinkObject state.Sink) { 105 r.beforeSave() 106 stateSinkObject.Save(0, &r.refCount) 107 } 108 109 // +checklocksignore 110 func (r *controlFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 111 stateSourceObject.Load(0, &r.refCount) 112 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 113 } 114 115 func (r *nodeRefs) StateTypeName() string { 116 return "pkg/lisafs.nodeRefs" 117 } 118 119 func (r *nodeRefs) StateFields() []string { 120 return []string{ 121 "refCount", 122 } 123 } 124 125 func (r *nodeRefs) beforeSave() {} 126 127 // +checklocksignore 128 func (r *nodeRefs) StateSave(stateSinkObject state.Sink) { 129 r.beforeSave() 130 stateSinkObject.Save(0, &r.refCount) 131 } 132 133 // +checklocksignore 134 func (r *nodeRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 135 stateSourceObject.Load(0, &r.refCount) 136 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 137 } 138 139 func (l *openFDList) StateTypeName() string { 140 return "pkg/lisafs.openFDList" 141 } 142 143 func (l *openFDList) StateFields() []string { 144 return []string{ 145 "head", 146 "tail", 147 } 148 } 149 150 func (l *openFDList) beforeSave() {} 151 152 // +checklocksignore 153 func (l *openFDList) StateSave(stateSinkObject state.Sink) { 154 l.beforeSave() 155 stateSinkObject.Save(0, &l.head) 156 stateSinkObject.Save(1, &l.tail) 157 } 158 159 func (l *openFDList) afterLoad(context.Context) {} 160 161 // +checklocksignore 162 func (l *openFDList) StateLoad(ctx context.Context, stateSourceObject state.Source) { 163 stateSourceObject.Load(0, &l.head) 164 stateSourceObject.Load(1, &l.tail) 165 } 166 167 func (e *openFDEntry) StateTypeName() string { 168 return "pkg/lisafs.openFDEntry" 169 } 170 171 func (e *openFDEntry) StateFields() []string { 172 return []string{ 173 "next", 174 "prev", 175 } 176 } 177 178 func (e *openFDEntry) beforeSave() {} 179 180 // +checklocksignore 181 func (e *openFDEntry) StateSave(stateSinkObject state.Sink) { 182 e.beforeSave() 183 stateSinkObject.Save(0, &e.next) 184 stateSinkObject.Save(1, &e.prev) 185 } 186 187 func (e *openFDEntry) afterLoad(context.Context) {} 188 189 // +checklocksignore 190 func (e *openFDEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 191 stateSourceObject.Load(0, &e.next) 192 stateSourceObject.Load(1, &e.prev) 193 } 194 195 func (r *openFDRefs) StateTypeName() string { 196 return "pkg/lisafs.openFDRefs" 197 } 198 199 func (r *openFDRefs) StateFields() []string { 200 return []string{ 201 "refCount", 202 } 203 } 204 205 func (r *openFDRefs) beforeSave() {} 206 207 // +checklocksignore 208 func (r *openFDRefs) StateSave(stateSinkObject state.Sink) { 209 r.beforeSave() 210 stateSinkObject.Save(0, &r.refCount) 211 } 212 213 // +checklocksignore 214 func (r *openFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) { 215 stateSourceObject.Load(0, &r.refCount) 216 stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) }) 217 } 218 219 func init() { 220 state.Register((*boundSocketFDRefs)(nil)) 221 state.Register((*controlFDList)(nil)) 222 state.Register((*controlFDEntry)(nil)) 223 state.Register((*controlFDRefs)(nil)) 224 state.Register((*nodeRefs)(nil)) 225 state.Register((*openFDList)(nil)) 226 state.Register((*openFDEntry)(nil)) 227 state.Register((*openFDRefs)(nil)) 228 }