Update to latest procfs library (#1611)

Bump to v0.0.10 procfs library.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2020-02-18 11:33:46 +01:00 committed by GitHub
commit 14df2a1a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 849 additions and 250 deletions

View file

@ -381,11 +381,15 @@ func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) {
}
func quotaManagerStats(us []uint32) (QuotaManagerStats, error) {
if l := len(us); l != 8 {
// The "Unused" attribute first appears in Linux 4.20
// As a result either 8 or 9 elements may appear in this slice depending on
// the kernel version.
l := len(us)
if l != 8 && l != 9 {
return QuotaManagerStats{}, fmt.Errorf("incorrect number of values for XFS quota stats: %d", l)
}
return QuotaManagerStats{
s := QuotaManagerStats{
Reclaims: us[0],
ReclaimMisses: us[1],
DquoteDups: us[2],
@ -394,7 +398,13 @@ func quotaManagerStats(us []uint32) (QuotaManagerStats, error) {
Wants: us[5],
ShakeReclaims: us[6],
InactReclaims: us[7],
}, nil
}
if l > 8 {
s.Unused = us[8]
}
return s, nil
}
func debugStats(us []uint32) (DebugStats, error) {