summaryrefslogtreecommitdiff
path: root/netfs/fuse
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-06-05 08:59:26 +0000
committerrandomdan <randomdan@localhost>2014-06-05 08:59:26 +0000
commit489824e6f44614f864fccc8f7b4fe9d672990cc3 (patch)
treebf1606dcaf162b56f824e34fe810db6539360866 /netfs/fuse
parentSplit out ICE support from project jam file, add support for slicer (diff)
downloadnetfs-489824e6f44614f864fccc8f7b4fe9d672990cc3.tar.bz2
netfs-489824e6f44614f864fccc8f7b4fe9d672990cc3.tar.xz
netfs-489824e6f44614f864fccc8f7b4fe9d672990cc3.zip
Static entry caches
Improved checking of user/group memberships
Diffstat (limited to 'netfs/fuse')
-rw-r--r--netfs/fuse/fuse.cpp3
-rw-r--r--netfs/fuse/fuse.h3
-rw-r--r--netfs/fuse/fuseDirs.cpp3
-rw-r--r--netfs/fuse/fuseFiles.cpp3
-rw-r--r--netfs/fuse/fuseMisc.cpp3
5 files changed, 8 insertions, 7 deletions
diff --git a/netfs/fuse/fuse.cpp b/netfs/fuse/fuse.cpp
index 3d14d1c..559c57c 100644
--- a/netfs/fuse/fuse.cpp
+++ b/netfs/fuse/fuse.cpp
@@ -4,6 +4,7 @@
#include "fuse.h"
#include "lockHelpers.h"
#include "cache.impl.h"
+#include <entCache.h>
template class Cache<struct stat, std::string, IceUtil::Shared, IceUtil::Handle<Cacheable<struct stat, std::string, IceUtil::Shared>>>;
template class OptimisticCallCacheable<struct stat, std::string, IceUtil::Shared>;
@@ -148,7 +149,7 @@ NetFS::FuseApp::reqEnv()
connectToService();
connectToVolume();
struct fuse_context * c = fuse_get_context();
- return { uentries.getName(c->uid), gentries.getName(c->gid) };
+ return { UserEntCache::instance.getName(c->uid), GroupEntCache::instance.getName(c->gid) };
}
int
diff --git a/netfs/fuse/fuse.h b/netfs/fuse/fuse.h
index d95dec4..859c3e6 100644
--- a/netfs/fuse/fuse.h
+++ b/netfs/fuse/fuse.h
@@ -6,7 +6,6 @@
#include <service.h>
#include "fuseapp.h"
#include "fuseConfig.h"
-#include "entCache.h"
#include "cache.h"
namespace NetFS {
@@ -102,8 +101,6 @@ namespace NetFS {
std::string exportName;
std::string configPath;
- UserEntCache uentries;
- GroupEntCache gentries;
OpenDirs openDirs;
int openDirID;
OpenFiles openFiles;
diff --git a/netfs/fuse/fuseDirs.cpp b/netfs/fuse/fuseDirs.cpp
index 35aad94..4c1b2aa 100644
--- a/netfs/fuse/fuseDirs.cpp
+++ b/netfs/fuse/fuseDirs.cpp
@@ -3,6 +3,7 @@
#include "misc.h"
#include "lockHelpers.h"
#include <typeConvert.h>
+#include <entCache.h>
NetFS::FuseApp::OpenDir::OpenDir(DirectoryPrx r, const std::string & p) :
remote(r),
@@ -78,7 +79,7 @@ NetFS::FuseApp::readdir(const char * p, void * buf, fuse_fill_dir_t filler, off_
statCache.Add(new OptimisticCallCacheable<struct stat, std::string, IceUtil::Shared>(
[asga,this]() {
struct stat s;
- s << AttrSource { volume->end_getattr(asga), boost::bind(&UserEntCache::getID, &uentries, _1), boost::bind(&GroupEntCache::getID, &gentries, _1) };
+ s << AttrSource { volume->end_getattr(asga), boost::bind(&UserEntCache::getID, &UserEntCache::instance, _1), boost::bind(&GroupEntCache::getID, &GroupEntCache::instance, _1) };
return s;
}, epath, time_t(NULL) + 2));
}
diff --git a/netfs/fuse/fuseFiles.cpp b/netfs/fuse/fuseFiles.cpp
index 112c383..9ce260c 100644
--- a/netfs/fuse/fuseFiles.cpp
+++ b/netfs/fuse/fuseFiles.cpp
@@ -3,6 +3,7 @@
#include <typeConvert.h>
#include "fuse.h"
#include "lockHelpers.h"
+#include <entCache.h>
NetFS::FuseApp::OpenFile::OpenFile(FilePrx r, const std::string & p, int f) :
remote(r),
@@ -134,7 +135,7 @@ NetFS::FuseApp::fgetattr(const char *, struct stat * s, fuse_file_info * fi)
{
try {
auto remote = getFileProxy(fi->fh)->remote;
- *s << AttrSource { remote->fgetattr(reqEnv()), boost::bind(&UserEntCache::getID, &uentries, _1), boost::bind(&GroupEntCache::getID, &gentries, _1) };
+ *s << AttrSource { remote->fgetattr(reqEnv()), boost::bind(&UserEntCache::getID, &UserEntCache::instance, _1), boost::bind(&GroupEntCache::getID, &GroupEntCache::instance, _1) };
return 0;
}
catch (NetFS::SystemError & e) {
diff --git a/netfs/fuse/fuseMisc.cpp b/netfs/fuse/fuseMisc.cpp
index 1eecdd4..d5064f3 100644
--- a/netfs/fuse/fuseMisc.cpp
+++ b/netfs/fuse/fuseMisc.cpp
@@ -2,6 +2,7 @@
#include "fuse.h"
#include <string.h>
#include <typeConvert.h>
+#include <entCache.h>
int
NetFS::FuseApp::access(const char * p, int a)
@@ -18,7 +19,7 @@ NetFS::FuseApp::getattr(const char * p, struct stat * s)
*s = *cacehedStat;
}
else {
- *s << AttrSource { volume->getattr(reqEnv(), p), boost::bind(&UserEntCache::getID, &uentries, _1), boost::bind(&GroupEntCache::getID, &gentries, _1) };
+ *s << AttrSource { volume->getattr(reqEnv(), p), boost::bind(&UserEntCache::getID, &UserEntCache::instance, _1), boost::bind(&GroupEntCache::getID, &GroupEntCache::instance, _1) };
}
return 0;
}