diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-09-27 09:33:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-09-27 09:33:36 -0700 |
| commit | f53632a84b6c55037edaa82b7478abb8024962e1 (patch) | |
| tree | cef8dcc2bbb252abcb738de143d88027c6d72cb5 | |
| parent | a36226197241194823ca4ccad03a9d62ae11c82a (diff) | |
| download | seaweedfs-f53632a84b6c55037edaa82b7478abb8024962e1.tar.xz seaweedfs-f53632a84b6c55037edaa82b7478abb8024962e1.zip | |
add block size for linux du
du already working on Mac
| -rw-r--r-- | weed/filesys/file.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 236995fa0..5f7095330 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -12,6 +12,8 @@ import ( "time" ) +const blockSize = 512 + var _ = fs.Node(&File{}) var _ = fs.NodeOpener(&File{}) var _ = fs.NodeFsyncer(&File{}) @@ -40,6 +42,8 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Mtime = time.Unix(file.entry.Attributes.Mtime, 0) attr.Gid = file.entry.Attributes.Gid attr.Uid = file.entry.Attributes.Uid + attr.Blocks = attr.Size/blockSize + 1 + attr.BlockSize = blockSize return nil |
