summaryrefslogtreecommitdiff
path: root/netfs/fuse
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-09-02 19:46:51 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-09-02 19:48:19 +0100
commit9e5cee2e54a3482605d524f13eedb1cbfba5a971 (patch)
tree50db6df865c4d5eec3181e4354efb4c80e4170e4 /netfs/fuse
parentImprove error handling around ICE exceptions (diff)
downloadnetfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.tar.bz2
netfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.tar.xz
netfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.zip
Use libadhocutilnetfs-1.1.4
Diffstat (limited to 'netfs/fuse')
-rw-r--r--netfs/fuse/Jamfile.jam9
-rw-r--r--netfs/fuse/fuseApp.cpp6
-rw-r--r--netfs/fuse/fuseApp.h6
-rw-r--r--netfs/fuse/fuseDirs.cpp7
-rw-r--r--netfs/fuse/fuseMisc.cpp2
5 files changed, 13 insertions, 17 deletions
diff --git a/netfs/fuse/Jamfile.jam b/netfs/fuse/Jamfile.jam
index 8413d1f..fb04fb4 100644
--- a/netfs/fuse/Jamfile.jam
+++ b/netfs/fuse/Jamfile.jam
@@ -3,13 +3,13 @@ lib Glacier2 : : <name>Glacier2 ;
cpp-pch pch : pch.hpp :
<define>_FILE_OFFSET_BITS=64
- <include>../../libmisc
<include>../../libfusepp
<implicit-dependency>../ice//netfsComms
<library>../ice//netfsComms
<library>..//boost_thread
<library>fuse
<library>..//Ice
+ <library>..//adhocutil
;
lib netfsClientConfiguration :
@@ -29,17 +29,13 @@ lib netfsClientConfiguration :
<library>..//slicer
;
-obj misc : ../../libmisc/misc.cpp ;
-
lib netfsClient :
pch
- misc
netfsClientConfiguration
[ glob *.cpp : netfs.cpp ]
[ glob ../../libfusepp/fuse*.cpp ]
:
<define>_FILE_OFFSET_BITS=64
- <include>../../libmisc
<include>../../libfusepp
<implicit-dependency>../ice//netfsComms
<library>netfsClientConfiguration
@@ -54,6 +50,7 @@ lib netfsClient :
<library>..//pthread
<library>..//slicer
<library>..//libxmlpp
+ <library>..//adhocutil
<library>..//slicer-xml
<cflags>-fvisibility=hidden
<variant>release:<cflags>-flto
@@ -69,10 +66,10 @@ lib netfsClient :
;
exe netfs :
- misc
netfs.cpp :
<library>netfsClient
<library>fuse
+ <library>..//adhocutil
<cflags>-fvisibility=hidden
<variant>release:<cflags>-flto
;
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp
index bc5caf0..1e2064c 100644
--- a/netfs/fuse/fuseApp.cpp
+++ b/netfs/fuse/fuseApp.cpp
@@ -8,8 +8,10 @@
#include <slicer/slicer.h>
#include <xml/serializer.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>;
+namespace AdHoc {
+ template class Cache<struct stat, std::string>;
+ template class CallCacheable<struct stat, std::string>;
+}
NetFS::FuseApp::FuseApp(const Ice::StringSeq & a) :
args(a),
diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h
index 3ad8f66..3e9f1c4 100644
--- a/netfs/fuse/fuseApp.h
+++ b/netfs/fuse/fuseApp.h
@@ -9,9 +9,7 @@
#include "fuseAppBase.h"
#include "fuseConfig.h"
#include "cache.h"
-#ifndef DLL_PUBLIC
-#define DLL_PUBLIC __attribute__ ((visibility ("default")))
-#endif
+#include <visibility.h>
namespace NetFS {
class DLL_PUBLIC FuseApp : public FuseAppBase {
@@ -122,7 +120,7 @@ namespace NetFS {
EntCache<User> userLookup;
EntCache<Group> groupLookup;
- typedef Cache<struct stat, std::string, IceUtil::Shared, IceUtil::Handle<Cacheable<struct stat, std::string, IceUtil::Shared>>> StatCache;
+ typedef AdHoc::Cache<struct stat, std::string> StatCache;
StatCache statCache;
};
}
diff --git a/netfs/fuse/fuseDirs.cpp b/netfs/fuse/fuseDirs.cpp
index fa9f13b..2d2be56 100644
--- a/netfs/fuse/fuseDirs.cpp
+++ b/netfs/fuse/fuseDirs.cpp
@@ -1,7 +1,6 @@
#include <pch.hpp>
#include "fuseApp.h"
-#include "misc.h"
-#include "lockHelpers.h"
+#include <lockHelpers.h>
#include <typeConvert.h>
#include <entCache.h>
@@ -76,12 +75,12 @@ NetFS::FuseApp::readdir(const char * p, void * buf, fuse_fill_dir_t filler, off_
filler(buf, e.c_str(), NULL, 0);
std::string epath = path + "/" + e;
auto asga = volume->begin_getattr(reqEnv(), epath);
- statCache.Add(new OptimisticCallCacheable<struct stat, std::string, IceUtil::Shared>(
+ statCache.add(epath,
[asga,this]() {
struct stat s;
s << AttrSource { volume->end_getattr(asga), userLookup, groupLookup };
return s;
- }, epath, time_t(NULL) + 2));
+ }, time_t(NULL) + 2);
}
return 0;
}
diff --git a/netfs/fuse/fuseMisc.cpp b/netfs/fuse/fuseMisc.cpp
index 12a550f..df28318 100644
--- a/netfs/fuse/fuseMisc.cpp
+++ b/netfs/fuse/fuseMisc.cpp
@@ -14,7 +14,7 @@ int
NetFS::FuseApp::getattr(const char * p, struct stat * s)
{
try {
- auto cacehedStat = statCache.Get(p);
+ auto cacehedStat = statCache.get(p);
if (cacehedStat) {
*s = *cacehedStat;
}