summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/file_description_impl_util.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-12-12 21:23:50 +0000
committergVisor bot <gvisor-bot@google.com>2019-12-12 21:23:50 +0000
commitf0b295134c90ff33886f9afa8022c677ba2025b1 (patch)
treef88c9606f5e0d4a7a51165b259087ba9f50ffd78 /pkg/sentry/vfs/file_description_impl_util.go
parentc166476f2ec3b8bae5590c74e61865eb6aa5a408 (diff)
parent93d429d5b1e3801fb4c29568bcd40d6854c9fe94 (diff)
Merge release-20191210.0-27-g93d429d (automated)
Diffstat (limited to 'pkg/sentry/vfs/file_description_impl_util.go')
-rwxr-xr-xpkg/sentry/vfs/file_description_impl_util.go9
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
+}