// automatically generated by stateify.

package gofer

import (
	"context"

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

func (l *dentryList) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentryList"
}

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

func (l *dentryList) beforeSave() {}

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

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

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

func (e *dentryEntry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentryEntry"
}

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

func (e *dentryEntry) beforeSave() {}

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

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

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

func (d *directfsDentry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.directfsDentry"
}

func (d *directfsDentry) StateFields() []string {
	return []string{
		"dentry",
		"controlFD",
	}
}

func (d *directfsDentry) beforeSave() {}

// +checklocksignore
func (d *directfsDentry) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.dentry)
	stateSinkObject.Save(1, &d.controlFD)
}

// +checklocksignore
func (d *directfsDentry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.dentry)
	stateSourceObject.Load(1, &d.controlFD)
	stateSourceObject.AfterLoad(func() { d.afterLoad(ctx) })
}

func (fd *directoryFD) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.directoryFD"
}

func (fd *directoryFD) StateFields() []string {
	return []string{
		"fileDescription",
		"DirectoryFileDescriptionDefaultImpl",
		"off",
		"dirents",
	}
}

func (fd *directoryFD) beforeSave() {}

// +checklocksignore
func (fd *directoryFD) StateSave(stateSinkObject state.Sink) {
	fd.beforeSave()
	stateSinkObject.Save(0, &fd.fileDescription)
	stateSinkObject.Save(1, &fd.DirectoryFileDescriptionDefaultImpl)
	stateSinkObject.Save(2, &fd.off)
	stateSinkObject.Save(3, &fd.dirents)
}

func (fd *directoryFD) afterLoad(context.Context) {}

// +checklocksignore
func (fd *directoryFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.fileDescription)
	stateSourceObject.Load(1, &fd.DirectoryFileDescriptionDefaultImpl)
	stateSourceObject.Load(2, &fd.off)
	stateSourceObject.Load(3, &fd.dirents)
}

func (cache *stringFixedCache) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.stringFixedCache"
}

func (cache *stringFixedCache) StateFields() []string {
	return []string{
		"namesList",
		"size",
	}
}

func (cache *stringFixedCache) beforeSave() {}

// +checklocksignore
func (cache *stringFixedCache) StateSave(stateSinkObject state.Sink) {
	cache.beforeSave()
	stateSinkObject.Save(0, &cache.namesList)
	stateSinkObject.Save(1, &cache.size)
}

func (cache *stringFixedCache) afterLoad(context.Context) {}

// +checklocksignore
func (cache *stringFixedCache) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &cache.namesList)
	stateSourceObject.Load(1, &cache.size)
}

func (d *dentryCache) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentryCache"
}

func (d *dentryCache) StateFields() []string {
	return []string{
		"maxCachedDentries",
		"dentries",
		"dentriesLen",
	}
}

func (d *dentryCache) beforeSave() {}

// +checklocksignore
func (d *dentryCache) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.maxCachedDentries)
	stateSinkObject.Save(1, &d.dentries)
	stateSinkObject.Save(2, &d.dentriesLen)
}

func (d *dentryCache) afterLoad(context.Context) {}

// +checklocksignore
func (d *dentryCache) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.maxCachedDentries)
	stateSourceObject.Load(1, &d.dentries)
	stateSourceObject.Load(2, &d.dentriesLen)
}

func (fstype *FilesystemType) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.FilesystemType"
}

func (fstype *FilesystemType) StateFields() []string {
	return []string{}
}

func (fstype *FilesystemType) beforeSave() {}

// +checklocksignore
func (fstype *FilesystemType) StateSave(stateSinkObject state.Sink) {
	fstype.beforeSave()
}

func (fstype *FilesystemType) afterLoad(context.Context) {}

// +checklocksignore
func (fstype *FilesystemType) StateLoad(ctx context.Context, stateSourceObject state.Source) {
}

func (fs *filesystem) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.filesystem"
}

func (fs *filesystem) StateFields() []string {
	return []string{
		"vfsfs",
		"opts",
		"iopts",
		"clock",
		"devMinor",
		"root",
		"dentryCache",
		"syncableDentries",
		"specialFileFDs",
		"lastIno",
		"savedDentryRW",
		"savedDeletedOpenDentries",
		"released",
	}
}

