summaryrefslogtreecommitdiff
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
parentImprove error handling around ICE exceptions (diff)
downloadnetfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.tar.bz2
netfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.tar.xz
netfs-9e5cee2e54a3482605d524f13eedb1cbfba5a971.zip
Use libadhocutilnetfs-1.1.4
-rw-r--r--libfusepp/fuseAppBase.h6
-rw-r--r--netfs/Jamfile.jam1
-rw-r--r--netfs/daemon/Jamfile.jam3
-rw-r--r--netfs/daemon/daemon.h4
-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
-rw-r--r--netfs/lib/Jamfile.jam4
-rw-r--r--netfs/lib/entCache.cpp5
-rw-r--r--netfs/lib/pch.hpp1
-rw-r--r--netfs/unittests/Jamfile.jam2
13 files changed, 21 insertions, 35 deletions
diff --git a/libfusepp/fuseAppBase.h b/libfusepp/fuseAppBase.h
index a9be11b..5c8582c 100644
--- a/libfusepp/fuseAppBase.h
+++ b/libfusepp/fuseAppBase.h
@@ -8,10 +8,8 @@
#include <stdio.h>
#include <errno.h>
#include <syslog.h>
-#include <misc.h>
-#ifndef DLL_PUBLIC
-#define DLL_PUBLIC __attribute__ ((visibility ("default")))
-#endif
+#include <visibility.h>
+#include <buffer.h>
class DLL_PUBLIC FuseAppBase {
public:
diff --git a/netfs/Jamfile.jam b/netfs/Jamfile.jam
index 6df8110..2bca779 100644
--- a/netfs/Jamfile.jam
+++ b/netfs/Jamfile.jam
@@ -15,6 +15,7 @@ lib IceBox : : <name>IceBox ;
lib pthread : : <name>pthread ;
lib slicer : : : : <include>/usr/include/slicer ;
lib slicer-xml : : : : <include>/usr/include/slicer ;
+lib adhocutil : : : : <include>/usr/include/adhocutil ;
build-project daemon ;
build-project fuse ;
diff --git a/netfs/daemon/Jamfile.jam b/netfs/daemon/Jamfile.jam
index 47b81f6..0960f7b 100644
--- a/netfs/daemon/Jamfile.jam
+++ b/netfs/daemon/Jamfile.jam
@@ -1,7 +1,6 @@
cpp-pch pch : pch.hpp :
<define>_FILE_OFFSET_BITS=64
- <include>../../libmisc
<implicit-dependency>../ice//netfsComms
<implicit-dependency>netfsdConfiguration
<library>../ice//netfsComms
@@ -35,7 +34,6 @@ lib netfsd :
[ glob *.cpp ]
:
<define>_FILE_OFFSET_BITS=64
- <include>../libmisc
<implicit-dependency>../ice//netfsComms
<implicit-dependency>netfsdConfiguration
<library>netfsdConfiguration
@@ -49,6 +47,7 @@ lib netfsd :
<library>..//IceUtil
<library>..//IceBox
<library>..//libxmlpp
+ <library>..//adhocutil
<library>..//slicer-xml
<cflags>-fvisibility=hidden
<variant>release:<cflags>-flto
diff --git a/netfs/daemon/daemon.h b/netfs/daemon/daemon.h
index 5f9542a..7599388 100644
--- a/netfs/daemon/daemon.h
+++ b/netfs/daemon/daemon.h
@@ -5,9 +5,7 @@
#include <IceBox/IceBox.h>
#include <daemonConfig.h>
#include <boost/filesystem/path.hpp>
-#ifndef DLL_PUBLIC
-#define DLL_PUBLIC __attribute__ ((visibility ("default")))
-#endif
+#include <visibility.h>
class DLL_PUBLIC NetFSDaemon : public IceBox::Service {
public:
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;
}
diff --git a/netfs/lib/Jamfile.jam b/netfs/lib/Jamfile.jam
index 4172f3c..d2e7a4a 100644
--- a/netfs/lib/Jamfile.jam
+++ b/netfs/lib/Jamfile.jam
@@ -1,6 +1,5 @@
cpp-pch pch : pch.hpp :
<define>_FILE_OFFSET_BITS=64
- <include>../../libmisc
;
lib netfsCommon :
@@ -8,16 +7,15 @@ lib netfsCommon :
[ glob *.cpp ]
:
<define>_FILE_OFFSET_BITS=64
- <include>../../libmisc
<include>../ice
<library>..//boost_system
<library>..//boost_thread
<library>../ice//netfsComms
+ <library>..//adhocutil
<implicit-dependency>../ice//netfsComms
<cflags>-fvisibility=hidden
<variant>release:<cflags>-flto
: :
<include>.
- <include>../../libmisc
;
diff --git a/netfs/lib/entCache.cpp b/netfs/lib/entCache.cpp
index 01a2de3..a8db44d 100644
--- a/netfs/lib/entCache.cpp
+++ b/netfs/lib/entCache.cpp
@@ -4,10 +4,7 @@
#include <lockHelpers.h>
#include <pwd.h>
#include <grp.h>
-
-#ifndef DLL_PUBLIC
-#define DLL_PUBLIC __attribute__ ((visibility ("default")))
-#endif
+#include <visibility.h>
template<class entry_t>
EntCache<entry_t>::EntCache() :
diff --git a/netfs/lib/pch.hpp b/netfs/lib/pch.hpp
index fc37faa..026b3c8 100644
--- a/netfs/lib/pch.hpp
+++ b/netfs/lib/pch.hpp
@@ -12,7 +12,6 @@
#include <map>
#include <set>
#include <string>
-#include <lockHelpers.h>
#endif
#endif
diff --git a/netfs/unittests/Jamfile.jam b/netfs/unittests/Jamfile.jam
index 9aa8bda..0065b13 100644
--- a/netfs/unittests/Jamfile.jam
+++ b/netfs/unittests/Jamfile.jam
@@ -9,7 +9,6 @@ lib Ice ;
path-constant me : . ;
lib testMocks :
- ../../libmisc/misc.cpp
[ glob mock*.cpp ]
:
<library>IceUtil
@@ -19,6 +18,7 @@ lib testMocks :
<library>../daemon//netfsd
<library>../fuse//netfsClient
<library>../ice//netfsComms
+ <library>..//adhocutil
<define>BOOST_TEST_DYN_LINK
<library>boost_utf
<define>ROOT=\"$(me)\"