add Increment to InodesEntry

This commit is contained in:
Ben McClelland
2022-10-24 20:36:06 -07:00
parent 5a348c37eb
commit 49f2a3597b

View File

@@ -131,15 +131,7 @@ func (q *Query) Next() ([]InodesEntry, error) {
inodes[i] = e
}
q.first = e
q.first.Ino++
if q.first.Ino == 0 {
q.first.Minor++
if q.first.Minor == 0 {
q.first.Major++
}
}
q.first = e.Increment()
return inodes, nil
}
@@ -148,6 +140,18 @@ func (q *Query) SetLast(l InodesEntry) {
q.last = l
}
// Increment returns the next seq entry position
func (i InodesEntry) Increment() InodesEntry {
i.Ino++
if i.Ino == 0 {
i.Minor++
if i.Minor == 0 {
i.Major++
}
}
return i
}
// StatMore returns scoutfs specific metadata for path
func StatMore(path string) (Stat, error) {
f, err := os.Open(path)