fuse: fix st_blocks to be an integer (not float) value

it's basically ceil(dsize / blocksize) now (without doing floating point ops).
This commit is contained in:
Thomas Waldmann 2017-02-16 23:55:27 +01:00
parent 3a3dfcbef5
commit 81d3a4eb22
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ class FuseOperations(llfuse.Operations):
entry.st_rdev = item.get(b'rdev', 0) entry.st_rdev = item.get(b'rdev', 0)
entry.st_size = size entry.st_size = size
entry.st_blksize = 512 entry.st_blksize = 512
entry.st_blocks = dsize / 512 entry.st_blocks = (dsize + entry.st_blksize - 1) // entry.st_blksize
# note: older archives only have mtime (not atime nor ctime) # note: older archives only have mtime (not atime nor ctime)
if have_fuse_xtime_ns: if have_fuse_xtime_ns:
entry.st_mtime_ns = bigint_to_int(item[b'mtime']) entry.st_mtime_ns = bigint_to_int(item[b'mtime'])