From 54878c54f34fc2e75ef29bb9a23298c75aad0973 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 29 Jul 2009 15:52:00 +0200
Subject: [PATCH] storage: Fix semantics for directory size

The actual directory size is "used" space, not the total space on
the filesystem.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/storage.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/storage.py b/lib/storage.py
index 64d5f9f42..89a6328f9 100644
--- a/lib/storage.py
+++ b/lib/storage.py
@@ -102,7 +102,7 @@ class FileStorage(_Base):
     values = []
 
     # Pre-calculate information in case it's requested more than once
-    if COL_SIZE in fields:
+    if COL_USED in fields:
       dirsize = utils.CalculateDirectorySize(path)
     else:
       dirsize = None
@@ -116,7 +116,7 @@ class FileStorage(_Base):
       if field_name == COL_NAME:
         values.append(path)
 
-      elif field_name == COL_SIZE:
+      elif field_name == COL_USED:
         values.append(dirsize)
 
       elif field_name == COL_FREE:
-- 
GitLab