namespace ode {
-class Block {
-public:
- template <typename OffsetType, typename LengthType>
- Block(OffsetType offset, LengthType len) : physicalOffset(offset), length(len) {}
- ~Block() {}
-
- unsigned long long physicalOffset;
- unsigned long long length;
-};
-
class BlockDevice final {
public:
typedef std::unordered_map<std::string, std::string> DeviceList;
int open(int flags);
void close(int descriptor);
- int discard(const Block &block);
- int secDiscard(const Block &block);
+ int discard(off_t offset, off_t length);
+ int secDiscard(off_t offset, off_t length);
const std::string &getName() const;
- int getSize();
+ blksize_t getBlockSize();
private:
void createDeviceList();
private:
std::string name;
- int blockSize;
+ blksize_t blockSize;
DeviceList deviceList;
};