diff --git a/mountinfo/doc.go b/mountinfo/doc.go index 21aa8dd5..ffac661f 100644 --- a/mountinfo/doc.go +++ b/mountinfo/doc.go @@ -1,4 +1,5 @@ // Package mountinfo provides a set of functions to retrieve information about OS mounts. +// // Currently it supports Linux. For historical reasons, there is also some support for FreeBSD, // and a shallow implementation for Windows, but in general this is Linux-only package, so // the rest of the document only applies to Linux, unless explicitly specified otherwise. @@ -8,7 +9,7 @@ // see different mounts. A per-process mountinfo table is available from /proc//mountinfo, // where is a numerical process identifier. // -// In general, /proc is not a very effective interface, and mountinfo is not an exception. +// In general, /proc is not a very efficient interface, and mountinfo is not an exception. // For example, there is no way to get information about a specific mount point (i.e. it // is all-or-nothing). This package tries to hide the /proc ineffectiveness by using // parse filters while reading mountinfo. A filter can skip some entries, or stop @@ -27,7 +28,7 @@ // of the cases where mountinfo should not be parsed: // // 1. Before performing a mount. Usually, this is not needed, but if required (say to -// prevent overmounts), to check whether a directory is mounted, call os.Lstat +// prevent over-mounts), to check whether a directory is mounted, call os.Lstat // on it and its parent directory, and compare their st.Sys().(*syscall.Stat_t).Dev // fields -- if they differ, then the directory is the mount point. NOTE this does // not work for bind mounts. Optionally, the filesystem type can also be checked @@ -43,5 +44,4 @@ // // 5. To find the mount point root of a specific directory. You can perform os.Stat() // on the directory and traverse up until the Dev field of a parent directory differs. - package mountinfo diff --git a/mountinfo/mountinfo_filters.go b/mountinfo/mountinfo_filters.go index 8aebe1ad..5ced02b5 100644 --- a/mountinfo/mountinfo_filters.go +++ b/mountinfo/mountinfo_filters.go @@ -50,7 +50,7 @@ func FstypeFilter(fstype ...string) FilterFunc { return func(m *Info) (bool, bool) { for _, t := range fstype { if m.Fstype == t { - return false, false // don't skeep, keep going + return false, false // don't skip, keep going } } return true, false // skip, keep going diff --git a/mountinfo/mountinfo_linux.go b/mountinfo/mountinfo_linux.go index cdfd37da..a78799cd 100644 --- a/mountinfo/mountinfo_linux.go +++ b/mountinfo/mountinfo_linux.go @@ -85,7 +85,7 @@ func parseInfoFile(r io.Reader, filter FilterFunc) ([]*Info, error) { } p.VfsOpts = fields[sepIdx+3] - // Run a filter soon so we can skip parsing/adding entries + // Run a filter early so we can skip parsing/adding entries // the caller is not interested in var skip, stop bool if filter != nil { @@ -173,7 +173,7 @@ func unescape(path string) (string, error) { } // The following code is UTF-8 transparent as it only looks for some - // specific characters (backslach and 0..7) with values < utf8.RuneSelf, + // specific characters (backslash and 0..7) with values < utf8.RuneSelf, // and everything else is passed through as is. buf := make([]byte, len(path)) bufLen := 0