summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-03-29 12:28:43 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-03-31 19:39:30 +0100
commitb60ac919728bea925f061dbc1243f8df3d084b61 (patch)
treefa895ff5aecb2d81ad7576da465ea2fd32c43b6d
parentRemove lib shared library, build static (diff)
downloadnetfs-b60ac919728bea925f061dbc1243f8df3d084b61.tar.bz2
netfs-b60ac919728bea925f061dbc1243f8df3d084b61.tar.xz
netfs-b60ac919728bea925f061dbc1243f8df3d084b61.zip
Pull definitions of OpenFile and Dir into their own header
-rw-r--r--netfs/fuse/fuseApp.cpp2
-rw-r--r--netfs/fuse/fuseApp.h26
-rw-r--r--netfs/fuse/fuseDirs.cpp2
-rw-r--r--netfs/fuse/fuseDirs.h17
-rw-r--r--netfs/fuse/fuseFiles.h24
5 files changed, 42 insertions, 29 deletions
diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp
index 21bff3d..fd26516 100644
--- a/netfs/fuse/fuseApp.cpp
+++ b/netfs/fuse/fuseApp.cpp
@@ -8,6 +8,8 @@
#include <uriParse.h>
#include <safeMapFind.h>
#include <compileTimeFormatter.h>
+#include "fuseDirs.h"
+#include "fuseFiles.h"
namespace AdHoc {
template class Cache<struct stat, std::string>;
diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h
index b38c97c..bef757b 100644
--- a/netfs/fuse/fuseApp.h
+++ b/netfs/fuse/fuseApp.h
@@ -14,37 +14,15 @@
#include "cache.h"
#include <visibility.h>
#include <c++11Helpers.h>
-#include <boost/icl/interval_map.hpp>
namespace NetFS {
class DLL_PUBLIC FuseApp : public FuseAppBaseT<FuseApp> {
private:
- class OpenDir {
- public:
- OpenDir(DirectoryPrxPtr remote, std::string path);
-
- DirectoryPrxPtr remote;
- const std::string path;
- };
+ class OpenDir;
using OpenDirPtr = std::shared_ptr<OpenDir>;
using OpenDirs = std::map<int, OpenDirPtr>;
- class OpenFile {
- public:
- OpenFile(FilePrxPtr remote, std::string path, int flags);
-
- void flush();
- void wait() const;
-
- FilePrxPtr remote;
- const std::string path;
- const int flags;
- class WriteState;
- using BGs = boost::icl::interval_map<Ice::Long, std::shared_ptr<WriteState>>;
- static BGs::interval_type range(off_t, size_t);
- BGs bg;
- mutable std::shared_mutex _lock;
- };
+ class OpenFile;
using OpenFilePtr = std::shared_ptr<OpenFile>;
using OpenFiles = std::map<int, OpenFilePtr>;
diff --git a/netfs/fuse/fuseDirs.cpp b/netfs/fuse/fuseDirs.cpp
index d2597f8..a1748d8 100644
--- a/netfs/fuse/fuseDirs.cpp
+++ b/netfs/fuse/fuseDirs.cpp
@@ -1,4 +1,4 @@
-#include "fuseApp.impl.h"
+#include "fuseDirs.h"
#include <lockHelpers.h>
#include <entCache.h>
diff --git a/netfs/fuse/fuseDirs.h b/netfs/fuse/fuseDirs.h
new file mode 100644
index 0000000..55088dd
--- /dev/null
+++ b/netfs/fuse/fuseDirs.h
@@ -0,0 +1,17 @@
+#ifndef NETFS_FUSE_DIRS_H
+#define NETFS_FUSE_DIRS_H
+
+#include "fuseApp.impl.h"
+
+namespace NetFS {
+ class FuseApp::OpenDir {
+ public:
+ OpenDir(DirectoryPrxPtr remote, std::string path);
+
+ DirectoryPrxPtr remote;
+ const std::string path;
+ };
+}
+
+#endif
+
diff --git a/netfs/fuse/fuseFiles.h b/netfs/fuse/fuseFiles.h
index 5e05ad2..4c9a31a 100644
--- a/netfs/fuse/fuseFiles.h
+++ b/netfs/fuse/fuseFiles.h
@@ -2,14 +2,30 @@
#define NETFS_FUSE_FILES_H
#include "fuseApp.h"
+#include <boost/icl/interval_map.hpp>
namespace NetFS {
- class FuseApp::OpenFile::WriteState {
+ class FuseApp::OpenFile {
public:
- WriteState();
+ OpenFile(FilePrxPtr remote, std::string path, int flags);
- std::promise<void> promise;
- std::shared_future<void> future;
+ void flush();
+ void wait() const;
+
+ FilePrxPtr remote;
+ const std::string path;
+ const int flags;
+ class WriteState {
+ public:
+ WriteState();
+
+ std::promise<void> promise;
+ std::shared_future<void> future;
+ };
+ using BGs = boost::icl::interval_map<Ice::Long, std::shared_ptr<WriteState>>;
+ static BGs::interval_type range(off_t, size_t);
+ BGs bg;
+ mutable std::shared_mutex _lock;
};
}