diff options
Diffstat (limited to 'netfs/fuse/fuseFiles.cpp')
-rw-r--r-- | netfs/fuse/fuseFiles.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp index 4a96e51..c8d2495 100644 --- a/netfs/fuse/fuseFiles.cpp +++ b/netfs/fuse/fuseFiles.cpp @@ -21,7 +21,6 @@ NetFS::FuseApp::setProxy(OpenFilePtr of, uint64_t & fh) NetFS::FuseApp::OpenFilePtr NetFS::FuseApp::getFileProxy(uint64_t localID) const { - SLOCK; OpenFiles::const_iterator i = openFiles.find(localID); if (i != openFiles.end()) { return i->second; @@ -66,7 +65,11 @@ int NetFS::FuseApp::release(const char *, struct fuse_file_info * fi) { try { - auto remote = getFileProxy(fi->fh)->remote; + FilePrx remote; + { + LOCK; + remote = getFileProxy(fi->fh)->remote; + } remote->close(); clearFileProxy(fi->fh); return 0; @@ -80,7 +83,11 @@ int NetFS::FuseApp::read(const char *, char * buf, size_t s, off_t o, struct fuse_file_info * fi) { try { - auto remote = getFileProxy(fi->fh)->remote; + FilePrx remote; + { + LOCK; + remote = getFileProxy(fi->fh)->remote; + } NetFS::Buffer data = remote->read(o, s); memcpy(buf, &data.front(), data.size()); return data.size(); @@ -94,7 +101,11 @@ int NetFS::FuseApp::write(const char *, const char * buf, size_t s, off_t o, struct fuse_file_info * fi) { try { - auto remote = getFileProxy(fi->fh)->remote; + FilePrx remote; + { + LOCK; + remote = getFileProxy(fi->fh)->remote; + } remote->write(o, s, NetFS::Buffer(buf, buf + s)); return s; } @@ -119,7 +130,11 @@ int NetFS::FuseApp::ftruncate(const char *, off_t o, fuse_file_info * fi) { try { - auto remote = getFileProxy(fi->fh)->remote; + FilePrx remote; + { + LOCK; + remote = getFileProxy(fi->fh)->remote; + } remote->ftruncate(reqEnv(), o); return 0; } @@ -132,7 +147,11 @@ int NetFS::FuseApp::fgetattr(const char *, struct stat * s, fuse_file_info * fi) { try { - auto remote = getFileProxy(fi->fh)->remote; + FilePrx remote; + { + LOCK; + remote = getFileProxy(fi->fh)->remote; + } *s << AttrSource { remote->fgetattr(reqEnv()), boost::bind(&UserEntCache::getID, &uentries, _1), boost::bind(&GroupEntCache::getID, &gentries, _1) }; return 0; } |