func (fs *filesystem) beforeSave() {}

// +checklocksignore
func (fs *filesystem) StateSave(stateSinkObject state.Sink) {
	fs.beforeSave()
	stateSinkObject.Save(0, &fs.vfsfs)
	stateSinkObject.Save(1, &fs.opts)
	stateSinkObject.Save(2, &fs.iopts)
	stateSinkObject.Save(3, &fs.clock)
	stateSinkObject.Save(4, &fs.devMinor)
	stateSinkObject.Save(5, &fs.root)
	stateSinkObject.Save(6, &fs.dentryCache)
	stateSinkObject.Save(7, &fs.syncableDentries)
	stateSinkObject.Save(8, &fs.specialFileFDs)
	stateSinkObject.Save(9, &fs.lastIno)
	stateSinkObject.Save(10, &fs.savedDentryRW)
	stateSinkObject.Save(11, &fs.savedDeletedOpenDentries)
	stateSinkObject.Save(12, &fs.released)
}

// +checklocksignore
func (fs *filesystem) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fs.vfsfs)
	stateSourceObject.Load(1, &fs.opts)
	stateSourceObject.Load(2, &fs.iopts)
	stateSourceObject.Load(3, &fs.clock)
	stateSourceObject.Load(4, &fs.devMinor)
	stateSourceObject.Load(5, &fs.root)
	stateSourceObject.Load(6, &fs.dentryCache)
	stateSourceObject.Load(7, &fs.syncableDentries)
	stateSourceObject.Load(8, &fs.specialFileFDs)
	stateSourceObject.Load(9, &fs.lastIno)
	stateSourceObject.Load(10, &fs.savedDentryRW)
	stateSourceObject.Load(11, &fs.savedDeletedOpenDentries)
	stateSourceObject.Load(12, &fs.released)
	stateSourceObject.AfterLoad(func() { fs.afterLoad(ctx) })
}

func (f *filesystemOptions) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.filesystemOptions"
}

func (f *filesystemOptions) StateFields() []string {
	return []string{
		"fd",
		"aname",
		"interop",
		"dfltuid",
		"dfltgid",
		"dcache",
		"forcePageCache",
		"limitHostFDTranslation",
		"overlayfsStaleRead",
		"regularFilesUseSpecialFileFD",
		"disableFifoOpen",
		"directfs",
	}
}

func (f *filesystemOptions) beforeSave() {}

// +checklocksignore
func (f *filesystemOptions) StateSave(stateSinkObject state.Sink) {
	f.beforeSave()
	stateSinkObject.Save(0, &f.fd)
	stateSinkObject.Save(1, &f.aname)
	stateSinkObject.Save(2, &f.interop)
	stateSinkObject.Save(3, &f.dfltuid)
	stateSinkObject.Save(4, &f.dfltgid)
	stateSinkObject.Save(5, &f.dcache)
	stateSinkObject.Save(6, &f.forcePageCache)
	stateSinkObject.Save(7, &f.limitHostFDTranslation)
	stateSinkObject.Save(8, &f.overlayfsStaleRead)
	stateSinkObject.Save(9, &f.regularFilesUseSpecialFileFD)
	stateSinkObject.Save(10, &f.disableFifoOpen)
	stateSinkObject.Save(11, &f.directfs)
}

func (f *filesystemOptions) afterLoad(context.Context) {}

// +checklocksignore
func (f *filesystemOptions) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &f.fd)
	stateSourceObject.Load(1, &f.aname)
	stateSourceObject.Load(2, &f.interop)
	stateSourceObject.Load(3, &f.dfltuid)
	stateSourceObject.Load(4, &f.dfltgid)
	stateSourceObject.Load(5, &f.dcache)
	stateSourceObject.Load(6, &f.forcePageCache)
	stateSourceObject.Load(7, &f.limitHostFDTranslation)
	stateSourceObject.Load(8, &f.overlayfsStaleRead)
	stateSourceObject.Load(9, &f.regularFilesUseSpecialFileFD)
	stateSourceObject.Load(10, &f.disableFifoOpen)
	stateSourceObject.Load(11, &f.directfs)
}

