// automatically generated by stateify.

package epoll

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

func (x *FileIdentifier) beforeSave() {}
func (x *FileIdentifier) save(m state.Map) {
	x.beforeSave()
	m.Save("File", &x.File)
	m.Save("Fd", &x.Fd)
}

func (x *FileIdentifier) afterLoad() {}
func (x *FileIdentifier) load(m state.Map) {
	m.LoadWait("File", &x.File)
	m.Load("Fd", &x.Fd)
}

func (x *pollEntry) beforeSave() {}
func (x *pollEntry) save(m state.Map) {
	x.beforeSave()
	m.Save("pollEntryEntry", &x.pollEntryEntry)
	m.Save("id", &x.id)
	m.Save("userData", &x.userData)
	m.Save("mask", &x.mask)
	m.Save("flags", &x.flags)
	m.Save("epoll", &x.epoll)
}

func (x *pollEntry) load(m state.Map) {
	m.Load("pollEntryEntry", &x.pollEntryEntry)
	m.LoadWait("id", &x.id)
	m.Load("userData", &x.userData)
	m.Load("mask", &x.mask)
	m.Load("flags", &x.flags)
	m.Load("epoll", &x.epoll)
	m.AfterLoad(x.afterLoad)
}

func (x *EventPoll) beforeSave() {}
func (x *EventPoll) save(m state.Map) {
	x.beforeSave()
	if !state.IsZeroValue(x.FilePipeSeek) {
		m.Failf("FilePipeSeek is %v, expected zero", x.FilePipeSeek)
	}
	if !state.IsZeroValue(x.FileNotDirReaddir) {
		m.Failf("FileNotDirReaddir is %v, expected zero", x.FileNotDirReaddir)
	}
	if !state.IsZeroValue(x.FileNoFsync) {
		m.Failf("FileNoFsync is %v, expected zero", x.FileNoFsync)
	}
	if !state.IsZeroValue(x.FileNoopFlush) {
		m.Failf("FileNoopFlush is %v, expected zero", x.FileNoopFlush)
	}
	if !state.IsZeroValue(x.FileNoIoctl) {
		m.Failf("FileNoIoctl is %v, expected zero", x.FileNoIoctl)
	}
	if !state.IsZeroValue(x.FileNoMMap) {
		m.Failf("FileNoMMap is %v, expected zero", x.FileNoMMap)
	}
	if !state.IsZeroValue(x.Queue) {
		m.Failf("Queue is %v, expected zero", x.Queue)
	}
	m.Save("files", &x.files)
	m.Save("readyList", &x.readyList)
	m.Save("waitingList", &x.waitingList)
	m.Save("disabledList", &x.disabledList)
}

func (x *EventPoll) load(m state.Map) {
	m.Load("files", &x.files)
	m.Load("readyList", &x.readyList)
	m.Load("waitingList", &x.waitingList)
	m.Load("disabledList", &x.disabledList)
	m.AfterLoad(x.afterLoad)
}

func (x *pollEntryList) beforeSave() {}
func (x *pollEntryList) save(m state.Map) {
	x.beforeSave()
	m.Save("head", &x.head)
	m.Save("tail", &x.tail)
}

func (x *pollEntryList) afterLoad() {}
func (x *pollEntryList) load(m state.Map) {
	m.Load("head", &x.head)
	m.Load("tail", &x.tail)
}

func (x *pollEntryEntry) beforeSave() {}
func (x *pollEntryEntry) save(m state.Map) {
	x.beforeSave()
	m.Save("next", &x.next)
	m.Save("prev", &x.prev)
}

func (x *pollEntryEntry) afterLoad() {}
func (x *pollEntryEntry) load(m state.Map) {
	m.Load("next", &x.next)
	m.Load("prev", &x.prev)
}

func init() {
	state.Register("pkg/sentry/kernel/epoll.FileIdentifier", (*FileIdentifier)(nil), state.Fns{Save: (*FileIdentifier).save, Load: (*FileIdentifier).load})
	state.Register("pkg/sentry/kernel/epoll.pollEntry", (*pollEntry)(nil), state.Fns{Save: (*pollEntry).save, Load: (*pollEntry).load})
	state.Register("pkg/sentry/kernel/epoll.EventPoll", (*EventPoll)(nil), state.Fns{Save: (*EventPoll).save, Load: (*EventPoll).load})
	state.Register("pkg/sentry/kernel/epoll.pollEntryList", (*pollEntryList)(nil), state.Fns{Save: (*pollEntryList).save, Load: (*pollEntryList).load})
	state.Register("pkg/sentry/kernel/epoll.pollEntryEntry", (*pollEntryEntry)(nil), state.Fns{Save: (*pollEntryEntry).save, Load: (*pollEntryEntry).load})
}