diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-12-12 21:23:50 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-12 21:23:50 +0000 |
commit | f0b295134c90ff33886f9afa8022c677ba2025b1 (patch) | |
tree | f88c9606f5e0d4a7a51165b259087ba9f50ffd78 /pkg/sentry/vfs/file_description_impl_util.go | |
parent | c166476f2ec3b8bae5590c74e61865eb6aa5a408 (diff) | |
parent | 93d429d5b1e3801fb4c29568bcd40d6854c9fe94 (diff) |
Merge release-20191210.0-27-g93d429d (automated)
Diffstat (limited to 'pkg/sentry/vfs/file_description_impl_util.go')
-rwxr-xr-x | pkg/sentry/vfs/file_description_impl_util.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/file_description_impl_util.go b/pkg/sentry/vfs/file_description_impl_util.go index 4fbad7840..aae023254 100755 --- a/pkg/sentry/vfs/file_description_impl_util.go +++ b/pkg/sentry/vfs/file_description_impl_util.go @@ -252,3 +252,12 @@ func (fd *DynamicBytesFileDescriptionImpl) Seek(ctx context.Context, offset int6 fd.off = offset return offset, nil } + +// GenericConfigureMMap may be used by most implementations of +// FileDescriptionImpl.ConfigureMMap. +func GenericConfigureMMap(fd *FileDescription, m memmap.Mappable, opts *memmap.MMapOpts) error { + opts.Mappable = m + opts.MappingIdentity = fd + fd.IncRef() + return nil +} |