[cache_writeback] work in progress

This commit is contained in:
Joe Thornber
2016-03-17 15:15:52 +00:00
parent 0bc126fbeb
commit 4573ebb218
3 changed files with 153 additions and 6 deletions

7
block-cache/copier.cc Normal file
View File

@@ -0,0 +1,7 @@
#include "block-cache/copier.h"
//----------------------------------------------------------------
//----------------------------------------------------------------

30
block-cache/copier.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef BLOCK_CACHE_COPIER_H
#define BLOCK_CACHE_COPIER_H
#include "block_cache.h"
#include <string>
//----------------------------------------------------------------
namespace bcache {
class copier {
public:
// block size in sectors
copier(std::string const &src, std::string const &dest,
unsigned block_size);
~copier();
// Returns the number of sectors copied
unsigned copy(block_address from, block_address to);
unsigned get_block_size() const;
private:
unsigned block_size_;
};
}
//----------------------------------------------------------------
#endif