File indexing completed on 2023-10-25 10:05:57
0001 #ifndef STORAGE_FACTORY_LOCAL_FILE_SYSTEM_H
0002 #define STORAGE_FACTORY_LOCAL_FILE_SYSTEM_H
0003 #include <vector>
0004 #include <string>
0005 #include <utility>
0006
0007 struct stat;
0008 struct statfs;
0009 struct mntent;
0010
0011 namespace edm::storage {
0012 class LocalFileSystem {
0013 struct FSInfo;
0014
0015 public:
0016 LocalFileSystem(void);
0017
0018
0019 LocalFileSystem(LocalFileSystem &) = delete;
0020 void operator=(LocalFileSystem &) = delete;
0021
0022 ~LocalFileSystem(void);
0023
0024 bool isLocalPath(const std::string &path) const;
0025 std::pair<std::string, std::string> findCachePath(const std::vector<std::string> &paths, double minFreeSpace) const;
0026
0027 private:
0028 int readFSTypes(void);
0029 FSInfo *initFSInfo(void *p);
0030 int initFSList(void);
0031 int statFSInfo(FSInfo *i) const;
0032 FSInfo *findMount(const char *path, struct statfs *sfs, struct stat *s, std::vector<std::string> &) const;
0033
0034 std::vector<FSInfo *> fs_;
0035 std::vector<std::string> fstypes_;
0036 };
0037 }
0038 #endif