Skip to content

Commit

Permalink
Fix various spelling issues in the documentation
Browse files Browse the repository at this point in the history
Addresses obvious typos, in the documentation only.

COPYBARA_INTEGRATE_REVIEW=google#443 from Pixep:fix/documentation-spelling 4d0688164eafaf0b3010e5f4824b35d1e7176d65
PiperOrigin-RevId: 255477779
  • Loading branch information
prattmic authored and gvisor-bot committed Jun 27, 2019
1 parent 085a907 commit 5b41ba5
Show file tree
Hide file tree
Showing 72 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion pkg/abi/linux/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Package linux contains the constants and types needed to inferface with a
# Package linux contains the constants and types needed to interface with a
# Linux kernel. It should be used instead of syscall or golang.org/x/sys/unix
# when the host OS may not be Linux.

Expand Down
2 changes: 1 addition & 1 deletion pkg/abi/linux/fcntl.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package linux

// Comands from linux/fcntl.h.
// Commands from linux/fcntl.h.
const (
F_DUPFD = 0
F_GETFD = 1
Expand Down
2 changes: 1 addition & 1 deletion pkg/abi/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package linux contains the constants and types needed to inferface with a Linux kernel.
// Package linux contains the constants and types needed to interface with a Linux kernel.
package linux

// NumSoftIRQ is the number of software IRQs, exposed via /proc/stat.
Expand Down
4 changes: 2 additions & 2 deletions pkg/amutex/amutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
)

