summaryrefslogtreecommitdiff
path: root/src/myriadfs.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-02-19 07:15:19 +0000
committerMike Buland <eichlan@xagasoft.com>2011-02-19 07:15:19 +0000
commit401b8383079720fff1264c67f77b6d8dfc8d9b58 (patch)
treec0586ebcbe145816c7e9eef7cb3aba543e23b808 /src/myriadfs.h
parent26bb069c535e3fd5b0e0fb28fb54a2a540b60a84 (diff)
downloadlibbu++-401b8383079720fff1264c67f77b6d8dfc8d9b58.tar.gz
libbu++-401b8383079720fff1264c67f77b6d8dfc8d9b58.tar.bz2
libbu++-401b8383079720fff1264c67f77b6d8dfc8d9b58.tar.xz
libbu++-401b8383079720fff1264c67f77b6d8dfc8d9b58.zip
MyriadFs is getting good!
Diffstat (limited to 'src/myriadfs.h')
-rw-r--r--src/myriadfs.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/myriadfs.h b/src/myriadfs.h
index 3eecca5..0b9c97f 100644
--- a/src/myriadfs.h
+++ b/src/myriadfs.h
@@ -32,23 +32,18 @@ namespace Bu
32 * int32_t iInode 32 * int32_t iInode
33 * int32_t iPosition 33 * int32_t iPosition
34 * 34 *
35 * The node headers or inode structures have a base size of 46 bytes. 35 * The node headers or inode structures have a base size of 44 bytes.
36 * Everything else in the block is used for the name. I.e. if you have 36 * The name is stored in the directory format.
37 * a blocksize of 512 bytes then you wind up with a max name size of
38 * 512-46=466 characters, or a blocksize of 256 gives you 210 chraacters
39 * as a max. The node headers are all stored in stream 2.
40 * Basic node header format: 37 * Basic node header format:
38 * int32_t iNode
41 * int32_t iUser 39 * int32_t iUser
42 * int32_t iGroup 40 * int32_t iGroup
43 * uint16_t uPerms 41 * uint16_t uPerms
44 * int16_t iLinks 42 * int16_t iLinks
45 * uint32_t uStreamIndex 43 * uint32_t uStreamIndex
46 * int32_t iParentNode
47 * int64_t iATime 44 * int64_t iATime
48 * int64_t iMTime 45 * int64_t iMTime
49 * int64_t iCTime 46 * int64_t iCTime
50 * int16_t iNameSize
51 * char[iNameSize] sName
52 * 47 *
53 * Some types get special formats for their assosiated data stream, or 48 * Some types get special formats for their assosiated data stream, or
54 * other special considerations, here's a list: 49 * other special considerations, here's a list:
@@ -70,6 +65,8 @@ namespace Bu
70 * 65 *
71 * NodeTable: 66 * NodeTable:
72 * int32_t iInode 67 * int32_t iInode
68 * uint8_t uNameSize
69 * char[uNameSize] sName
73 */ 70 */
74 class MyriadFs 71 class MyriadFs
75 { 72 {
@@ -144,6 +141,9 @@ namespace Bu
144 uint32_t uSpecial ); 141 uint32_t uSpecial );
145 void mkDir( const Bu::String &sPath, uint16_t iPerms ); 142 void mkDir( const Bu::String &sPath, uint16_t iPerms );
146 Dir readDir( const Bu::String &sPath ); 143 Dir readDir( const Bu::String &sPath );
144 void setTimes( const Bu::String &sPath, int64_t iATime,
145 int64_t iMTime );
146 void unlink( const Bu::String &sPath );
147 147
148 static dev_t devToSys( uint32_t uDev ); 148 static dev_t devToSys( uint32_t uDev );
149 static uint32_t sysToDev( dev_t uDev ); 149 static uint32_t sysToDev( dev_t uDev );
@@ -152,16 +152,15 @@ namespace Bu
152 class RawStat 152 class RawStat
153 { 153 {
154 public: 154 public:
155 int32_t iNode;
155 int32_t iUser; 156 int32_t iUser;
156 int32_t iGroup; 157 int32_t iGroup;
157 uint16_t uPerms; 158 uint16_t uPerms;
158 int16_t iLinks; 159 int16_t iLinks;
159 uint32_t uStreamIndex; 160 uint32_t uStreamIndex;
160 int32_t iParentNode;
161 int64_t iATime; 161 int64_t iATime;
162 int64_t iMTime; 162 int64_t iMTime;
163 int64_t iCTime; 163 int64_t iCTime;
164 int16_t iNameSize;
165 }; 164 };
166 typedef Bu::Hash<int32_t, int32_t> NodeIndex; 165 typedef Bu::Hash<int32_t, int32_t> NodeIndex;
167 166
@@ -173,10 +172,11 @@ namespace Bu
173 MyriadStream openByInode( int32_t iNode ); 172 MyriadStream openByInode( int32_t iNode );
174 int32_t create( int32_t iParent, const Bu::String &sName, 173 int32_t create( int32_t iParent, const Bu::String &sName,
175 uint16_t uPerms, uint32_t uSpecial ); 174 uint16_t uPerms, uint32_t uSpecial );
176 int32_t allocInode( const Bu::String &sName, int32_t iParent, 175 int32_t allocInode( uint16_t uPerms, uint32_t uSpecial );
177 uint16_t uPerms, uint32_t uSpecial );
178 void stat( int32_t iNode, Stat &rBuf, MyriadStream &rIs ); 176 void stat( int32_t iNode, Stat &rBuf, MyriadStream &rIs );
177 void unlink( int32_t iNode );
179 void writeHeader(); 178 void writeHeader();
179 void setTimes( int32_t iNode, int64_t iATime, int64_t iMTime );
180 180
181 private: 181 private:
182 Bu::Stream &rStore; 182 Bu::Stream &rStore;