Skip to content

Commit

Permalink
Merge pull request #41 from kolyshkin/FSTypeFilter
Browse files Browse the repository at this point in the history
mountinfo: rename FstypeFilter -> FSTypeFilter, fix FilterFunc docs
  • Loading branch information
kolyshkin authored Oct 2, 2020
2 parents a03c53e + 992946d commit 26483e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions mountinfo/mountinfo_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "strings"
// and/or stop further processing if we found what we wanted.
//
// It takes a pointer to the Info struct (not fully populated,
// currently only Mountpoint, Fstype, Source, and (on Linux)
// VfsOpts are filled in), and returns two booleans:
// currently only Mountpoint, FSType, Source, and (on Linux)
// VFSOptions are filled in), and returns two booleans:
//
// - skip: true if the entry should be skipped
// - stop: true if parsing should be stopped after the entry
Expand Down Expand Up @@ -45,8 +45,8 @@ func ParentsFilter(path string) FilterFunc {
}
}

// FstypeFilter returns all entries that match provided fstype(s).
func FstypeFilter(fstype ...string) FilterFunc {
// FSTypeFilter returns all entries that match provided fstype(s).
func FSTypeFilter(fstype ...string) FilterFunc {
return func(m *Info) (bool, bool) {
for _, t := range fstype {
if m.FSType == t {
Expand Down
4 changes: 2 additions & 2 deletions mountinfo/mountinfo_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ func TestParseMountinfoFilters(t *testing.T) {
{PrefixFilter("nonexistent"), 0},
// 4 entries: /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup /sys /
{ParentsFilter("/sys/fs/cgroup/cpu,cpuacct"), 4},
{FstypeFilter("pstore"), 1},
{FstypeFilter("proc", "sysfs"), 2},
{FSTypeFilter("pstore"), 1},
{FSTypeFilter("proc", "sysfs"), 2},
}

var r bytes.Reader
Expand Down

0 comments on commit 26483e2

Please sign in to comment.