set Blocks and BlockSize in Attr using a default blocksize of 512 to address #442.

This commit is contained in:
Christian Kemper committed 2016-02-14 13:14:08 -08:00
1 parent b7260cafac
commit 1f81865847
2 files changed
+6

No files matched your search

+5
View File
@@ -15,6 +15,9 @@ import (
"golang.org/x/net/context"
)
// The default block size to report in stat
const blockSize = 512
// Statically ensure that *file implements the given interface
var _ = fs.HandleReader(&file{})
var _ = fs.HandleReleaser(&file{})
@@ -67,6 +70,8 @@ func (f *file) Attr(ctx context.Context, a *fuse.Attr) error {
a.Inode = f.node.Inode
a.Mode = f.node.Mode
a.Size = f.node.Size
a.Blocks = (f.node.Size / blockSize) + 1
a.BlockSize = blockSize
if !f.ownerIsRoot {
a.Uid = f.node.UID