summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-01-31 15:53:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-01-31 16:13:19 +0000
commitf99e5010670e13549dfb593528b74b039073367d (patch)
tree78b2ce70e57ce4ffff8c6a0c42c01c5e04f1dddd
parentBasic by title folder (diff)
downloadmythfs-f99e5010670e13549dfb593528b74b039073367d.tar.bz2
mythfs-f99e5010670e13549dfb593528b74b039073367d.tar.xz
mythfs-f99e5010670e13549dfb593528b74b039073367d.zip
Implement statfs
-rw-r--r--mythfs/service/recordingsVolume.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/mythfs/service/recordingsVolume.cpp b/mythfs/service/recordingsVolume.cpp
index a7d5830..18d837c 100644
--- a/mythfs/service/recordingsVolume.cpp
+++ b/mythfs/service/recordingsVolume.cpp
@@ -6,6 +6,8 @@
#include "inodes/allDirectory.h"
#include "inodes/groupingByTitleDirectory.h"
#include "openDirectory.h"
+#include <sys/statvfs.h>
+#include <typeConvert.h>
namespace MythFS {
RecordingsVolume::RecordingsVolume(DBPrx db)
@@ -56,7 +58,15 @@ namespace MythFS {
NetFS::VFS RecordingsVolume::statfs(const NetFS::ReqEnv &, const std::string &, const Ice::Current&)
{
- throw ::NetFS::SystemError(ENOSYS);
+ errno = 0;
+ struct statvfs s;
+ boost::filesystem::path p("/var/store/mythrecordings");
+ if (::statvfs(p.c_str(), &s) != 0) {
+ throw NetFS::SystemError(errno);
+ }
+ NetFS::VFS t;
+ t << s;
+ return t;
}
Ice::Int RecordingsVolume::access(const NetFS::ReqEnv &, const std::string &, Ice::Int, const Ice::Current&)