aboutsummaryrefslogtreecommitdiff
path: root/src/myriadfs.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-10 21:04:17 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-10 21:04:17 +0000
commit2ba3f84ab559da02a11aa000b3cecb3b3668af61 (patch)
tree266f450b512f607ec54d54af4fa8c13fdbe7ef91 /src/myriadfs.h
parentea18007633b31901f2ae275cc0576c3f7ce99fc9 (diff)
parent3611f253f6fdfa4954d374ab85ddaa7f799c130c (diff)
downloadlibbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.gz
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.bz2
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.xz
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.zip
Merged in the core branch. This is a major update that fixes many things, and
changes many others, including source files that were deleted and renamed. Before doing this update, I reccomend a full clean, or even a fresh checkout. Things to note, most outstanding about this update: - Bu::Socket was changed to Bu::TcpSocket and the default mode is blocking. - All templatized container classes are SharedCore now, which is good, but SharedCore is inherently non-reentrant safe. However, all SharedCore classes have a "clone" function that return a non-shared copy of the object, safe for passing into a reentrant safe function accessing shared memory.
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