From c88a480b9bcabf9aad4f7b66685bbafacc022cc4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 19 Feb 2011 22:47:48 +0000 Subject: 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 --- src/myriadfs.cpp | 6 +++--- src/tools/myriadfs.cpp | 14 +++++++++++--- 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, Bu::String::const_iterator iEnd = iStart.find('/'); Bu::String sTok( iStart, iEnd ); - sio << "Direcotry component: " << sTok << sio.nl; +// sio << "Direcotry component: " << sTok << sio.nl; Dir lDir = readDir( iNode ); @@ -303,7 +303,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) Bu::MyriadStream is = mStore.openStream( 2 ); Dir lDir; - sio << "Reading dir, " << iNumChildren << " entries:" << sio.nl; +// sio << "Reading dir, " << iNumChildren << " entries:" << sio.nl; for( int32_t j = 0; j < iNumChildren; j++ ) { int32_t iChildNode; @@ -316,7 +316,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( int32_t iNode ) ms.read( s.sName.getStr(), uLen ); lDir.append( s ); - sio << " " << s.sName << sio.nl; +// sio << " " << s.sName << sio.nl; } 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" { static int myriadfs_readdir( const char *sPath, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi ) { - fprintf( stderr, "Reading dir...\n"); Bu::MyriadFs::Dir lDir = pFs->readDir( sPath ); filler( buf, ".", NULL, 0 ); filler( buf, "..", NULL, 0 ); for( Bu::MyriadFs::Dir::iterator i = lDir.begin(); i; i++ ) { - fprintf( stderr, "Adding file: '%s'\n", (*i).sName.getStr() ); filler( buf, (*i).sName.getStr(), NULL, 0 ); } @@ -80,6 +78,7 @@ extern "C" { Bu::MyriadStream ms = pFs->open( sPath, 0 ); fi->fh = iNextFileId; hOpenFiles.insert( iNextFileId++, ms ); + printf("File opened, %d files open now.\n", hOpenFiles.getSize() ); return 0; } catch(...) @@ -112,6 +111,7 @@ extern "C" { Bu::MyriadStream ms = pFs->open( sPath, 0 ); fi->fh = iNextFileId; hOpenFiles.insert( iNextFileId++, ms ); + printf("File created, %d files open now.\n", hOpenFiles.getSize() ); return 0; } catch(...) @@ -136,6 +136,7 @@ extern "C" { static int myriadfs_release( const char *sPath, struct fuse_file_info *fi ) { hOpenFiles.erase( fi->fh ); + printf("File released, %d files open now.\n", hOpenFiles.getSize() ); return 0; } @@ -143,7 +144,14 @@ extern "C" { static int myriadfs_utimens( const char *sPath, const struct timespec tv[2] ) { - pFs->setTimes( sPath, tv[0].tv_sec, tv[1].tv_sec ); + try + { + pFs->setTimes( sPath, tv[0].tv_sec, tv[1].tv_sec ); + } + catch(...) + { + return -EACCES; + } return 0; } -- cgit v1.2.3