diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-02-17 09:50:30 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-02-17 09:50:30 +0000 |
commit | 5c1dfe87cb4021c905529451e5ff7718c6c94b2f (patch) | |
tree | 4be3b3537175fd9fea791aa0329ac5fe06da4a39 | |
parent | 2aeffdea0647df45c808d8203972ad1c0de9a04f (diff) | |
download | libbu++-5c1dfe87cb4021c905529451e5ff7718c6c94b2f.tar.gz libbu++-5c1dfe87cb4021c905529451e5ff7718c6c94b2f.tar.bz2 libbu++-5c1dfe87cb4021c905529451e5ff7718c6c94b2f.tar.xz libbu++-5c1dfe87cb4021c905529451e5ff7718c6c94b2f.zip |
Made some great progress on the MyriadFs spec...it's interesting, a few more
decisions to make and we're set.
Diffstat (limited to '')
-rw-r--r-- | src/myriadfs.cpp | 14 | ||||
-rw-r--r-- | src/myriadfs.h | 31 |
2 files changed, 37 insertions, 8 deletions
diff --git a/src/myriadfs.cpp b/src/myriadfs.cpp index 9f68253..c8d23b6 100644 --- a/src/myriadfs.cpp +++ b/src/myriadfs.cpp | |||
@@ -61,15 +61,15 @@ Bu::MyriadFs::MyriadFs( Bu::Stream &rStore, int iBlockSize ) : | |||
61 | #endif | 61 | #endif |
62 | int32_t iTmp32 = 0; | 62 | int32_t iTmp32 = 0; |
63 | int16_t iTmp16 = 0; | 63 | int16_t iTmp16 = 0; |
64 | ms.write( &iUser, 4 ); | 64 | ms.write( &iUser, 4 ); // User |
65 | ms.write( &iGroup, 4 ); | 65 | ms.write( &iGroup, 4 ); // Group |
66 | ms.write( &iTmp16, 2 ); | 66 | ms.write( &iTmp16, 2 ); // Meta? I...don't remember this |
67 | ms.write( &iTmp16, 2 ); | 67 | ms.write( &iTmp16, 2 ); // Permissions/types |
68 | iTmp32 = 3; | 68 | iTmp32 = 3; |
69 | ms.write( &iTmp32, 4 ); | 69 | ms.write( &iTmp32, 4 ); // Stream index |
70 | iTmp32 = 0; | 70 | iTmp32 = 0; |
71 | ms.write( &iTmp32, 4 ); | 71 | ms.write( &iTmp32, 4 ); // Parent inode |
72 | ms.write( &iTmp16, 2 ); | 72 | ms.write( &iTmp16, 2 ); // Name size |
73 | } | 73 | } |
74 | 74 | ||
75 | // Create inode 0's storage stream. | 75 | // Create inode 0's storage stream. |
diff --git a/src/myriadfs.h b/src/myriadfs.h index edbdaf5..856137c 100644 --- a/src/myriadfs.h +++ b/src/myriadfs.h | |||
@@ -19,6 +19,8 @@ namespace Bu | |||
19 | /** | 19 | /** |
20 | * A POSIX compliant, node based filesystem built on top of Myriad. | 20 | * A POSIX compliant, node based filesystem built on top of Myriad. |
21 | * | 21 | * |
22 | * Think about putting this all in one stream, on block boundaries. | ||
23 | * | ||
22 | * A header is placed into stream 1. | 24 | * A header is placed into stream 1. |
23 | * Header format: | 25 | * Header format: |
24 | * int32_t iMagicHeader (A7188B39) | 26 | * int32_t iMagicHeader (A7188B39) |
@@ -39,10 +41,13 @@ namespace Bu | |||
39 | * Basic node header format: | 41 | * Basic node header format: |
40 | * int32_t iUser | 42 | * int32_t iUser |
41 | * int32_t iGroup | 43 | * int32_t iGroup |
42 | * int16_t iMeta | ||
43 | * int16_t iPerms | 44 | * int16_t iPerms |
45 | * int16_t iLinks | ||
44 | * int32_t iStreamIndex | 46 | * int32_t iStreamIndex |
45 | * int32_t iParentNode | 47 | * int32_t iParentNode |
48 | * int64_t iATime | ||
49 | * int64_t iMTime | ||
50 | * int64_t iCTime | ||
46 | * int16_t iNameSize | 51 | * int16_t iNameSize |
47 | * char[iNameSize] sName | 52 | * char[iNameSize] sName |
48 | */ | 53 | */ |
@@ -52,6 +57,30 @@ namespace Bu | |||
52 | MyriadFs( Bu::Stream &rStore, int iBlockSize=512 ); | 57 | MyriadFs( Bu::Stream &rStore, int iBlockSize=512 ); |
53 | virtual ~MyriadFs(); | 58 | virtual ~MyriadFs(); |
54 | 59 | ||
60 | enum | ||
61 | { | ||
62 | permOthX = 0000001, | ||
63 | permOthW = 0000002, | ||
64 | permOthR = 0000004, | ||
65 | permGrpX = 0000010, | ||
66 | permGrpW = 0000020, | ||
67 | permGrpR = 0000040, | ||
68 | permUsrX = 0000100, | ||
69 | permUsrW = 0000200, | ||
70 | permUsrR = 0000400, | ||
71 | permSticky = 0001000, | ||
72 | permSetGid = 0002000, | ||
73 | permSetUid = 0004000, | ||
74 | typeFifo = 0010000, | ||
75 | typeChrDev = 0020000, | ||
76 | typeDir = 0040000, | ||
77 | typeBlkDev = 0060000, | ||
78 | typeRegFile = 0100000, | ||
79 | typeSymLink = 0120000, | ||
80 | typeSocket = 0140000, | ||
81 | typeMask = 0170000 | ||
82 | } | ||
83 | |||
55 | private: | 84 | private: |
56 | Bu::Stream &rStore; | 85 | Bu::Stream &rStore; |
57 | Bu::Myriad mStore; | 86 | Bu::Myriad mStore; |