mirror of
https://github.com/versity/scoutfs-go.git
synced 2026-01-08 12:41:11 +00:00
add Increment to InodesEntry
This commit is contained in:
22
scoutfs.go
22
scoutfs.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user