From b4df131aff03707f2742663e4177c36061988b1a Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sun, 24 Feb 2019 20:46:21 -0700
Subject: [PATCH] Fix disk usage calculation

---
 src/mount/fuse.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mount/fuse.rs b/src/mount/fuse.rs
index 4b03fed..0d48324 100644
--- a/src/mount/fuse.rs
+++ b/src/mount/fuse.rs
@@ -38,7 +38,8 @@ fn node_attr(node: &(u64, Node)) -> FileAttr {
     FileAttr {
         ino: node.0,
         size: node.1.extents[0].length,
-        blocks: (node.1.extents[0].length + BLOCK_SIZE - 1)/BLOCK_SIZE,
+        // Blocks is in 512 byte blocks, not in our block size
+        blocks: (node.1.extents[0].length + BLOCK_SIZE - 1)/BLOCK_SIZE * (BLOCK_SIZE / 512),
         atime: NULL_TIME,
         mtime: Timespec {
             sec: node.1.mtime as i64,
-- 
GitLab