File: pipe_state_autogen.go

package info (click to toggle)
golang-gvisor-gvisor 0.0~20221219.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 17,136 kB
  • sloc: asm: 2,860; cpp: 348; python: 89; sh: 40; makefile: 34; ansic: 21
file content (129 lines) | stat: -rw-r--r-- 3,071 bytes parent folder | download
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// automatically generated by stateify.

package pipe

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

func (p *Pipe) StateTypeName() string {
	return "pkg/sentry/kernel/pipe.Pipe"
}

func (p *Pipe) StateFields() []string {
	return []string{
		"queue",
		"isNamed",
		"readers",
		"totalReaders",
		"writers",
		"totalWriters",
		"buf",
		"off",
		"size",
		"max",
		"hadWriter",
	}
}

func (p *Pipe) beforeSave() {}

// +checklocksignore
func (p *Pipe) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	stateSinkObject.Save(0, &p.queue)
	stateSinkObject.Save(1, &p.isNamed)
	stateSinkObject.Save(2, &p.readers)
	stateSinkObject.Save(3, &p.totalReaders)
	stateSinkObject.Save(4, &p.writers)
	stateSinkObject.Save(5, &p.totalWriters)
	stateSinkObject.Save(6, &p.buf)
	stateSinkObject.Save(7, &p.off)
	stateSinkObject.Save(8, &p.size)
	stateSinkObject.Save(9, &p.max)
	stateSinkObject.Save(10, &p.hadWriter)
}

// +checklocksignore
func (p *Pipe) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &p.queue)
	stateSourceObject.Load(1, &p.isNamed)
	stateSourceObject.Load(2, &p.readers)
	stateSourceObject.Load(3, &p.totalReaders)
	stateSourceObject.Load(4, &p.writers)
	stateSourceObject.Load(5, &p.totalWriters)
	stateSourceObject.Load(6, &p.buf)
	stateSourceObject.Load(7, &p.off)
	stateSourceObject.Load(8, &p.size)
	stateSourceObject.Load(9, &p.max)
	stateSourceObject.Load(10, &p.hadWriter)
	stateSourceObject.AfterLoad(p.afterLoad)
}

func (vp *VFSPipe) StateTypeName() string {
	return "pkg/sentry/kernel/pipe.VFSPipe"
}

func (vp *VFSPipe) StateFields() []string {
	return []string{
		"pipe",
	}
}

func (vp *VFSPipe) beforeSave() {}

// +checklocksignore
func (vp *VFSPipe) StateSave(stateSinkObject state.Sink) {
	vp.beforeSave()
	stateSinkObject.Save(0, &vp.pipe)
}

func (vp *VFSPipe) afterLoad() {}

// +checklocksignore
func (vp *VFSPipe) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &vp.pipe)
}

func (fd *VFSPipeFD) StateTypeName() string {
	return "pkg/sentry/kernel/pipe.VFSPipeFD"
}

func (fd *VFSPipeFD) StateFields() []string {
	return []string{
		"vfsfd",
		"FileDescriptionDefaultImpl",
		"DentryMetadataFileDescriptionImpl",
		"LockFD",
		"pipe",
	}
}

func (fd *VFSPipeFD) beforeSave() {}

// +checklocksignore
func (fd *VFSPipeFD) StateSave(stateSinkObject state.Sink) {
	fd.beforeSave()
	stateSinkObject.Save(0, &fd.vfsfd)
	stateSinkObject.Save(1, &fd.FileDescriptionDefaultImpl)
	stateSinkObject.Save(2, &fd.DentryMetadataFileDescriptionImpl)
	stateSinkObject.Save(3, &fd.LockFD)
	stateSinkObject.Save(4, &fd.pipe)
}

func (fd *VFSPipeFD) afterLoad() {}

// +checklocksignore
func (fd *VFSPipeFD) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.vfsfd)
	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
	stateSourceObject.Load(2, &fd.DentryMetadataFileDescriptionImpl)
	stateSourceObject.Load(3, &fd.LockFD)
	stateSourceObject.Load(4, &fd.pipe)
}

func init() {
	state.Register((*Pipe)(nil))
	state.Register((*VFSPipe)(nil))
	state.Register((*VFSPipeFD)(nil))
}