func (d *directfsOpts) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.directfsOpts"
}

func (d *directfsOpts) StateFields() []string {
	return []string{
		"enabled",
	}
}

func (d *directfsOpts) beforeSave() {}

// +checklocksignore
func (d *directfsOpts) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.enabled)
}

func (d *directfsOpts) afterLoad(context.Context) {}

// +checklocksignore
func (d *directfsOpts) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.enabled)
}

func (i *InteropMode) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.InteropMode"
}

func (i *InteropMode) StateFields() []string {
	return nil
}

func (i *InternalFilesystemOptions) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.InternalFilesystemOptions"
}

func (i *InternalFilesystemOptions) StateFields() []string {
	return []string{
		"UniqueID",
		"LeakConnection",
		"OpenSocketsByConnecting",
	}
}

func (i *InternalFilesystemOptions) beforeSave() {}

// +checklocksignore
func (i *InternalFilesystemOptions) StateSave(stateSinkObject state.Sink) {
	i.beforeSave()
	stateSinkObject.Save(0, &i.UniqueID)
	stateSinkObject.Save(1, &i.LeakConnection)
	stateSinkObject.Save(2, &i.OpenSocketsByConnecting)
}

func (i *InternalFilesystemOptions) afterLoad(context.Context) {}

// +checklocksignore
func (i *InternalFilesystemOptions) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &i.UniqueID)
	stateSourceObject.Load(1, &i.LeakConnection)
	stateSourceObject.Load(2, &i.OpenSocketsByConnecting)
}

func (i *inoKey) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.inoKey"
}

func (i *inoKey) StateFields() []string {
	return []string{
		"ino",
		"devMinor",
		"devMajor",
	}
}

func (i *inoKey) beforeSave() {}

// +checklocksignore
func (i *inoKey) StateSave(stateSinkObject state.Sink) {
	i.beforeSave()
	stateSinkObject.Save(0, &i.ino)
	stateSinkObject.Save(1, &i.devMinor)
	stateSinkObject.Save(2, &i.devMajor)
}

func (i *inoKey) afterLoad(context.Context) {}

// +checklocksignore
func (i *inoKey) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &i.ino)
	stateSourceObject.Load(1, &i.devMinor)
	stateSourceObject.Load(2, &i.devMajor)
}

func (d *dentry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentry"
}

func (d *dentry) StateFields() []string {
	return []string{
		"vfsd",
		"refs",
		"fs",
		"parent",
		"name",
		"inoKey",
		"deleted",
		"cached",
		"cacheEntry",
		"syncableListEntry",
		"children",
		"syntheticChildren",
		"ino",
		"mode",
		"uid",
		"gid",
		"blockSize",
		"atime",
		"mtime",
		"ctime",
		"btime",
		"size",
		"atimeDirty",
		"mtimeDirty",
		"nlink",
		"mappings",
		"cache",
		"dirty",
		"savedDeletedData",
		"pf",
		"haveTarget",
		"target",
		"endpoint",
		"pipe",
		"locks",
		"watches",
		"forMountpoint",
		"impl",
	}
}

