diff --git a/ChangeLog.txt b/ChangeLog.txt index 917fc1b4..e0a10e0c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ Version 0.12.0 (unreleased) --------------- * Updated to DokanY 1.3.0.1000 * Added a man page for `cryfs-unmount` +* Fixed small inaccuracy in calculation of free space in statvfs Version 0.11.3 --------------- diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp b/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp index 2fbe1cde..913f9e43 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp +++ b/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.cpp @@ -23,7 +23,7 @@ namespace onblocks { namespace datanodestore { DataNodeStore::DataNodeStore(unique_ref blockstore, uint64_t physicalBlocksizeBytes) -: _blockstore(std::move(blockstore)), _layout(_blockstore->blockSizeFromPhysicalBlockSize(physicalBlocksizeBytes)) { +: _blockstore(std::move(blockstore)), _layout(_blockstore->blockSizeFromPhysicalBlockSize(physicalBlocksizeBytes)), _physicalBlockSizeBytes(physicalBlockSizeBytes) { } DataNodeStore::~DataNodeStore() { @@ -127,11 +127,11 @@ uint64_t DataNodeStore::numNodes() const { } uint64_t DataNodeStore::estimateSpaceForNumNodesLeft() const { - return _blockstore->estimateNumFreeBytes() / _layout.blocksizeBytes(); + return _blockstore->estimateNumFreeBytes() / _physicalBlockSizeBytes; } uint64_t DataNodeStore::virtualBlocksizeBytes() const { - return _layout.blocksizeBytes(); + return _layout.maxBytesPerLeaf(); } DataNodeLayout DataNodeStore::layout() const { diff --git a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h b/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h index 74709ed9..22702e3c 100644 --- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h +++ b/src/blobstore/implementations/onblocks/datanodestore/DataNodeStore.h @@ -57,6 +57,7 @@ private: cpputils::unique_ref _blockstore; const DataNodeLayout _layout; + uint64_t _physicalBlockSizeBytes; DISALLOW_COPY_AND_ASSIGN(DataNodeStore); };