Skip to content

Commit

Permalink
Merge pull request #37 from kolyshkin/typos
Browse files Browse the repository at this point in the history
mountinfo: fix not showing package doc, typos
  • Loading branch information
thaJeztah committed Sep 23, 2020
2 parents 4a8c65a + a720826 commit 810cc47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions mountinfo/doc.go
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -8,7 +9,7 @@
// see different mounts. A per-process mountinfo table is available from /proc/<PID>/mountinfo,
// where <PID> 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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion mountinfo/mountinfo_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mountinfo/mountinfo_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 810cc47

Please sign in to comment.