// Sleeper must be implemented by users of the abortable mutex to allow for
// cancelation of waits.
// cancellation of waits.
type Sleeper interface {
// SleepStart is called by the AbortableMutex.Lock() function when the
// mutex is contended and the goroutine is about to sleep.
//
// A channel can be returned that causes the sleep to be canceled if
// it's readable. If no cancelation is desired, nil can be returned.
// it's readable. If no cancellation is desired, nil can be returned.
SleepStart() <-chan struct{}

// SleepFinish is called by AbortableMutex.Lock() once a contended mutex
Expand Down
2 changes: 1 addition & 1 deletion pkg/amutex/amutex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestMutualExclusion(t *testing.T) {
// goroutines ran concurrently within the critical section.
//
// If one of the goroutines doesn't complete, it's likely a bug that
// causes to to wait forever.
// causes it to wait forever.
const gr = 1000
const iters = 100000
v := 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/cpuid/cpuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ func vendorIDFromRegs(bx, cx, dx uint32) string {
// state includes floating point registers, and other cpu state that's not
// associated with the normal task context.
//
// Note: We can save some space here with an optimiazation where we use a
// Note: We can save some space here with an optimization where we use a
// smaller chunk of memory depending on features that are actually enabled.
// Currently we just use the largest possible size for simplicity (which is
// about 2.5K worst case, with avx512).
Expand Down
2 changes: 1 addition & 1 deletion pkg/eventchannel/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ type debugEmitter struct {
inner Emitter
}

// DebugEmitterFrom creates a new event channel emitter by wraping an existing
// DebugEmitterFrom creates a new event channel emitter by wrapping an existing
// raw emitter.
func DebugEmitterFrom(inner Emitter) Emitter {
return &debugEmitter{
Expand Down
4 changes: 2 additions & 2 deletions pkg/fd/fd.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func NewFromFile(file *os.File) (*FD, error) {
return New(fd), nil
}

// Open is equivallent to open(2).
// Open is equivalent to open(2).
func Open(path string, openmode int, perm uint32) (*FD, error) {
f, err := syscall.Open(path, openmode|syscall.O_LARGEFILE, perm)
if err != nil {
Expand All @@ -176,7 +176,7 @@ func Open(path string, openmode int, perm uint32) (*FD, error) {
return New(f), nil
}

// OpenAt is equivallent to openat(2).
// OpenAt is equivalent to openat(2).
func OpenAt(dir *FD, path string, flags int, mode uint32) (*FD, error) {
f, err := syscall.Openat(dir.FD(), path, flags, mode)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ var logMu sync.Mutex
// log is the default logger.
var log atomic.Value

// Log retieves the global logger.
// Log retrieves the global logger.
func Log() *BasicLogger {
return log.Load().(*BasicLogger)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/p9/p9.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (o OpenFlags) String() string {
}
}

// Tag is a messsage tag.
// Tag is a message tag.
type Tag uint16

// FID is a file identifier.
Expand Down
2 changes: 1 addition & 1 deletion pkg/p9/p9test/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func checkDeleted(h *Harness, file p9.File) {
_, newFile, err := file.Walk(nil)
if err == syscall.EBUSY {
// We can't walk from here because this reference is open
// aleady. Okay, we will also have unopened cases through
// already. Okay, we will also have unopened cases through
// TestUnlink, just skip the remove operation for now.
return
} else if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/seccomp/seccomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func addSyscallArgsCheck(p *bpf.ProgramBuilder, rules []Rule, action linux.BPFAc
return nil
}

// buildBSTProgram converts a binary tree started in 'root' into BPF code. The ouline of the code
// buildBSTProgram converts a binary tree started in 'root' into BPF code. The outline of the code
// is as follows:
//
// // SYS_PIPE(22), root
Expand Down
2 changes: 1 addition & 1 deletion pkg/segment/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ func (s *Set) String() string {
return s.root.String()
}

// String stringifes a node (and all of its children) for debugging.
// String stringifies a node (and all of its children) for debugging.
func (n *node) String() string {
var buf bytes.Buffer
n.writeDebugString(&buf, "")
Expand Down
4 changes: 2 additions & 2 deletions pkg/sentry/fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ A mount point is restored in two steps:

- Second, during state.Load, each `fs.MountedFilesystem` optionally searches
for a mount in the `fs.RestoreEnvironment` that matches its saved device
name. The `fs.MountedFilesystem` then restablishes a pointer to the root of
name. The `fs.MountedFilesystem` then reestablishes a pointer to the root of
the mounted filesystem. For example, the mount specification provides the
network connection for a mounted remote filesystem client to communicate
with its remote file server. The `fs.MountedFilesystem` also trivially loads
Expand Down Expand Up @@ -158,7 +158,7 @@ Otherwise an `fs.File` restores flags, an offset, and a unique identifier (only
used internally).

It may use the `fs.Inode`, which it indirectly holds a reference on through the
`fs.Dirent`, to restablish an open file handle on the backing filesystem (e.g.
`fs.Dirent`, to reestablish an open file handle on the backing filesystem (e.g.
to continue reading and writing).

## Overlay
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/ashmem/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Device struct {

var _ fs.InodeOperations = (*Device)(nil)

// NewDevice creates and intializes a Device structure.
// NewDevice creates and initializes a Device structure.
func NewDevice(ctx context.Context, owner fs.FileOwner, fp fs.FilePermissions) *Device {
return &Device{
InodeSimpleAttributes: fsutil.NewInodeSimpleAttributes(ctx, owner, fp, linux.ANON_INODE_FS_MAGIC),
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/binder/binder.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Device struct {

var _ fs.InodeOperations = (*Device)(nil)

// NewDevice creates and intializes a Device structure.
// NewDevice creates and initializes a Device structure.
func NewDevice(ctx context.Context, owner fs.FileOwner, fp fs.FilePermissions) *Device {
return &Device{
InodeSimpleAttributes: fsutil.NewInodeSimpleAttributes(ctx, owner, fp, 0),
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/dev/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func init() {
fs.RegisterFilesystem(&filesystem{})
}

// FilesystemName is the name underwhich the filesystem is registered.
// FilesystemName is the name under which the filesystem is registered.
// Name matches drivers/base/devtmpfs.c:dev_fs_type.name.
const FilesystemName = "devtmpfs"

Expand Down
4 changes: 2 additions & 2 deletions pkg/sentry/fs/dirent_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (c *DirentCache) contains(d *Dirent) bool {
return c.list.Front() == d
}

// Invalidate removes all Dirents from the cache, caling DecRef on each.
// Invalidate removes all Dirents from the cache, calling DecRef on each.
func (c *DirentCache) Invalidate() {
if c == nil {
return
Expand All @@ -159,7 +159,7 @@ func (c *DirentCache) Invalidate() {
}

// setMaxSize sets cache max size. If current size is larger than max size, the
// cache shrinks to acommodate the new max.
// cache shrinks to accommodate the new max.
func (c *DirentCache) setMaxSize(max uint64) {
c.mu.Lock()
c.maxSize = max
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/gofer/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

// DefaultDirentCacheSize is the default dirent cache size for 9P mounts. It can
// be adjusted independentely from the other dirent caches.
// be adjusted independently from the other dirent caches.
var DefaultDirentCacheSize uint64 = fs.DefaultDirentCacheSize

// +stateify savable
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/lock/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const (
// LockRegion attempts to acquire a typed lock for the uid on a region
// of a file. Returns true if successful in locking the region. If false
// is returned, the caller should normally interpret this as "try again later" if
// accquiring the lock in a non-blocking mode or "interrupted" if in a blocking mode.
// acquiring the lock in a non-blocking mode or "interrupted" if in a blocking mode.
// Blocker is the interface used to provide blocking behavior, passing a nil Blocker
// will result in non-blocking behavior.
func (l *Locks) LockRegion(uid UniqueID, t LockType, r LockRange, block Blocker) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/proc/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
fs.RegisterFilesystem(&filesystem{})
}

// FilesystemName is the name underwhich the filesystem is registered.
// FilesystemName is the name under which the filesystem is registered.
// Name matches fs/proc/root.c:proc_fs_type.name.
const FilesystemName = "proc"

Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/proc/rpcinet_proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"gvisor.dev/gvisor/pkg/waiter"
)

// rpcInetInode implments fs.InodeOperations.
// rpcInetInode implements fs.InodeOperations.
type rpcInetInode struct {
fsutil.SimpleFileInode

Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/sys/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
fs.RegisterFilesystem(&filesystem{})
}

// FilesystemName is the name underwhich the filesystem is registered.
// FilesystemName is the name under which the filesystem is registered.
// Name matches fs/sysfs/mount.c:sysfs_fs_type.name.
const FilesystemName = "sysfs"

Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/fs/tmpfs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {
fs.RegisterFilesystem(&Filesystem{})
}

// FilesystemName is the name underwhich the filesystem is registered.
// FilesystemName is the name under which the filesystem is registered.
// Name matches mm/shmem.c:shmem_fs_type.name.
const FilesystemName = "tmpfs"

Expand Down
4 changes: 2 additions & 2 deletions pkg/sentry/kernel/fs_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func newFSContext(root, cwd *fs.Dirent, umask uint) *FSContext {
// destroy is the destructor for an FSContext.
//
// This will call DecRef on both root and cwd Dirents. If either call to
// DecRef returns an error, then it will be propigated. If both calls to
// DecRef return an error, then the one from root.DecRef will be propigated.
// DecRef returns an error, then it will be propagated. If both calls to
// DecRef return an error, then the one from root.DecRef will be propagated.
//
// Note that there may still be calls to WorkingDirectory() or RootDirectory()
// (that return nil). This is because valid references may still be held via
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/ipc_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewIPCNamespace(userNS *auth.UserNamespace) *IPCNamespace {
}
}

// SemaphoreRegistry returns the semanphore set registry for this namespace.
// SemaphoreRegistry returns the semaphore set registry for this namespace.
func (i *IPCNamespace) SemaphoreRegistry() *semaphore.Registry {
return i.semaphores
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func (ctx *createProcessContext) Value(key interface{}) interface{} {
return ctx.args.Credentials
case fs.CtxRoot:
if ctx.args.Root != nil {
// Take a refernce on the root dirent that will be
// Take a reference on the root dirent that will be
// given to the caller.
ctx.args.Root.IncRef()
return ctx.args.Root
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/semaphore/semaphore.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type Set struct {
dead bool
}

// sem represents a single semanphore from a set.
// sem represents a single semaphore from a set.
//
// +stateify savable
type sem struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/sentry/kernel/task_futex.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ func (t *Task) SwapUint32(addr usermem.Addr, new uint32) (uint32, error) {
})
}

// CompareAndSwapUint32 implemets futex.Target.CompareAndSwapUint32.
// CompareAndSwapUint32 implements futex.Target.CompareAndSwapUint32.
func (t *Task) CompareAndSwapUint32(addr usermem.Addr, old, new uint32) (uint32, error) {
return t.MemoryManager().CompareAndSwapUint32(t, addr, old, new, usermem.IOOpts{
AddressSpaceActive: true,
})
}

// LoadUint32 implemets futex.Target.LoadUint32.
// LoadUint32 implements futex.Target.LoadUint32.
func (t *Task) LoadUint32(addr usermem.Addr) (uint32, error) {
return t.MemoryManager().LoadUint32(t, addr, usermem.IOOpts{
AddressSpaceActive: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/task_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (t *Task) beginStopLocked() {
}
}

// endStopLocked decerements t.stopCount to indicate that an existing internal
// endStopLocked decrements t.stopCount to indicate that an existing internal
// or external stop no longer applies to t.
//
// Preconditions: The signal mutex must be locked.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/thread_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (k *Kernel) newThreadGroup(mounts *fs.MountNamespace, ns *PIDNamespace, sh
return tg
}

// saveRscr is invopked by stateify.
// saveRscr is invoked by stateify.
func (tg *ThreadGroup) saveRscr() *RSEQCriticalRegion {
return tg.rscr.Load().(*RSEQCriticalRegion)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/kernel/timekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (t *Timekeeper) SetClocks(c sentrytime.Clocks) {
//
// In a restored sentry, monotonic time jumps forward by approximately
// the same amount as real time. There are no guarantees here, we are
// just making a best-effort attempt to to make it appear that the app
// just making a best-effort attempt to make it appear that the app
// was simply not scheduled for a long period, rather than that the
// real time clock was changed.
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/memmap/mapping_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (mappingSetFunctions) Merge(r1 MappableRange, val1 MappingsOfRange, r2 Mapp
// Each MappingOfRange in val1 must have a matching region in val2, forming
// one contiguous region.
for k1 := range val1 {
// We expect val2 to to contain a key that forms a contiguous
// We expect val2 to contain a key that forms a contiguous
// region with k1.
k2 := MappingOfRange{
MappingSpace: k1.MappingSpace,
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/mm/mm.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type MemoryManager struct {
// privateRefs is immutable.
privateRefs *privateRefs

// users is the number of dependences on the mappings in the MemoryManager.
// users is the number of dependencies on the mappings in the MemoryManager.
// When the number of references in users reaches zero, all mappings are
// unmapped.
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/mm/vma.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (mm *MemoryManager) createVMALocked(ctx context.Context, opts memmap.MMapOp
panic(fmt.Sprintf("Non-effective MaxPerms %s cannot be enforced", opts.MaxPerms))
}

// Find a useable range.
// Find a usable range.
addr, err := mm.findAvailableLocked(opts.Length, findAvailableOpts{
Addr: opts.Addr,
Fixed: opts.Fixed,
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/platform/kvm/bluepill_amd64_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func bluepillArchContext(context unsafe.Pointer) *arch.SignalContext64 {
return &((*arch.UContext64)(context).MContext)
}

// dieArchSetup initialies the state for dieTrampoline.
// dieArchSetup initializes the state for dieTrampoline.
//
// The amd64 dieTrampoline requires the vCPU to be set in BX, and the last RIP
// to be in AX. The trampoline then simulates a call to dieHandler from the
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/platform/kvm/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type dieState struct {

// newVCPU creates a returns a new vCPU.
//
// Precondtion: mu must be held.
// Precondition: mu must be held.
func (m *machine) newVCPU() *vCPU {
id := len(m.vCPUs)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/platform/kvm/machine_amd64_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *vCPU) setCPUID() error {

// setSystemTime sets the TSC for the vCPU.
//
// This has to make the call many times in order to minimize the intrinstic
// This has to make the call many times in order to minimize the intrinsic
// error in the offset. Unfortunately KVM does not expose a relative offset via
// the API, so this is an approximation. We do this via an iterative algorithm.
// This has the advantage that it can generally deal with highly variable
Expand Down
2 changes: 1 addition & 1 deletion pkg/sentry/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ type AddressSpaceIO interface {
LoadUint32(addr usermem.Addr) (uint32, error)
}

// NoAddressSpaceIO implements AddressSpaceIO methods by panicing.
// NoAddressSpaceIO implements AddressSpaceIO methods by panicking.
type NoAddressSpaceIO struct{}

// CopyOut implements AddressSpaceIO.CopyOut.
Expand Down
Loading

0 comments on commit 5b41ba5

Please sign in to comment.