Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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