diff options
author | Adin Scannell <adin@scannell.ca> | 2019-01-24 17:01:20 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-24 17:02:52 -0800 |
commit | b5088ba59c4b6e6fe19a38e15a5472d36f80b397 (patch) | |
tree | 52dcf10f7e28d91ff3c9b921d98a98eb0108fd88 /pkg/sentry/fs/ashmem | |
parent | 01679f3b5ab957c274690a62f0fce5d332ee94af (diff) |
cleanup: extract the kernel from context
Change-Id: I94704a90beebb53164325e0cce1fcb9a0b97d65c
PiperOrigin-RevId: 230817308
Diffstat (limited to 'pkg/sentry/fs/ashmem')
-rw-r--r-- | pkg/sentry/fs/ashmem/BUILD | 1 | ||||
-rw-r--r-- | pkg/sentry/fs/ashmem/area.go | 7 |
2 files changed, 1 insertions, 7 deletions
diff --git a/pkg/sentry/fs/ashmem/BUILD b/pkg/sentry/fs/ashmem/BUILD index 2463111a8..e5bb661b5 100644 --- a/pkg/sentry/fs/ashmem/BUILD +++ b/pkg/sentry/fs/ashmem/BUILD @@ -21,7 +21,6 @@ go_library( "//pkg/sentry/fs", "//pkg/sentry/fs/fsutil", "//pkg/sentry/fs/tmpfs", - "//pkg/sentry/kernel", "//pkg/sentry/kernel/time", "//pkg/sentry/memmap", "//pkg/sentry/platform", 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}) |