// automatically generated by stateify.

package lisafs

import (
	"context"

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

func (r *boundSocketFDRefs) StateTypeName() string {
	return "pkg/lisafs.boundSocketFDRefs"
}

func (r *boundSocketFDRefs) StateFields() []string {
	return []string{
		"refCount",
	}
}

func (r *boundSocketFDRefs) beforeSave() {}

// +checklocksignore
func (r *boundSocketFDRefs) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.refCount)
}

// +checklocksignore
func (r *boundSocketFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.refCount)
	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
}

func (l *controlFDList) StateTypeName() string {
	return "pkg/lisafs.controlFDList"
}

func (l *controlFDList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (l *controlFDList) beforeSave() {}

// +checklocksignore
func (l *controlFDList) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.head)
	stateSinkObject.Save(1, &l.tail)
}

func (l *controlFDList) afterLoad(context.Context) {}

// +checklocksignore
func (l *controlFDList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.head)
	stateSourceObject.Load(1, &l.tail)
}

func (e *controlFDEntry) StateTypeName() string {
	return "pkg/lisafs.controlFDEntry"
}

func (e *controlFDEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (e *controlFDEntry) beforeSave() {}

// +checklocksignore
func (e *controlFDEntry) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.next)
	stateSinkObject.Save(1, &e.prev)
}

func (e *controlFDEntry) afterLoad(context.Context) {}

// +checklocksignore
func (e *controlFDEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.next)
	stateSourceObject.Load(1, &e.prev)
}

func (r *controlFDRefs) StateTypeName() string {
	return "pkg/lisafs.controlFDRefs"
}

func (r *controlFDRefs) StateFields() []string {
	return []string{
		"refCount",
	}
}

func (r *controlFDRefs) beforeSave() {}

// +checklocksignore
func (r *controlFDRefs) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.refCount)
}

// +checklocksignore
func (r *controlFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.refCount)
	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
}

func (r *nodeRefs) StateTypeName() string {
	return "pkg/lisafs.nodeRefs"
}

func (r *nodeRefs) StateFields() []string {
	return []string{
		"refCount",
	}
}

func (r *nodeRefs) beforeSave() {}

// +checklocksignore
func (r *nodeRefs) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.refCount)
}

// +checklocksignore
func (r *nodeRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.refCount)
	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
}

func (l *openFDList) StateTypeName() string {
	return "pkg/lisafs.openFDList"
}

func (l *openFDList) StateFields() []string {
	return []string{
		"head",
		"tail",
	}
}

func (l *openFDList) beforeSave() {}

// +checklocksignore
func (l *openFDList) StateSave(stateSinkObject state.Sink) {
	l.beforeSave()
	stateSinkObject.Save(0, &l.head)
	stateSinkObject.Save(1, &l.tail)
}

func (l *openFDList) afterLoad(context.Context) {}

// +checklocksignore
func (l *openFDList) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &l.head)
	stateSourceObject.Load(1, &l.tail)
}

func (e *openFDEntry) StateTypeName() string {
	return "pkg/lisafs.openFDEntry"
}

func (e *openFDEntry) StateFields() []string {
	return []string{
		"next",
		"prev",
	}
}

func (e *openFDEntry) beforeSave() {}

// +checklocksignore
func (e *openFDEntry) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.next)
	stateSinkObject.Save(1, &e.prev)
}

func (e *openFDEntry) afterLoad(context.Context) {}

// +checklocksignore
func (e *openFDEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.next)
	stateSourceObject.Load(1, &e.prev)
}

func (r *openFDRefs) StateTypeName() string {
	return "pkg/lisafs.openFDRefs"
}

func (r *openFDRefs) StateFields() []string {
	return []string{
		"refCount",
	}
}

func (r *openFDRefs) beforeSave() {}

// +checklocksignore
func (r *openFDRefs) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.refCount)
}

// +checklocksignore
func (r *openFDRefs) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.refCount)
	stateSourceObject.AfterLoad(func() { r.afterLoad(ctx) })
}

func init() {
	state.Register((*boundSocketFDRefs)(nil))
	state.Register((*controlFDList)(nil))
	state.Register((*controlFDEntry)(nil))
	state.Register((*controlFDRefs)(nil))
	state.Register((*nodeRefs)(nil))
	state.Register((*openFDList)(nil))
	state.Register((*openFDEntry)(nil))
	state.Register((*openFDRefs)(nil))
}
