aboutsummaryrefslogtreecommitdiff
path: root/src/unstable
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/unstable/myriadcache.h4
-rw-r--r--src/unstable/myriadfs.cpp19
-rw-r--r--src/unstable/myriadfs.h4
3 files changed, 9 insertions, 18 deletions
diff --git a/src/unstable/myriadcache.h b/src/unstable/myriadcache.h
index d6842a5..f71f9b5 100644
--- a/src/unstable/myriadcache.h
+++ b/src/unstable/myriadcache.h
@@ -86,8 +86,8 @@ namespace Bu
86 { 86 {
87 Bu::ReadWriteMutex::WriteLocker wl( rwStore ); 87 Bu::ReadWriteMutex::WriteLocker wl( rwStore );
88 { 88 {
89 Bu::MyriadStream ms = mStore.create( Bu::Myriad::Create ); 89 Bu::Myriad::StreamId id = mStore.allocate();
90 hIndex.insert( o->getKey(), ms.getId() ); 90 hIndex.insert( o->getKey(), id );
91 } 91 }
92 _save( o ); 92 _save( o );
93 93
diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp
index 2eda0be..a2386c2 100644
--- a/src/unstable/myriadfs.cpp
+++ b/src/unstable/myriadfs.cpp
@@ -8,6 +8,7 @@
8#include "bu/config.h" 8#include "bu/config.h"
9#include "bu/myriadfs.h" 9#include "bu/myriadfs.h"
10#include "bu/myriadstream.h" 10#include "bu/myriadstream.h"
11#include "bu/mutexlocker.h"
11 12
12#include <string.h> 13#include <string.h>
13#include <unistd.h> 14#include <unistd.h>
@@ -572,27 +573,17 @@ int32_t Bu::MyriadFs::allocInode( uint16_t uPerms, uint32_t uSpecial )
572 { 573 {
573 case typeRegFile: 574 case typeRegFile:
574 case typeSymLink: 575 case typeSymLink:
575 { 576 rs.uStreamIndex = mStore.allocate();
576 Bu::MyriadStream ms = mStore.create(
577 Bu::Myriad::Read
578 );
579 rs.uStreamIndex = ms.getId();
580 }
581 break; 577 break;
582 578
583 case typeDir: 579 case typeDir:
584 {
585 Bu::MyriadStream ms = mStore.create(
586 Bu::Myriad::Read
587 );
588 rs.uStreamIndex = ms.getId();
589 }
590// sio << "Creating directory node, storage: " 580// sio << "Creating directory node, storage: "
591// << rs.uStreamIndex << sio.nl; 581// << rs.uStreamIndex << sio.nl;
592 { 582 {
593 Bu::MyriadStream msDir = mStore.open( 583 Bu::MyriadStream msDir = mStore.create(
594 rs.uStreamIndex, Bu::Myriad::Write 584 Bu::Myriad::Write
595 ); 585 );
586 rs.uStreamIndex = msDir.getId();
596 uint32_t uSize = 0; 587 uint32_t uSize = 0;
597 msDir.write( &uSize, 4 ); 588 msDir.write( &uSize, 4 );
598 } 589 }
diff --git a/src/unstable/myriadfs.h b/src/unstable/myriadfs.h
index eccac65..4e1749e 100644
--- a/src/unstable/myriadfs.h
+++ b/src/unstable/myriadfs.h
@@ -11,7 +11,7 @@
11#include <sys/types.h> 11#include <sys/types.h>
12 12
13#include "bu/myriad.h" 13#include "bu/myriad.h"
14#include "bu/readwritemutex.h" 14#include "bu/mutex.h"
15 15
16namespace Bu 16namespace Bu
17{ 17{
@@ -195,7 +195,7 @@ namespace Bu
195 private: 195 private:
196 Bu::Stream &rStore; 196 Bu::Stream &rStore;
197 Bu::Myriad mStore; 197 Bu::Myriad mStore;
198 Bu::ReadWriteMutex mNodeIndex; 198 Bu::Mutex mAccess;
199 NodeIndex hNodeIndex; 199 NodeIndex hNodeIndex;
200 int32_t iUser; 200 int32_t iUser;
201 int32_t iGroup; 201 int32_t iGroup;