"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "encfs/Context.cpp" between
encfs-1.9.4.tar.gz and encfs-1.9.5.tar.gz

About: EncFS is an encrypted virtual filesystem for Linux using the FUSE kernel module.

Context.cpp  (encfs-1.9.4):Context.cpp  (encfs-1.9.5)
skipping to change at line 50 skipping to change at line 50
} }
EncFS_Context::~EncFS_Context() { EncFS_Context::~EncFS_Context() {
pthread_mutex_destroy(&contextMutex); pthread_mutex_destroy(&contextMutex);
pthread_mutex_destroy(&wakeupMutex); pthread_mutex_destroy(&wakeupMutex);
pthread_cond_destroy(&wakeupCond); pthread_cond_destroy(&wakeupCond);
// release all entries from map // release all entries from map
openFiles.clear(); openFiles.clear();
} }
std::shared_ptr<DirNode> EncFS_Context::getRoot(int *errCode) { std::shared_ptr<DirNode> EncFS_Context::getRoot(int *errCode) {
return getRoot(errCode, false);
}
std::shared_ptr<DirNode> EncFS_Context::getRoot(int *errCode, bool skipUsageCoun
t) {
std::shared_ptr<DirNode> ret = nullptr; std::shared_ptr<DirNode> ret = nullptr;
do { do {
{ {
Lock lock(contextMutex); Lock lock(contextMutex);
if (isUnmounting) { if (isUnmounting) {
*errCode = -EBUSY; *errCode = -EBUSY;
break; break;
} }
ret = root; ret = root;
++usageCount; // On some system, stat of "/" is allowed even if the calling user is
// not allowed to list / to go deeper. Do not then count this call.
if (!skipUsageCount) {
++usageCount;
}
} }
if (!ret) { if (!ret) {
int res = remountFS(this); int res = remountFS(this);
if (res != 0) { if (res != 0) {
*errCode = res; *errCode = res;
break; break;
} }
} }
} while (!ret); } while (!ret);
skipping to change at line 110 skipping to change at line 119
usageCount = 0; usageCount = 0;
if (idleCount < timeoutCycles) { if (idleCount < timeoutCycles) {
return false; return false;
} }
if (!openFiles.empty()) { if (!openFiles.empty()) {
if (idleCount % timeoutCycles == 0) { if (idleCount % timeoutCycles == 0) {
RLOG(WARNING) << "Filesystem inactive, but " << openFiles.size() RLOG(WARNING) << "Filesystem inactive, but " << openFiles.size()
<< " files opened: " << this->opts->mountPoint; << " files opened: " << this->opts->unmountPoint;
} }
return false; return false;
} }
if (!this->opts->mountOnDemand) { if (!this->opts->mountOnDemand) {
isUnmounting = true; isUnmounting = true;
} }
lock.~Lock(); lock.~Lock();
return unmountFS(this); return unmountFS(this);
} }
skipping to change at line 165 skipping to change at line 174
fuseFhMap[node->fuseFh] = node; fuseFhMap[node->fuseFh] = node;
} }
// eraseNode is called by encfs_release in response to the RELEASE // eraseNode is called by encfs_release in response to the RELEASE
// FUSE-command we get from the kernel. // FUSE-command we get from the kernel.
void EncFS_Context::eraseNode(const char *path, void EncFS_Context::eraseNode(const char *path,
const std::shared_ptr<FileNode> &fnode) { const std::shared_ptr<FileNode> &fnode) {
Lock lock(contextMutex); Lock lock(contextMutex);
auto it = openFiles.find(std::string(path)); auto it = openFiles.find(std::string(path));
#ifdef __CYGWIN__
// When renaming a file, Windows first opens it, renames it and then closes it
// Filenode may have then been renamed too
if (it == openFiles.end()) {
RLOG(WARNING) << "Filenode to erase not found, file has certainly be renamed
: "
<< path;
return;
}
#endif
rAssert(it != openFiles.end()); rAssert(it != openFiles.end());
auto &list = it->second; auto &list = it->second;
// Find "fnode" in the list of FileNodes registered under this path. // Find "fnode" in the list of FileNodes registered under this path.
auto findIter = std::find(list.begin(), list.end(), fnode); auto findIter = std::find(list.begin(), list.end(), fnode);
rAssert(findIter != list.end()); rAssert(findIter != list.end());
list.erase(findIter); list.erase(findIter);
// If no reference to "fnode" remains, drop the entry from fuseFhMap // If no reference to "fnode" remains, drop the entry from fuseFhMap
// and overwrite the canary. // and overwrite the canary.
 End of changes. 5 change blocks. 
2 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)