aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-02-19 22:47:48 +0000
committerMike Buland <eichlan@xagasoft.com>2011-02-19 22:47:48 +0000
commitc88a480b9bcabf9aad4f7b66685bbafacc022cc4 (patch)
tree2ba18a5775be2b02197084029834d80b9b251a1a /src
parent401b8383079720fff1264c67f77b6d8dfc8d9b58 (diff)
downloadlibbu++-c88a480b9bcabf9aad4f7b66685bbafacc022cc4.tar.gz
libbu++-c88a480b9bcabf9aad4f7b66685bbafacc022cc4.tar.bz2
libbu++-c88a480b9bcabf9aad4f7b66685bbafacc022cc4.tar.xz
libbu++-c88a480b9bcabf9aad4f7b66685bbafacc022cc4.zip
Myriad does not handle multi-threaded access very well, that needs to be
addressed, besides that, only a couple more functions need to be added to myriadfs before it's totally ready to have linux installed on it :-P
Diffstat (limited to 'src')
-rw-r--r--src/myriadfs.cpp6
-rw-r--r--src/tools/myriadfs.cpp14
2 files changed, 14 insertions, 6 deletions
diff --git a/src/myriadfs.cpp b/src/myriadfs.cpp
index d4cf67f..b4ba733 100644
--- a/src/myriadfs.cpp
+++ b/src/myriadfs.cpp
@@ -257,7 +257,7 @@ int32_t Bu::MyriadFs::lookupInode( Bu::String::const_iterator iStart,
257 Bu::String::const_iterator iEnd = iStart.find('/'); 257 Bu::String::const_iterator iEnd = iStart.find('/');
258 Bu::String sTok( iStart, iEnd ); 258 Bu::String sTok( iStart, iEnd );
259 259
260 sio << "Direcotry component: " << sTok << sio.nl; 260// sio << "Direcotry component: " << sTok << sio.nl;
261 261
262 Dir lDir = readDir( iNode ); 262 Dir lDir = readDir( iNode );
263 263
@@ -303,7 +303,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode )
303 303
304 Bu::MyriadStream is = mStore.openStream( 2 ); 304 Bu::MyriadStream is = mStore.openStream( 2 );
305 Dir lDir; 305 Dir lDir;
306 sio << "Reading dir, " << iNumChildren << " entries:" << sio.nl; 306// sio << "Reading dir, " << iNumChildren << " entries:" << sio.nl;
307 for( int32_t j = 0; j < iNumChildren; j++ ) 307 for( int32_t j = 0; j < iNumChildren; j++ )
308 { 308 {
309 int32_t iChildNode; 309 int32_t iChildNode;
@@ -316,7 +316,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode )
316 ms.read( s.sName.getStr(), uLen ); 316 ms.read( s.sName.getStr(), uLen );
317 lDir.append( s ); 317 lDir.append( s );
318 318
319 sio << " " << s.sName << sio.nl; 319// sio << " " << s.sName << sio.nl;
320 } 320 }
321 321
322 return lDir; 322 return lDir;
diff --git a/src/tools/myriadfs.cpp b/src/tools/myriadfs.cpp
index b54390d..c4004b7 100644
--- a/src/tools/myriadfs.cpp
+++ b/src/tools/myriadfs.cpp
@@ -54,13 +54,11 @@ extern "C" {
54 static int myriadfs_readdir( const char *sPath, void *buf, 54 static int myriadfs_readdir( const char *sPath, void *buf,
55 fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi ) 55 fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi )
56 { 56 {
57 fprintf( stderr, "Reading dir...\n");
58 Bu::MyriadFs::Dir lDir = pFs->readDir( sPath ); 57 Bu::MyriadFs::Dir lDir = pFs->readDir( sPath );
59 filler( buf, ".", NULL, 0 ); 58 filler( buf, ".", NULL, 0 );
60 filler( buf, "..", NULL, 0 ); 59 filler( buf, "..", NULL, 0 );
61 for( Bu::MyriadFs::Dir::iterator i = lDir.begin(); i; i++ ) 60 for( Bu::MyriadFs::Dir::iterator i = lDir.begin(); i; i++ )
62 { 61 {
63 fprintf( stderr, "Adding file: '%s'\n", (*i).sName.getStr() );
64 filler( buf, (*i).sName.getStr(), NULL, 0 ); 62 filler( buf, (*i).sName.getStr(), NULL, 0 );
65 } 63 }
66 64
@@ -80,6 +78,7 @@ extern "C" {
80 Bu::MyriadStream ms = pFs->open( sPath, 0 ); 78 Bu::MyriadStream ms = pFs->open( sPath, 0 );
81 fi->fh = iNextFileId; 79 fi->fh = iNextFileId;
82 hOpenFiles.insert( iNextFileId++, ms ); 80 hOpenFiles.insert( iNextFileId++, ms );
81 printf("File opened, %d files open now.\n", hOpenFiles.getSize() );
83 return 0; 82 return 0;
84 } 83 }
85 catch(...) 84 catch(...)
@@ -112,6 +111,7 @@ extern "C" {
112 Bu::MyriadStream ms = pFs->open( sPath, 0 ); 111 Bu::MyriadStream ms = pFs->open( sPath, 0 );
113 fi->fh = iNextFileId; 112 fi->fh = iNextFileId;
114 hOpenFiles.insert( iNextFileId++, ms ); 113 hOpenFiles.insert( iNextFileId++, ms );
114 printf("File created, %d files open now.\n", hOpenFiles.getSize() );
115 return 0; 115 return 0;
116 } 116 }
117 catch(...) 117 catch(...)
@@ -136,6 +136,7 @@ extern "C" {
136 static int myriadfs_release( const char *sPath, struct fuse_file_info *fi ) 136 static int myriadfs_release( const char *sPath, struct fuse_file_info *fi )
137 { 137 {
138 hOpenFiles.erase( fi->fh ); 138 hOpenFiles.erase( fi->fh );
139 printf("File released, %d files open now.\n", hOpenFiles.getSize() );
139 140
140 return 0; 141 return 0;
141 } 142 }
@@ -143,7 +144,14 @@ extern "C" {
143 static int myriadfs_utimens( const char *sPath, 144 static int myriadfs_utimens( const char *sPath,
144 const struct timespec tv[2] ) 145 const struct timespec tv[2] )
145 { 146 {
146 pFs->setTimes( sPath, tv[0].tv_sec, tv[1].tv_sec ); 147 try
148 {
149 pFs->setTimes( sPath, tv[0].tv_sec, tv[1].tv_sec );
150 }
151 catch(...)
152 {
153 return -EACCES;
154 }
147 return 0; 155 return 0;
148 } 156 }
149 157