diff options
Diffstat (limited to 'src/unstable/myriadfs.cpp')
-rw-r--r-- | src/unstable/myriadfs.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unstable/myriadfs.cpp b/src/unstable/myriadfs.cpp index a2386c2..f748a53 100644 --- a/src/unstable/myriadfs.cpp +++ b/src/unstable/myriadfs.cpp | |||
@@ -108,6 +108,7 @@ Bu::MyriadFs::~MyriadFs() | |||
108 | 108 | ||
109 | void Bu::MyriadFs::stat( const Bu::String &sPath, Bu::MyriadFs::Stat &rBuf ) | 109 | void Bu::MyriadFs::stat( const Bu::String &sPath, Bu::MyriadFs::Stat &rBuf ) |
110 | { | 110 | { |
111 | Bu::MutexLocker lLock( mAccess ); | ||
111 | int32_t iParent; | 112 | int32_t iParent; |
112 | int32_t iNode = lookupInode( sPath, iParent ); | 113 | int32_t iNode = lookupInode( sPath, iParent ); |
113 | Bu::MyriadStream is = mStore.open( 2, Bu::Myriad::Read ); | 114 | Bu::MyriadStream is = mStore.open( 2, Bu::Myriad::Read ); |
@@ -117,6 +118,7 @@ void Bu::MyriadFs::stat( const Bu::String &sPath, Bu::MyriadFs::Stat &rBuf ) | |||
117 | Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int iMode, | 118 | Bu::MyriadStream Bu::MyriadFs::open( const Bu::String &sPath, int iMode, |
118 | uint16_t uPerms ) | 119 | uint16_t uPerms ) |
119 | { | 120 | { |
121 | Bu::MutexLocker lLock( mAccess ); | ||
120 | int32_t iParent = -1; | 122 | int32_t iParent = -1; |
121 | int32_t iNode; | 123 | int32_t iNode; |
122 | try | 124 | try |
@@ -165,6 +167,7 @@ void Bu::MyriadFs::create( const Bu::String &sPath, uint16_t iPerms, | |||
165 | void Bu::MyriadFs::create( const Bu::String &sPath, uint16_t iPerms, | 167 | void Bu::MyriadFs::create( const Bu::String &sPath, uint16_t iPerms, |
166 | uint32_t uSpecial ) | 168 | uint32_t uSpecial ) |
167 | { | 169 | { |
170 | Bu::MutexLocker lLock( mAccess ); | ||
168 | int32_t iParent = -1; | 171 | int32_t iParent = -1; |
169 | // int32_t iNode; | 172 | // int32_t iNode; |
170 | try | 173 | try |
@@ -201,6 +204,7 @@ void Bu::MyriadFs::mkDir( const Bu::String &sPath, uint16_t iPerms ) | |||
201 | void Bu::MyriadFs::mkSymLink( const Bu::String &sTarget, | 204 | void Bu::MyriadFs::mkSymLink( const Bu::String &sTarget, |
202 | const Bu::String &sPath ) | 205 | const Bu::String &sPath ) |
203 | { | 206 | { |
207 | Bu::MutexLocker lLock( mAccess ); | ||
204 | int32_t iParent = -1; | 208 | int32_t iParent = -1; |
205 | int32_t iNode; | 209 | int32_t iNode; |
206 | try | 210 | try |
@@ -233,6 +237,7 @@ void Bu::MyriadFs::mkSymLink( const Bu::String &sTarget, | |||
233 | void Bu::MyriadFs::mkHardLink( const Bu::String &sTarget, | 237 | void Bu::MyriadFs::mkHardLink( const Bu::String &sTarget, |
234 | const Bu::String &sPath ) | 238 | const Bu::String &sPath ) |
235 | { | 239 | { |
240 | Bu::MutexLocker lLock( mAccess ); | ||
236 | int32_t iParent = -1; | 241 | int32_t iParent = -1; |
237 | int32_t iNode; | 242 | int32_t iNode; |
238 | 243 | ||
@@ -268,6 +273,7 @@ void Bu::MyriadFs::mkHardLink( const Bu::String &sTarget, | |||
268 | 273 | ||
269 | Bu::String Bu::MyriadFs::readSymLink( const Bu::String &sPath ) | 274 | Bu::String Bu::MyriadFs::readSymLink( const Bu::String &sPath ) |
270 | { | 275 | { |
276 | Bu::MutexLocker lLock( mAccess ); | ||
271 | int32_t iParent = -1; | 277 | int32_t iParent = -1; |
272 | int32_t iNode; | 278 | int32_t iNode; |
273 | iNode = lookupInode( sPath, iParent ); | 279 | iNode = lookupInode( sPath, iParent ); |
@@ -280,6 +286,7 @@ Bu::String Bu::MyriadFs::readSymLink( const Bu::String &sPath ) | |||
280 | 286 | ||
281 | Bu::MyriadFs::Dir Bu::MyriadFs::readDir( const Bu::String &sPath ) | 287 | Bu::MyriadFs::Dir Bu::MyriadFs::readDir( const Bu::String &sPath ) |
282 | { | 288 | { |
289 | Bu::MutexLocker lLock( mAccess ); | ||
283 | int32_t iParent = -1; | 290 | int32_t iParent = -1; |
284 | int32_t iNode = lookupInode( sPath, iParent ); | 291 | int32_t iNode = lookupInode( sPath, iParent ); |
285 | return readDir( iNode ); | 292 | return readDir( iNode ); |
@@ -288,6 +295,7 @@ Bu::MyriadFs::Dir Bu::MyriadFs::readDir( const Bu::String &sPath ) | |||
288 | void Bu::MyriadFs::setTimes( const Bu::String &sPath, int64_t iATime, | 295 | void Bu::MyriadFs::setTimes( const Bu::String &sPath, int64_t iATime, |
289 | int64_t iMTime ) | 296 | int64_t iMTime ) |
290 | { | 297 | { |
298 | Bu::MutexLocker lLock( mAccess ); | ||
291 | int32_t iParent = -1; | 299 | int32_t iParent = -1; |
292 | int32_t iNode; | 300 | int32_t iNode; |
293 | 301 | ||
@@ -298,6 +306,7 @@ void Bu::MyriadFs::setTimes( const Bu::String &sPath, int64_t iATime, | |||
298 | 306 | ||
299 | void Bu::MyriadFs::unlink( const Bu::String &sPath ) | 307 | void Bu::MyriadFs::unlink( const Bu::String &sPath ) |
300 | { | 308 | { |
309 | Bu::MutexLocker lLock( mAccess ); | ||
301 | int32_t iParent = -1; | 310 | int32_t iParent = -1; |
302 | // int32_t iNode; | 311 | // int32_t iNode; |
303 | 312 | ||
@@ -353,6 +362,7 @@ void Bu::MyriadFs::unlink( const Bu::String &sPath ) | |||
353 | 362 | ||
354 | void Bu::MyriadFs::setFileSize( const Bu::String &sPath, int32_t iSize ) | 363 | void Bu::MyriadFs::setFileSize( const Bu::String &sPath, int32_t iSize ) |
355 | { | 364 | { |
365 | Bu::MutexLocker lLock( mAccess ); | ||
356 | int32_t iParent = -1; | 366 | int32_t iParent = -1; |
357 | int32_t iNode; | 367 | int32_t iNode; |
358 | iNode = lookupInode( sPath, iParent ); | 368 | iNode = lookupInode( sPath, iParent ); |
@@ -362,6 +372,7 @@ void Bu::MyriadFs::setFileSize( const Bu::String &sPath, int32_t iSize ) | |||
362 | 372 | ||
363 | void Bu::MyriadFs::rename( const Bu::String &sFrom, const Bu::String &sTo ) | 373 | void Bu::MyriadFs::rename( const Bu::String &sFrom, const Bu::String &sTo ) |
364 | { | 374 | { |
375 | Bu::MutexLocker lLock( mAccess ); | ||
365 | mkHardLink( sFrom, sTo ); | 376 | mkHardLink( sFrom, sTo ); |
366 | unlink( sFrom ); | 377 | unlink( sFrom ); |
367 | } | 378 | } |