// +checklocksignore
func (d *dentry) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	var parentValue *dentry
	parentValue = d.saveParent()
	stateSinkObject.SaveValue(3, parentValue)
	stateSinkObject.Save(0, &d.vfsd)
	stateSinkObject.Save(1, &d.refs)
	stateSinkObject.Save(2, &d.fs)
	stateSinkObject.Save(4, &d.name)
	stateSinkObject.Save(5, &d.inoKey)
	stateSinkObject.Save(6, &d.deleted)
	stateSinkObject.Save(7, &d.cached)
	stateSinkObject.Save(8, &d.cacheEntry)
	stateSinkObject.Save(9, &d.syncableListEntry)
	stateSinkObject.Save(10, &d.children)
	stateSinkObject.Save(11, &d.syntheticChildren)
	stateSinkObject.Save(12, &d.ino)
	stateSinkObject.Save(13, &d.mode)
	stateSinkObject.Save(14, &d.uid)
	stateSinkObject.Save(15, &d.gid)
	stateSinkObject.Save(16, &d.blockSize)
	stateSinkObject.Save(17, &d.atime)
	stateSinkObject.Save(18, &d.mtime)
	stateSinkObject.Save(19, &d.ctime)
	stateSinkObject.Save(20, &d.btime)
	stateSinkObject.Save(21, &d.size)
	stateSinkObject.Save(22, &d.atimeDirty)
	stateSinkObject.Save(23, &d.mtimeDirty)
	stateSinkObject.Save(24, &d.nlink)
	stateSinkObject.Save(25, &d.mappings)
	stateSinkObject.Save(26, &d.cache)
	stateSinkObject.Save(27, &d.dirty)
	stateSinkObject.Save(28, &d.savedDeletedData)
	stateSinkObject.Save(29, &d.pf)
	stateSinkObject.Save(30, &d.haveTarget)
	stateSinkObject.Save(31, &d.target)
	stateSinkObject.Save(32, &d.endpoint)
	stateSinkObject.Save(33, &d.pipe)
	stateSinkObject.Save(34, &d.locks)
	stateSinkObject.Save(35, &d.watches)
	stateSinkObject.Save(36, &d.forMountpoint)
	stateSinkObject.Save(37, &d.impl)
}

// +checklocksignore
func (d *dentry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.vfsd)
	stateSourceObject.Load(1, &d.refs)
	stateSourceObject.Load(2, &d.fs)
	stateSourceObject.Load(4, &d.name)
	stateSourceObject.Load(5, &d.inoKey)
	stateSourceObject.Load(6, &d.deleted)
	stateSourceObject.Load(7, &d.cached)
	stateSourceObject.Load(8, &d.cacheEntry)
	stateSourceObject.Load(9, &d.syncableListEntry)
	stateSourceObject.Load(10, &d.children)
	stateSourceObject.Load(11, &d.syntheticChildren)
	stateSourceObject.Load(12, &d.ino)
	stateSourceObject.Load(13, &d.mode)
	stateSourceObject.Load(14, &d.uid)
	stateSourceObject.Load(15, &d.gid)
	stateSourceObject.Load(16, &d.blockSize)
	stateSourceObject.Load(17, &d.atime)
	stateSourceObject.Load(18, &d.mtime)
	stateSourceObject.Load(19, &d.ctime)
	stateSourceObject.Load(20, &d.btime)
	stateSourceObject.Load(21, &d.size)
	stateSourceObject.Load(22, &d.atimeDirty)
	stateSourceObject.Load(23, &d.mtimeDirty)
	stateSourceObject.Load(24, &d.nlink)
	stateSourceObject.Load(25, &d.mappings)
	stateSourceObject.Load(26, &d.cache)
	stateSourceObject.Load(27, &d.dirty)
	stateSourceObject.Load(28, &d.savedDeletedData)
	stateSourceObject.Load(29, &d.pf)
	stateSourceObject.Load(30, &d.haveTarget)
	stateSourceObject.Load(31, &d.target)
	stateSourceObject.Load(32, &d.endpoint)
	stateSourceObject.Load(33, &d.pipe)
	stateSourceObject.Load(34, &d.locks)
	stateSourceObject.Load(35, &d.watches)
	stateSourceObject.Load(36, &d.forMountpoint)
	stateSourceObject.Load(37, &d.impl)
	stateSourceObject.LoadValue(3, new(*dentry), func(y any) { d.loadParent(ctx, y.(*dentry)) })
	stateSourceObject.AfterLoad(func() { d.afterLoad(ctx) })
}

func (s *stringListElem) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.stringListElem"
}

func (s *stringListElem) StateFields() []string {
	return []string{
		"str",
		"stringEntry",
	}
}

func (s *stringListElem) beforeSave() {}

// +checklocksignore
func (s *stringListElem) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.str)
	stateSinkObject.Save(1, &s.stringEntry)
}

func (s *stringListElem) afterLoad(context.Context) {}

// +checklocksignore
func (s *stringListElem) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.str)
	stateSourceObject.Load(1, &s.stringEntry)
}

func (d *dentryListElem) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentryListElem"
}

func (d *dentryListElem) StateFields() []string {
	return []string{
		"d",
		"dentryEntry",
	}
}

