diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-16 01:22:05 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-16 01:22:05 +0100 |
commit | 6f14be9f75537afa398fd82b47ea70d8dd6f4475 (patch) | |
tree | e0fe32de58bf30937ff86f67e6f65a5832edef19 | |
parent | Use facets for all dynamic servants and set the facetId to the version serial (diff) | |
download | netfs-6f14be9f75537afa398fd82b47ea70d8dd6f4475.tar.bz2 netfs-6f14be9f75537afa398fd82b47ea70d8dd6f4475.tar.xz netfs-6f14be9f75537afa398fd82b47ea70d8dd6f4475.zip |
Split VFS type converters into simpler base classnetfs-1.2.0
-rw-r--r-- | netfs/daemon/daemonDirectory.cpp | 4 | ||||
-rw-r--r-- | netfs/daemon/daemonDirectory.h | 4 | ||||
-rw-r--r-- | netfs/daemon/daemonFile.cpp | 4 | ||||
-rw-r--r-- | netfs/daemon/daemonFile.h | 4 | ||||
-rw-r--r-- | netfs/daemon/daemonVolume.cpp | 2 | ||||
-rw-r--r-- | netfs/daemon/daemonVolume.h | 2 | ||||
-rw-r--r-- | netfs/fuse/fuseApp.h | 2 | ||||
-rw-r--r-- | netfs/fuse/fuseSystem.cpp | 2 | ||||
-rw-r--r-- | netfs/ice/typeConverter.cpp | 6 | ||||
-rw-r--r-- | netfs/ice/typeConverter.h | 13 |
10 files changed, 23 insertions, 20 deletions
diff --git a/netfs/daemon/daemonDirectory.cpp b/netfs/daemon/daemonDirectory.cpp index 399fb86..6943982 100644 --- a/netfs/daemon/daemonDirectory.cpp +++ b/netfs/daemon/daemonDirectory.cpp @@ -7,8 +7,8 @@ #include <fcntl.h> #include "daemonDirectory.h" -DirectoryServer::DirectoryServer(DIR * d, TypeConverter & t) : - TypeConverter(t), +DirectoryServer::DirectoryServer(DIR * d, EntryTypeConverter & t) : + EntryTypeConverter(t), od(d) { } diff --git a/netfs/daemon/daemonDirectory.h b/netfs/daemon/daemonDirectory.h index 28c04a9..5e549fe 100644 --- a/netfs/daemon/daemonDirectory.h +++ b/netfs/daemon/daemonDirectory.h @@ -5,9 +5,9 @@ #include <dirent.h> #include <typeConverter.h> -class DirectoryServer : public NetFS::DirectoryV2, TypeConverter { +class DirectoryServer : public NetFS::DirectoryV2, EntryTypeConverter { public: - DirectoryServer(DIR * od, TypeConverter &); + DirectoryServer(DIR * od, EntryTypeConverter &); virtual ~DirectoryServer(); virtual void close(const Ice::Current&) override; diff --git a/netfs/daemon/daemonFile.cpp b/netfs/daemon/daemonFile.cpp index e8201c0..a4c903d 100644 --- a/netfs/daemon/daemonFile.cpp +++ b/netfs/daemon/daemonFile.cpp @@ -7,8 +7,8 @@ #include "daemonFile.h" #include <entCache.h> -FileServer::FileServer(int f, TypeConverter & t) : - TypeConverter(t), +FileServer::FileServer(int f, EntryTypeConverter & t) : + EntryTypeConverter(t), fd(f) { } diff --git a/netfs/daemon/daemonFile.h b/netfs/daemon/daemonFile.h index 1853732..5bf20f3 100644 --- a/netfs/daemon/daemonFile.h +++ b/netfs/daemon/daemonFile.h @@ -4,9 +4,9 @@ #include <file.h> #include <typeConverter.h> -class FileServer : public NetFS::File, TypeConverter { +class FileServer : public NetFS::File, EntryTypeConverter { public: - FileServer(int fd, TypeConverter &); + FileServer(int fd, EntryTypeConverter &); virtual ~FileServer(); virtual void close(const Ice::Current&) override; diff --git a/netfs/daemon/daemonVolume.cpp b/netfs/daemon/daemonVolume.cpp index f5e87d8..0a3472c 100644 --- a/netfs/daemon/daemonVolume.cpp +++ b/netfs/daemon/daemonVolume.cpp @@ -200,7 +200,7 @@ VolumeServer::statfs(const NetFS::ReqEnv & re, const std::string & path, const I if (::statvfs(p.c_str(), &s) != 0) { throw NetFS::SystemError(errno); } - return converter.convert(s); + return converter.TypeConverter::convert(s); } void diff --git a/netfs/daemon/daemonVolume.h b/netfs/daemon/daemonVolume.h index b5e8b05..af0e36d 100644 --- a/netfs/daemon/daemonVolume.h +++ b/netfs/daemon/daemonVolume.h @@ -48,7 +48,7 @@ class VolumeServer : public NetFS::Volume { const EntCache<User> & userLookup; const EntCache<Group> & groupLookup; - TypeConverter converter; + EntryTypeConverter converter; }; #endif diff --git a/netfs/fuse/fuseApp.h b/netfs/fuse/fuseApp.h index 2c9824b..7e5f279 100644 --- a/netfs/fuse/fuseApp.h +++ b/netfs/fuse/fuseApp.h @@ -125,7 +125,7 @@ namespace NetFS { EntCache<User> userLookup; EntCache<Group> groupLookup; - TypeConverter converter; + EntryTypeConverter converter; typedef AdHoc::Cache<struct stat, std::string> StatCache; StatCache statCache; diff --git a/netfs/fuse/fuseSystem.cpp b/netfs/fuse/fuseSystem.cpp index 85432e8..ac87d14 100644 --- a/netfs/fuse/fuseSystem.cpp +++ b/netfs/fuse/fuseSystem.cpp @@ -4,7 +4,7 @@ int NetFS::FuseApp::statfs(const char * p, struct statvfs * vfs) { try { - *vfs = converter.convert(volume->statfs(reqEnv(), p)); + *vfs = converter.TypeConverter::convert(volume->statfs(reqEnv(), p)); return 0; } catch (NetFS::SystemError & e) { diff --git a/netfs/ice/typeConverter.cpp b/netfs/ice/typeConverter.cpp index dc130b1..46e8ff1 100644 --- a/netfs/ice/typeConverter.cpp +++ b/netfs/ice/typeConverter.cpp @@ -1,13 +1,13 @@ #include "typeConverter.h" -TypeConverter::TypeConverter(const EntryResolver<uid_t> & u, const EntryResolver<gid_t> & g) : +EntryTypeConverter::EntryTypeConverter(const EntryResolver<uid_t> & u, const EntryResolver<gid_t> & g) : userLookup(u), groupLookup(g) { } struct stat -TypeConverter::convert(const NetFS::Attr & a) const +EntryTypeConverter::convert(const NetFS::Attr & a) const { struct stat s; s.st_dev = a.dev; @@ -51,7 +51,7 @@ TypeConverter::convert(const NetFS::VFS & v) const } NetFS::Attr -TypeConverter::convert(const struct stat & s) const +EntryTypeConverter::convert(const struct stat & s) const { NetFS::Attr a; a.dev = s.st_dev; diff --git a/netfs/ice/typeConverter.h b/netfs/ice/typeConverter.h index d4b1617..b8d6fcd 100644 --- a/netfs/ice/typeConverter.h +++ b/netfs/ice/typeConverter.h @@ -9,16 +9,19 @@ class DLL_PUBLIC TypeConverter { public: - TypeConverter(const EntryResolver<uid_t> &, const EntryResolver<gid_t> &); + // VFS + struct statvfs convert(const NetFS::VFS &) const; + NetFS::VFS convert(const struct statvfs &) const; +}; + +class DLL_PUBLIC EntryTypeConverter : public TypeConverter { + public: + EntryTypeConverter(const EntryResolver<uid_t> &, const EntryResolver<gid_t> &); // Attributes struct stat convert(const NetFS::Attr &) const; NetFS::Attr convert(const struct stat &) const; - // VFS - struct statvfs convert(const NetFS::VFS &) const; - NetFS::VFS convert(const struct statvfs &) const; - protected: const EntryResolver<uid_t> & userLookup; const EntryResolver<gid_t> & groupLookup; |