summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/limits/limits_state_autogen.go
blob: 038124f763ba0a02e9c28399656a614ec0328a50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// automatically generated by stateify.

package limits

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (l *Limit) StateTypeName() string {
	return "pkg/sentry/limits.Limit"
}

func (l *Limit) StateFields() []string {
	return []string{
		"Cur",
		"Max",
	}
}

func (l *Limit) beforeSave() {}

// +checklocksignore
func (l *Limit) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.Cur)
	stateSinkObject.Save(1, &l.Max)
}

func (l *Limit) afterLoad() {}

// +checklocksignore
func (l *Limit) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.Cur)
	stateSourceObject.Load(1, &l.Max)
}

func (l *LimitSet) StateTypeName() string {
	return "pkg/sentry/limits.LimitSet"
}

func (l *LimitSet) StateFields() []string {
	return []string{
		"data",
	}
}

func (l *LimitSet) beforeSave() {}

// +checklocksignore
func (l *LimitSet) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.data)
}

func (l *LimitSet) afterLoad() {}

// +checklocksignore
func (l *LimitSet) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.data)
}

func init() {
	state.Register((*Limit)(nil))
	state.Register((*LimitSet)(nil))
}