Loading fs/src/fuse_ops/permission.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ using namespace std; int chk_access(const Metadata& md, const int& mode) { int chk_access(const Metadata& md, const int mode) { ADAFS_DATA->logger->info("chk_access() enter: md.uid: {}, fusecontextuid: {}", md.uid(), fuse_get_context()->uid); // root user is a god if (fuse_get_context()->uid == 0) Loading fs/src/fuse_utils.h +1 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,6 @@ #include "metadata.h" int chk_access(const Metadata& md, const int& mode); int chk_access(const Metadata& md, const int mode); #endif //FS_FUSE_UTILS_H fs/src/metadata_ops.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ #include <boost/archive/binary_oarchive.hpp> // TODO error handling. Each read_metadata_field should check for boolean, i.e., if I/O failed. bool write_all_metadata(const Metadata& md, const unsigned long& hash) { bool write_all_metadata(const Metadata& md, const unsigned long hash) { write_metadata_field(md.atime(), hash, "/atime"s); write_metadata_field(md.mtime(), hash, "/mtime"s); write_metadata_field(md.ctime(), hash, "/ctime"s); Loading @@ -26,7 +26,7 @@ bool write_all_metadata(const Metadata& md, const unsigned long& hash) { // TODO error handling. template<typename T> bool write_metadata_field(const T& field, const unsigned long& hash, const string& leaf_name) { bool write_metadata_field(const T& field, const unsigned long hash, const string& leaf_name) { auto i_path = bfs::path(ADAFS_DATA->inode_path); i_path /= to_string(hash); bfs::create_directories(i_path); Loading @@ -43,7 +43,7 @@ bool write_metadata_field(const T& field, const unsigned long& hash, const strin } // TODO error handling. Each read_metadata_field should check for nullptr, i.e., if I/O failed. bool read_all_metadata(Metadata& md, const unsigned long& hash) { bool read_all_metadata(Metadata& md, const unsigned long hash) { md.atime(*read_metadata_field<time_t>(hash, "/atime"s)); md.mtime(*read_metadata_field<time_t>(hash, "/mtime"s)); md.ctime(*read_metadata_field<time_t>(hash, "/ctime"s)); Loading @@ -59,7 +59,7 @@ bool read_all_metadata(Metadata& md, const unsigned long& hash) { template<typename T> unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name) { unique_ptr<T> read_metadata_field(const uint64_t hash, const string& leaf_name) { auto path = bfs::path(ADAFS_DATA->inode_path); path /= to_string(hash); path /= leaf_name; Loading @@ -74,7 +74,7 @@ unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name) return field; } int get_metadata(Metadata& md, const std::string& path) { int get_metadata(Metadata& md, const string& path) { return get_metadata(md, bfs::path(path)); } Loading fs/src/metadata_ops.h +4 −4 Original line number Diff line number Diff line Loading @@ -10,15 +10,15 @@ using namespace std; bool write_all_metadata(const Metadata& md, const unsigned long& hash); bool write_all_metadata(const Metadata& md, const unsigned long hash); template<typename T> bool write_metadata_field(const T& field, const unsigned long& hash, const string& leaf_name); bool write_metadata_field(const T& field, const unsigned long hash, const string& leaf_name); bool read_all_metadata(Metadata& md, const unsigned long& hash); bool read_all_metadata(Metadata& md, const unsigned long hash); template<typename T> unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name); unique_ptr<T> read_metadata_field(const uint64_t hash, const string& leaf_name); int get_metadata(Metadata& md, const std::string& path); Loading Loading
fs/src/fuse_ops/permission.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ using namespace std; int chk_access(const Metadata& md, const int& mode) { int chk_access(const Metadata& md, const int mode) { ADAFS_DATA->logger->info("chk_access() enter: md.uid: {}, fusecontextuid: {}", md.uid(), fuse_get_context()->uid); // root user is a god if (fuse_get_context()->uid == 0) Loading
fs/src/fuse_utils.h +1 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,6 @@ #include "metadata.h" int chk_access(const Metadata& md, const int& mode); int chk_access(const Metadata& md, const int mode); #endif //FS_FUSE_UTILS_H
fs/src/metadata_ops.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ #include <boost/archive/binary_oarchive.hpp> // TODO error handling. Each read_metadata_field should check for boolean, i.e., if I/O failed. bool write_all_metadata(const Metadata& md, const unsigned long& hash) { bool write_all_metadata(const Metadata& md, const unsigned long hash) { write_metadata_field(md.atime(), hash, "/atime"s); write_metadata_field(md.mtime(), hash, "/mtime"s); write_metadata_field(md.ctime(), hash, "/ctime"s); Loading @@ -26,7 +26,7 @@ bool write_all_metadata(const Metadata& md, const unsigned long& hash) { // TODO error handling. template<typename T> bool write_metadata_field(const T& field, const unsigned long& hash, const string& leaf_name) { bool write_metadata_field(const T& field, const unsigned long hash, const string& leaf_name) { auto i_path = bfs::path(ADAFS_DATA->inode_path); i_path /= to_string(hash); bfs::create_directories(i_path); Loading @@ -43,7 +43,7 @@ bool write_metadata_field(const T& field, const unsigned long& hash, const strin } // TODO error handling. Each read_metadata_field should check for nullptr, i.e., if I/O failed. bool read_all_metadata(Metadata& md, const unsigned long& hash) { bool read_all_metadata(Metadata& md, const unsigned long hash) { md.atime(*read_metadata_field<time_t>(hash, "/atime"s)); md.mtime(*read_metadata_field<time_t>(hash, "/mtime"s)); md.ctime(*read_metadata_field<time_t>(hash, "/ctime"s)); Loading @@ -59,7 +59,7 @@ bool read_all_metadata(Metadata& md, const unsigned long& hash) { template<typename T> unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name) { unique_ptr<T> read_metadata_field(const uint64_t hash, const string& leaf_name) { auto path = bfs::path(ADAFS_DATA->inode_path); path /= to_string(hash); path /= leaf_name; Loading @@ -74,7 +74,7 @@ unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name) return field; } int get_metadata(Metadata& md, const std::string& path) { int get_metadata(Metadata& md, const string& path) { return get_metadata(md, bfs::path(path)); } Loading
fs/src/metadata_ops.h +4 −4 Original line number Diff line number Diff line Loading @@ -10,15 +10,15 @@ using namespace std; bool write_all_metadata(const Metadata& md, const unsigned long& hash); bool write_all_metadata(const Metadata& md, const unsigned long hash); template<typename T> bool write_metadata_field(const T& field, const unsigned long& hash, const string& leaf_name); bool write_metadata_field(const T& field, const unsigned long hash, const string& leaf_name); bool read_all_metadata(Metadata& md, const unsigned long& hash); bool read_all_metadata(Metadata& md, const unsigned long hash); template<typename T> unique_ptr<T> read_metadata_field(const uint64_t& hash, const string& leaf_name); unique_ptr<T> read_metadata_field(const uint64_t hash, const string& leaf_name); int get_metadata(Metadata& md, const std::string& path); Loading