diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-12 17:58:12 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-12 17:58:12 -0800 |
| commit | 5e814afe88101715c845bd56c46303d05a1ef3e3 (patch) | |
| tree | 7debb5367b57707a89a91a4c9755599257a0193c | |
| parent | 0c1f42f4eba8b00c6599dfec52413a18e25fea2e (diff) | |
| download | seaweedfs-5e814afe88101715c845bd56c46303d05a1ef3e3.tar.xz seaweedfs-5e814afe88101715c845bd56c46303d05a1ef3e3.zip | |
blocks count
| -rw-r--r-- | weed/filesys/file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go index 48a024f20..8028d3912 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -72,8 +72,8 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) { attr.Mtime = time.Unix(entry.Attributes.Mtime, 0) attr.Gid = entry.Attributes.Gid attr.Uid = entry.Attributes.Uid - attr.Blocks = attr.Size/blockSize + 1 - attr.BlockSize = uint32(file.wfs.option.ChunkSizeLimit) + attr.BlockSize = blockSize + attr.Blocks = (attr.Size + blockSize - 1) / blockSize if entry.HardLinkCounter > 0 { attr.Nlink = uint32(entry.HardLinkCounter) } |
