readLayout reads the Btrfs layout statistics for an allocation layout.
(p string)
| 179 | |
| 180 | // readLayout reads the Btrfs layout statistics for an allocation layout. |
| 181 | func (r *reader) readLayout(p string) (l *LayoutUsage) { |
| 182 | l = new(LayoutUsage) |
| 183 | l.TotalBytes = r.readValue(path.Join(p, "total_bytes")) |
| 184 | l.UsedBytes = r.readValue(path.Join(p, "used_bytes")) |
| 185 | l.Ratio = r.calcRatio(p) |
| 186 | |
| 187 | return |
| 188 | } |
| 189 | |
| 190 | // calcRatio returns the calculated ratio for a layout mode. |
| 191 | func (r *reader) calcRatio(p string) float64 { |
no test coverage detected