Fixed small inaccuracy in calculation of free space in statvfs
This commit is contained in:
parent
6795d2bc6f
commit
f5b50f348c
@ -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
|
||||
---------------
|
||||
|
@ -23,7 +23,7 @@ namespace onblocks {
|
||||
namespace datanodestore {
|
||||
|
||||
DataNodeStore::DataNodeStore(unique_ref<BlockStore> 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 {
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
|
||||
cpputils::unique_ref<blockstore::BlockStore> _blockstore;
|
||||
const DataNodeLayout _layout;
|
||||
uint64_t _physicalBlockSizeBytes;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DataNodeStore);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user