summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/ashmem/area.go
diff options
context:
space:
mode:
authorAdin Scannell <adin@scannell.ca>2019-01-24 17:01:20 -0800
committerShentubot <shentubot@google.com>2019-01-24 17:02:52 -0800
commitb5088ba59c4b6e6fe19a38e15a5472d36f80b397 (patch)
tree52dcf10f7e28d91ff3c9b921d98a98eb0108fd88 /pkg/sentry/fs/ashmem/area.go
parent01679f3b5ab957c274690a62f0fce5d332ee94af (diff)
cleanup: extract the kernel from context
Change-Id: I94704a90beebb53164325e0cce1fcb9a0b97d65c PiperOrigin-RevId: 230817308
Diffstat (limited to 'pkg/sentry/fs/ashmem/area.go')
-rw-r--r--pkg/sentry/fs/ashmem/area.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/pkg/sentry/fs/ashmem/area.go b/pkg/sentry/fs/ashmem/area.go
index 7c1b11464..710b5185f 100644
--- a/pkg/sentry/fs/ashmem/area.go
+++ b/pkg/sentry/fs/ashmem/area.go
@@ -23,7 +23,6 @@ import (
"gvisor.googlesource.com/gvisor/pkg/sentry/fs"
"gvisor.googlesource.com/gvisor/pkg/sentry/fs/fsutil"
"gvisor.googlesource.com/gvisor/pkg/sentry/fs/tmpfs"
- "gvisor.googlesource.com/gvisor/pkg/sentry/kernel"
"gvisor.googlesource.com/gvisor/pkg/sentry/memmap"
"gvisor.googlesource.com/gvisor/pkg/sentry/usage"
"gvisor.googlesource.com/gvisor/pkg/sentry/usermem"
@@ -114,11 +113,7 @@ func (a *Area) ConfigureMMap(ctx context.Context, file *fs.File, opts *memmap.MM
opts.MaxPerms = opts.MaxPerms.Intersect(a.perms)
if a.tmpfsFile == nil {
- k := kernel.KernelFromContext(ctx)
- if k == nil {
- return syserror.ENOMEM
- }
- tmpfsInodeOps := tmpfs.NewInMemoryFile(ctx, usage.Tmpfs, fs.UnstableAttr{}, k)
+ tmpfsInodeOps := tmpfs.NewInMemoryFile(ctx, usage.Tmpfs, fs.UnstableAttr{})
tmpfsInode := fs.NewInode(tmpfsInodeOps, fs.NewPseudoMountSource(), fs.StableAttr{})
dirent := fs.NewDirent(tmpfsInode, namePrefix+"/"+a.name)
tmpfsFile, err := tmpfsInode.GetFile(ctx, dirent, fs.FileFlags{Read: true, Write: true})