From 7c8c3705ea5d891a3d6126090b1f49d8bae44177 Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Mon, 7 May 2018 16:37:08 -0700 Subject: Fix misspellings PiperOrigin-RevId: 195742598 Change-Id: Ibd4a8e4394e268c87700b6d1e50b4b37dfce5182 --- pkg/cpuid/cpuid.go | 2 +- pkg/sentry/fs/fdpipe/pipe_opener.go | 2 +- pkg/sentry/fs/file_overlay.go | 2 +- pkg/sentry/fs/inode.go | 2 +- pkg/sentry/fs/inotify.go | 2 +- pkg/sentry/kernel/auth/credentials.go | 2 +- pkg/sentry/kernel/pipe/pipe.go | 2 +- pkg/sentry/loader/loader.go | 2 +- pkg/sentry/platform/kvm/address_space.go | 2 +- pkg/sentry/platform/ring0/pagetables/pagetables.go | 20 ++++++++++---------- .../platform/ring0/pagetables/pagetables_amd64.go | 2 +- pkg/sentry/usage/memory.go | 2 +- pkg/tcpip/header/ipv4.go | 2 +- runsc/sandbox/sandbox_test.go | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pkg/cpuid/cpuid.go b/pkg/cpuid/cpuid.go index aa248dd98..b486ab037 100644 --- a/pkg/cpuid/cpuid.go +++ b/pkg/cpuid/cpuid.go @@ -720,7 +720,7 @@ func HostID(axArg, cxArg uint32) (ax, bx, cx, dx uint32) // HostFeatureSet uses cpuid to get host values and construct a feature set // that matches that of the host machine. Note that there are several places -// where there appear to be some unecessary assignments between register names +// where there appear to be some unnecessary assignments between register names // (ax, bx, cx, or dx) and featureBlockN variables. This is to explicitly show // where the different feature blocks come from, to make the code easier to // inspect and read. diff --git a/pkg/sentry/fs/fdpipe/pipe_opener.go b/pkg/sentry/fs/fdpipe/pipe_opener.go index a0d59575f..945cfaf08 100644 --- a/pkg/sentry/fs/fdpipe/pipe_opener.go +++ b/pkg/sentry/fs/fdpipe/pipe_opener.go @@ -94,7 +94,7 @@ func unwrapError(err error) error { // TryOpen uses a NonBlockingOpener to try to open a host pipe, respecting the fs.FileFlags. func (p *pipeOpenState) TryOpen(ctx context.Context, opener NonBlockingOpener, flags fs.FileFlags) (*pipeOperations, error) { switch { - // Reject invalid configurations so they don't accidently succeed below. + // Reject invalid configurations so they don't accidentally succeed below. case !flags.Read && !flags.Write: return nil, syscall.EINVAL diff --git a/pkg/sentry/fs/file_overlay.go b/pkg/sentry/fs/file_overlay.go index 0c6e622b9..c27c5946e 100644 --- a/pkg/sentry/fs/file_overlay.go +++ b/pkg/sentry/fs/file_overlay.go @@ -151,7 +151,7 @@ func (f *overlayFileOperations) Seek(ctx context.Context, file *File, whence See // If this was a seek on a directory, we must update the cursor. if seekDir && whence == SeekSet && offset == 0 { - // Currenly only seeking to 0 on a directory is supported. + // Currently only seeking to 0 on a directory is supported. // FIXME: Lift directory seeking limitations. f.dirCursor = "" } diff --git a/pkg/sentry/fs/inode.go b/pkg/sentry/fs/inode.go index b624f4182..6c8e6f188 100644 --- a/pkg/sentry/fs/inode.go +++ b/pkg/sentry/fs/inode.go @@ -26,7 +26,7 @@ import ( "gvisor.googlesource.com/gvisor/pkg/tcpip/transport/unix" ) -// Inode is a file system object that can be simulatenously referenced by different +// Inode is a file system object that can be simultaneously referenced by different // components of the VFS (Dirent, fs.File, etc). type Inode struct { // AtomicRefCount is our reference count. diff --git a/pkg/sentry/fs/inotify.go b/pkg/sentry/fs/inotify.go index 9f50cb800..a87be8590 100644 --- a/pkg/sentry/fs/inotify.go +++ b/pkg/sentry/fs/inotify.go @@ -316,7 +316,7 @@ func (i *Inotify) RmWatch(wd int32) error { // The watch is now isolated and we can safely drop the instance lock. We // need to do so because watch.destroy() acquires Watch.mu, which cannot be - // aquired with Inotify.mu held. + // acquired with Inotify.mu held. i.mu.Unlock() // Generate the event for the removal. diff --git a/pkg/sentry/kernel/auth/credentials.go b/pkg/sentry/kernel/auth/credentials.go index b832b28fe..f6fb05285 100644 --- a/pkg/sentry/kernel/auth/credentials.go +++ b/pkg/sentry/kernel/auth/credentials.go @@ -126,7 +126,7 @@ func NewUserCredentials(kuid KUID, kgid KGID, extraKGIDs []KGID, capabilities *T creds.InheritableCaps = capabilities.InheritableCaps // // TODO: Support ambient capabilities. } else { - // If no capabilities are specified, grant the same capabilites + // If no capabilities are specified, grant the same capabilities // that NewRootCredentials does. creds.PermittedCaps = AllCapabilities creds.EffectiveCaps = AllCapabilities diff --git a/pkg/sentry/kernel/pipe/pipe.go b/pkg/sentry/kernel/pipe/pipe.go index 1656c6ff3..9a21df5b4 100644 --- a/pkg/sentry/kernel/pipe/pipe.go +++ b/pkg/sentry/kernel/pipe/pipe.go @@ -284,7 +284,7 @@ func (p *Pipe) rReadinessLocked() waiter.EventMask { ready |= waiter.EventIn } if !p.HasWriters() && p.hadWriter { - // POLLHUP must be supressed until the pipe has had at least one writer + // POLLHUP must be suppressed until the pipe has had at least one writer // at some point. Otherwise a reader thread may poll and immediately get // a POLLHUP before the writer ever opens the pipe, which the reader may // interpret as the writer opening then closing the pipe. diff --git a/pkg/sentry/loader/loader.go b/pkg/sentry/loader/loader.go index 94c281b72..4ed796493 100644 --- a/pkg/sentry/loader/loader.go +++ b/pkg/sentry/loader/loader.go @@ -118,7 +118,7 @@ func allocStack(ctx context.Context, m *mm.MemoryManager, a arch.Context) (*arch const ( // maxLoaderAttempts is the maximum number of attempts to try to load - // an interpreter scripts, to prevent loops. 6 (inital + 5 changes) is + // an interpreter scripts, to prevent loops. 6 (initial + 5 changes) is // what the Linux kernel allows (fs/exec.c:search_binary_handler). maxLoaderAttempts = 6 ) diff --git a/pkg/sentry/platform/kvm/address_space.go b/pkg/sentry/platform/kvm/address_space.go index 791f038b0..a4b9198cc 100644 --- a/pkg/sentry/platform/kvm/address_space.go +++ b/pkg/sentry/platform/kvm/address_space.go @@ -178,7 +178,7 @@ func (as *addressSpace) MapFile(addr usermem.Addr, fd int, fr platform.FileRange // we create distinct mappings for each address space. Unfortunately, // there's not a better way to manage this here. The file underlying // this fd can change at any time, so we can't actually index the file - // and share between address space. Oh well. It's all refering to the + // and share between address space. Oh well. It's all referring to the // same physical pages, hopefully we don't run out of address space. if fd != int(as.filemem.File().Fd()) { // N.B. precommit is ignored for host files. diff --git a/pkg/sentry/platform/ring0/pagetables/pagetables.go b/pkg/sentry/platform/ring0/pagetables/pagetables.go index 3cbf0bfa5..ee7f27601 100644 --- a/pkg/sentry/platform/ring0/pagetables/pagetables.go +++ b/pkg/sentry/platform/ring0/pagetables/pagetables.go @@ -44,18 +44,18 @@ type PageTables struct { // root is the pagetable root. root *Node - // translater is the translater passed at creation. - translater Translater + // translator is the translator passed at creation. + translator Translator // archPageTables includes architecture-specific features. archPageTables - // allNodes is a set of nodes indexed by translater address. + // allNodes is a set of nodes indexed by translator address. allNodes map[uintptr]*Node } -// Translater translates to guest physical addresses. -type Translater interface { +// Translator translates to guest physical addresses. +type Translator interface { // TranslateToPhysical translates the given pointer object into a // "physical" address. We do not require that it translates back, the // reverse mapping is maintained internally. @@ -63,9 +63,9 @@ type Translater interface { } // New returns new PageTables. -func New(t Translater, opts Opts) *PageTables { +func New(t Translator, opts Opts) *PageTables { p := &PageTables{ - translater: t, + translator: t, allNodes: make(map[uintptr]*Node), } p.root = p.allocNode() @@ -80,7 +80,7 @@ func New(t Translater, opts Opts) *PageTables { // managing multiple sets of pagetables. func (p *PageTables) New() *PageTables { np := &PageTables{ - translater: p.translater, + translator: p.translator, allNodes: make(map[uintptr]*Node), } np.root = np.allocNode() @@ -90,7 +90,7 @@ func (p *PageTables) New() *PageTables { // setPageTable sets the given index as a page table. func (p *PageTables) setPageTable(n *Node, index int, child *Node) { - phys := p.translater.TranslateToPhysical(child.PTEs()) + phys := p.translator.TranslateToPhysical(child.PTEs()) p.allNodes[phys] = child pte := &n.PTEs()[index] pte.setPageTable(phys) @@ -188,6 +188,6 @@ func (p *PageTables) Lookup(addr usermem.Addr) (physical uintptr, accessType use // allocNode allocates a new page. func (p *PageTables) allocNode() *Node { n := new(Node) - n.physical = p.translater.TranslateToPhysical(n.PTEs()) + n.physical = p.translator.TranslateToPhysical(n.PTEs()) return n } diff --git a/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go b/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go index b89665c96..a2050b99c 100644 --- a/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go +++ b/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go @@ -301,7 +301,7 @@ func (p *PageTables) iterateRange(startAddr, endAddr uintptr, alloc bool, fn fun } // This level has 2-MB huge pages. If this - // region is contined in a single PMD entry? + // region is contained in a single PMD entry? // As above, we can skip allocating a new page. if start&(pmdSize-1) == 0 && end-start >= pmdSize { pmdEntry.SetSuper() diff --git a/pkg/sentry/usage/memory.go b/pkg/sentry/usage/memory.go index 5d1b3a595..4a1527b5f 100644 --- a/pkg/sentry/usage/memory.go +++ b/pkg/sentry/usage/memory.go @@ -95,7 +95,7 @@ type MemoryStats struct { // categories not backed by platform memory. For details about how this works, // see the memory accounting docs. // -// N.B. Please keep the struct in sync with the API. Noteably, changes to this +// N.B. Please keep the struct in sync with the API. Notably, changes to this // struct requires a version bump and addition of compatibility logic in the // control server. As a special-case, adding fields without re-ordering existing // ones do not require a version bump because the mapped page we use is diff --git a/pkg/tcpip/header/ipv4.go b/pkg/tcpip/header/ipv4.go index cb0d42093..6e2a3d6f4 100644 --- a/pkg/tcpip/header/ipv4.go +++ b/pkg/tcpip/header/ipv4.go @@ -81,7 +81,7 @@ const ( // IPv4ProtocolNumber is IPv4's network protocol number. IPv4ProtocolNumber tcpip.NetworkProtocolNumber = 0x0800 - // IPv4Version is the version of the ipv4 procotol. + // IPv4Version is the version of the ipv4 protocol. IPv4Version = 4 ) diff --git a/runsc/sandbox/sandbox_test.go b/runsc/sandbox/sandbox_test.go index 6e3125b7b..a46212173 100644 --- a/runsc/sandbox/sandbox_test.go +++ b/runsc/sandbox/sandbox_test.go @@ -131,7 +131,7 @@ func waitForProcessList(s *sandbox.Sandbox, expected []*control.Process) error { return fmt.Errorf("sandbox got process list: %s, want: %s", procListToString(got), procListToString(expected)) } -// TestLifecycle tests the basic Create/Start/Signal/Destory sandbox lifecycle. +// TestLifecycle tests the basic Create/Start/Signal/Destroy sandbox lifecycle. // It verifies after each step that the sandbox can be loaded from disk, and // has the correct status. func TestLifecycle(t *testing.T) { -- cgit v1.2.3