summaryrefslogtreecommitdiff
path: root/netfs/fuse/fuseFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/fuse/fuseFiles.cpp')
-rw-r--r--netfs/fuse/fuseFiles.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index 4a96e51..112c383 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -2,6 +2,7 @@
#include <string.h>
#include <typeConvert.h>
#include "fuse.h"
+#include "lockHelpers.h"
NetFS::FuseApp::OpenFile::OpenFile(FilePrx r, const std::string & p, int f) :
remote(r),
@@ -13,7 +14,7 @@ NetFS::FuseApp::OpenFile::OpenFile(FilePrx r, const std::string & p, int f) :
void
NetFS::FuseApp::setProxy(OpenFilePtr of, uint64_t & fh)
{
- LOCK;
+ Lock(_lock);
while (openFiles.find(fh = ++openFileID) != openFiles.end()) ;
openFiles.insert({ fh, of });
}
@@ -21,7 +22,7 @@ NetFS::FuseApp::setProxy(OpenFilePtr of, uint64_t & fh)
NetFS::FuseApp::OpenFilePtr
NetFS::FuseApp::getFileProxy(uint64_t localID) const
{
- SLOCK;
+ SharedLock(_lock);
OpenFiles::const_iterator i = openFiles.find(localID);
if (i != openFiles.end()) {
return i->second;
@@ -32,7 +33,7 @@ NetFS::FuseApp::getFileProxy(uint64_t localID) const
void
NetFS::FuseApp::clearFileProxy(uint64_t localID)
{
- LOCK;
+ Lock(_lock);
openFiles.erase(localID);
}