func (d *dentryListElem) beforeSave() {}

// +checklocksignore
func (d *dentryListElem) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.d)
	stateSinkObject.Save(1, &d.dentryEntry)
}

func (d *dentryListElem) afterLoad(context.Context) {}

// +checklocksignore
func (d *dentryListElem) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.d)
	stateSourceObject.Load(1, &d.dentryEntry)
}

func (fd *fileDescription) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.fileDescription"
}

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

func (fd *fileDescription) beforeSave() {}

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

func (fd *fileDescription) afterLoad(context.Context) {}

// +checklocksignore
func (fd *fileDescription) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.vfsfd)
	stateSourceObject.Load(1, &fd.FileDescriptionDefaultImpl)
	stateSourceObject.Load(2, &fd.LockFD)
}

func (d *lisafsDentry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.lisafsDentry"
}

func (d *lisafsDentry) StateFields() []string {
	return []string{
		"dentry",
	}
}

func (d *lisafsDentry) beforeSave() {}

// +checklocksignore
func (d *lisafsDentry) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.dentry)
}

func (d *lisafsDentry) afterLoad(context.Context) {}

// +checklocksignore
func (d *lisafsDentry) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.dentry)
}

func (fd *regularFileFD) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.regularFileFD"
}

func (fd *regularFileFD) StateFields() []string {
	return []string{
		"fileDescription",
		"off",
	}
}

func (fd *regularFileFD) beforeSave() {}

// +checklocksignore
func (fd *regularFileFD) StateSave(stateSinkObject state.Sink) {
	fd.beforeSave()
	stateSinkObject.Save(0, &fd.fileDescription)
	stateSinkObject.Save(1, &fd.off)
}

func (fd *regularFileFD) afterLoad(context.Context) {}

// +checklocksignore
func (fd *regularFileFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.fileDescription)
	stateSourceObject.Load(1, &fd.off)
}

func (d *dentryPlatformFile) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.dentryPlatformFile"
}

func (d *dentryPlatformFile) StateFields() []string {
	return []string{
		"DefaultMemoryType",
		"NoBufferedIOFallback",
		"dentry",
		"fdRefs",
		"hostFileMapper",
	}
}

func (d *dentryPlatformFile) beforeSave() {}

// +checklocksignore
func (d *dentryPlatformFile) StateSave(stateSinkObject state.Sink) {
	d.beforeSave()
	stateSinkObject.Save(0, &d.DefaultMemoryType)
	stateSinkObject.Save(1, &d.NoBufferedIOFallback)
	stateSinkObject.Save(2, &d.dentry)
	stateSinkObject.Save(3, &d.fdRefs)
	stateSinkObject.Save(4, &d.hostFileMapper)
}

// +checklocksignore
func (d *dentryPlatformFile) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &d.DefaultMemoryType)
	stateSourceObject.Load(1, &d.NoBufferedIOFallback)
	stateSourceObject.Load(2, &d.dentry)
	stateSourceObject.Load(3, &d.fdRefs)
	stateSourceObject.Load(4, &d.hostFileMapper)
	stateSourceObject.AfterLoad(func() { d.afterLoad(ctx) })
}

func (s *savedDentryRW) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.savedDentryRW"
}

func (s *savedDentryRW) StateFields() []string {
	return []string{
		"read",
		"write",
	}
}

func (s *savedDentryRW) beforeSave() {}

// +checklocksignore
func (s *savedDentryRW) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.read)
	stateSinkObject.Save(1, &s.write)
}

func (s *savedDentryRW) afterLoad(context.Context) {}

// +checklocksignore
func (s *savedDentryRW) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.read)
	stateSourceObject.Load(1, &s.write)
}

func (e *endpoint) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.endpoint"
}

func (e *endpoint) StateFields() []string {
	return []string{
		"dentry",
		"path",
	}
}

func (e *endpoint) beforeSave() {}

// +checklocksignore
func (e *endpoint) StateSave(stateSinkObject state.Sink) {
	e.beforeSave()
	stateSinkObject.Save(0, &e.dentry)
	stateSinkObject.Save(1, &e.path)
}

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

