Use block caching and increase block size

This commit is contained in:
Sebastian Messmer 2015-04-15 20:42:14 +02:00
parent 821254f9d8
commit 54e0bbc7d3
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@
#include "messmer/blobstore/implementations/onblocks/BlobStoreOnBlocks.h"
#include "messmer/blobstore/implementations/onblocks/BlobOnBlocks.h"
#include "messmer/blockstore/implementations/encrypted/EncryptedBlockStore.h"
#include "messmer/blockstore/implementations/caching2/Caching2BlockStore.h"
using std::unique_ptr;
using std::make_unique;
@ -22,13 +23,14 @@ using blockstore::Key;
using blockstore::encrypted::EncryptedBlockStore;
using blobstore::onblocks::BlobStoreOnBlocks;
using blobstore::onblocks::BlobOnBlocks;
using blockstore::caching2::Caching2BlockStore;
namespace cryfs {
constexpr uint32_t CryDevice::BLOCKSIZE_BYTES;
CryDevice::CryDevice(unique_ptr<CryConfig> config, unique_ptr<BlockStore> blockStore)
: _blobStore(make_unique<BlobStoreOnBlocks>(make_unique<EncryptedBlockStore>(std::move(blockStore), config->EncryptionKey()), BLOCKSIZE_BYTES)), _rootKey(GetOrCreateRootKey(config.get())) {
: _blobStore(make_unique<BlobStoreOnBlocks>(make_unique<Caching2BlockStore>(make_unique<EncryptedBlockStore>(std::move(blockStore), config->EncryptionKey())), BLOCKSIZE_BYTES)), _rootKey(GetOrCreateRootKey(config.get())) {
}
Key CryDevice::GetOrCreateRootKey(CryConfig *config) {

View File

@ -18,7 +18,7 @@ namespace bf = boost::filesystem;
class CryDevice: public fspp::Device {
public:
static constexpr uint32_t BLOCKSIZE_BYTES = 8 * 1024;
static constexpr uint32_t BLOCKSIZE_BYTES = 32 * 1024;
CryDevice(std::unique_ptr<CryConfig> config, std::unique_ptr<blockstore::BlockStore> blockStore);
virtual ~CryDevice();