xref: /haiku/src/tests/add-ons/kernel/file_systems/bfs/btree/Volume.h (revision 4466b89c65970de4c7236ac87faa2bee4589f413)
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 "bfs.h"
13 
14 
15 class BFile;
16 
17 
18 class Volume {
19 	public:
20 		Volume(BFile *file) : fFile(file) {}
21 
22 		BFile *Device() { return fFile; }
23 
24 		int32 BlockSize() const { return 1024; }
25 		off_t ToBlock(block_run run) const { return run.start; }
26 		block_run ToBlockRun(off_t block) const { return block_run::Run(0,0,block); }
27 
28 		static void Panic();
29 
30 	private:
31 		BFile	*fFile;
32 };
33 
34 
35 #endif	/* VOLUME_H */
36