1 #ifndef VOLUME_H 2 #define VOLUME_H 3 /* Volume - emulation for the B+Tree torture test 4 ** 5 ** Initial version by Axel Dörfler, axeld@pinc-software.de 6 ** This file may be used under the terms of the OpenBeOS License. 7 */ 8 9 10 #include <SupportDefs.h> 11 12 #include "Lock.h" 13 #include "bfs.h" 14 15 16 class BFile; 17 18 19 class Volume { 20 public: 21 Volume(BFile *file) : fFile(file) {} 22 23 BFile *Device() { return fFile; } 24 25 int32 BlockSize() const { return 1024; } 26 off_t ToBlock(block_run run) const { return run.start; } 27 block_run ToBlockRun(off_t block) const { return block_run::Run(0,0,block); } 28 29 static void Panic(); 30 31 private: 32 BFile *fFile; 33 }; 34 35 36 #endif /* VOLUME_H */ 37