ExtendedPrecisionStats builds an ExtendedPrecisionStats from a slice of uint32s.
(us []uint64)
| 421 | |
| 422 | // ExtendedPrecisionStats builds an ExtendedPrecisionStats from a slice of uint32s. |
| 423 | func extendedPrecisionStats(us []uint64) (ExtendedPrecisionStats, error) { |
| 424 | if l := len(us); l != 3 { |
| 425 | return ExtendedPrecisionStats{}, fmt.Errorf("incorrect number of values for XFS extended precision stats: %d", l) |
| 426 | } |
| 427 | |
| 428 | return ExtendedPrecisionStats{ |
| 429 | FlushBytes: us[0], |
| 430 | WriteBytes: us[1], |
| 431 | ReadBytes: us[2], |
| 432 | }, nil |
| 433 | } |
| 434 | |
| 435 | func quotaManagerStats(us []uint32) (QuotaManagerStats, error) { |
| 436 | // The "Unused" attribute first appears in Linux 4.20 |