// +checklocksignore
func (e *endpoint) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &e.dentry)
	stateSourceObject.Load(1, &e.path)
}

func (l *specialFDList) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.specialFDList"
}

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

func (l *specialFDList) beforeSave() {}

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

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

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

func (e *specialFDEntry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.specialFDEntry"
}

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

func (e *specialFDEntry) beforeSave() {}

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

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

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

func (fd *specialFileFD) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.specialFileFD"
}

func (fd *specialFileFD) StateFields() []string {
	return []string{
		"fileDescription",
		"specialFDEntry",
		"DefaultMemoryType",
		"NoBufferedIOFallback",
		"isRegularFile",
		"seekable",
		"queue",
		"off",
		"haveBuf",
		"buf",
		"hostFileMapper",
		"fileRefs",
	}
}

func (fd *specialFileFD) beforeSave() {}

// +checklocksignore
func (fd *specialFileFD) StateSave(stateSinkObject state.Sink) {
	fd.beforeSave()
	stateSinkObject.Save(0, &fd.fileDescription)
	stateSinkObject.Save(1, &fd.specialFDEntry)
	stateSinkObject.Save(2, &fd.DefaultMemoryType)
	stateSinkObject.Save(3, &fd.NoBufferedIOFallback)
	stateSinkObject.Save(4, &fd.isRegularFile)
	stateSinkObject.Save(5, &fd.seekable)
	stateSinkObject.Save(6, &fd.queue)
	stateSinkObject.Save(7, &fd.off)
	stateSinkObject.Save(8, &fd.haveBuf)
	stateSinkObject.Save(9, &fd.buf)
	stateSinkObject.Save(10, &fd.hostFileMapper)
	stateSinkObject.Save(11, &fd.fileRefs)
}

// +checklocksignore
func (fd *specialFileFD) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fd.fileDescription)
	stateSourceObject.Load(1, &fd.specialFDEntry)
	stateSourceObject.Load(2, &fd.DefaultMemoryType)
	stateSourceObject.Load(3, &fd.NoBufferedIOFallback)
	stateSourceObject.Load(4, &fd.isRegularFile)
	stateSourceObject.Load(5, &fd.seekable)
	stateSourceObject.Load(6, &fd.queue)
	stateSourceObject.Load(7, &fd.off)
	stateSourceObject.Load(8, &fd.haveBuf)
	stateSourceObject.Load(9, &fd.buf)
	stateSourceObject.Load(10, &fd.hostFileMapper)
	stateSourceObject.Load(11, &fd.fileRefs)
	stateSourceObject.AfterLoad(func() { fd.afterLoad(ctx) })
}

func (l *stringList) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.stringList"
}

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

func (l *stringList) beforeSave() {}

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

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

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

func (e *stringEntry) StateTypeName() string {
	return "pkg/sentry/fsimpl/gofer.stringEntry"
}

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

func (e *stringEntry) beforeSave() {}

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

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

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

func init() {
	state.Register((*dentryList)(nil))
	state.Register((*dentryEntry)(nil))
	state.Register((*directfsDentry)(nil))
	state.Register((*directoryFD)(nil))
	state.Register((*stringFixedCache)(nil))
	state.Register((*dentryCache)(nil))
	state.Register((*FilesystemType)(nil))
	state.Register((*filesystem)(nil))
	state.Register((*filesystemOptions)(nil))
	state.Register((*directfsOpts)(nil))
	state.Register((*InteropMode)(nil))
	state.Register((*InternalFilesystemOptions)(nil))
	state.Register((*inoKey)(nil))
	state.Register((*dentry)(nil))
	state.Register((*stringListElem)(nil))
	state.Register((*dentryListElem)(nil))
	state.Register((*fileDescription)(nil))
	state.Register((*lisafsDentry)(nil))
	state.Register((*regularFileFD)(nil))
	state.Register((*dentryPlatformFile)(nil))
	state.Register((*savedDentryRW)(nil))
	state.Register((*endpoint)(nil))
	state.Register((*specialFDList)(nil))
	state.Register((*specialFDEntry)(nil))
	state.Register((*specialFileFD)(nil))
	state.Register((*stringList)(nil))
	state.Register((*stringEntry)(nil))
}
