aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_du.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-15 09:32:47 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-15 09:32:47 -0700
commitc647deace16ec1a3f0c11d92dc5fa15ec30012e4 (patch)
tree7b13546507283b5566a069d03dc3371ccd2d7290 /weed/shell/command_fs_du.go
parentc03bb180eb5fc96e79324f0aa5ec7cd9b674f901 (diff)
downloadseaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.tar.xz
seaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.zip
file size support set file length
use Attr.FileSize and TotalChunkSize to determine file size
Diffstat (limited to 'weed/shell/command_fs_du.go')
-rw-r--r--weed/shell/command_fs_du.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index 96551dd5a..5404b0cdb 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -70,9 +70,9 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir
}
} else {
fileBlockCount = uint64(len(entry.Chunks))
- fileByteCount = filer2.TotalSize(entry.Chunks)
- blockCount += uint64(len(entry.Chunks))
- byteCount += filer2.TotalSize(entry.Chunks)
+ fileByteCount = filer2.FileSize(entry)
+ blockCount += fileBlockCount
+ byteCount += fileByteCount
}
if name != "" && !entry.IsDirectory {