diff options
Diffstat (limited to 'pkg/sentry/fs/file_state.go')
-rw-r--r-- | pkg/sentry/fs/file_state.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/sentry/fs/file_state.go b/pkg/sentry/fs/file_state.go index 3384737ab..f848d1b79 100644 --- a/pkg/sentry/fs/file_state.go +++ b/pkg/sentry/fs/file_state.go @@ -14,7 +14,18 @@ package fs +// beforeSave is invoked by stateify. +func (f *File) beforeSave() { + f.saving = true + if f.flags.Async && f.async != nil { + f.async.Unregister(f) + } +} + // afterLoad is invoked by stateify. func (f *File) afterLoad() { f.mu.Init() + if f.flags.Async && f.async != nil { + f.async.Register(f) + } } |