summaryrefslogtreecommitdiff
path: root/src/myriadfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/myriadfs.h')
-rw-r--r--src/myriadfs.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/myriadfs.h b/src/myriadfs.h
new file mode 100644
index 0000000..42a3493
--- /dev/null
+++ b/src/myriadfs.h
@@ -0,0 +1,54 @@
1#ifndef MYRIAD_FS_H
2#define MYRIAD_FS_H
3
4#include "bu/myriad.h"
5
6namespace Bu
7{
8 class Stream;
9
10 subExceptionDecl( MyriadFsException );
11
12 /**
13 * A POSIX compliant, node based filesystem built on top of Myriad.
14 *
15 * A header is placed into stream 1.
16 * Header format:
17 * int32_t iMagicHeader (A7188B39)
18 * int8_t iVersion (1)
19 * int32_t iNodeSize
20 * int32_t iNumNodes
21 * NodeLookup[iNumNodes] nNode
22 *
23 * Node lookup:
24 * int32_t iInode
25 * int32_t iPosition
26 *
27 * The node headers or inode structures have a base size of 22 bytes.
28 * Everything else in the block is used for the name. I.e. if you have
29 * a blocksize of 512 bytes then you wind up with a max name size of
30 * 512-22=490 characters, or a blocksize of 256 gives you 234 chraacters
31 * as a max. The node headers are all stored in stream 2.
32 * Basic node header format:
33 * int32_t iUser
34 * int32_t iGroup
35 * int16_t iMeta
36 * int16_t iPerms
37 * int32_t iStreamIndex
38 * int32_t iParentNode
39 * int16_t iNameSize
40 * char[iNameSize] sName
41 */
42 class MyriadFs
43 {
44 public:
45 MyriadFs( Bu::Stream &rStore, int iBlockSize=512 );
46 virtual ~MyriadFs();
47
48 private:
49 Bu::Stream &rStore;
50 Bu::Myriad mStore;
51 };
52};
53
54#endif