Loading ifs/include/db/db_ops.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,6 @@ bool db_is_dir_entry(const std::string& dir_path); bool db_update_metadentry(const std::string& old_key, const std::string& new_key, const std::string& val); bool db_iterate_all_entries(); void db_iterate_all_entries(); #endif //IFS_DB_OPS_HPP ifs/include/preload/open_file_map.hpp +1 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,7 @@ #ifndef IFS_OPEN_FILE_MAP_HPP #define IFS_OPEN_FILE_MAP_HPP #include <map> #include <mutex> #include <memory> #include <preload/preload.hpp> class OpenFile { private: Loading ifs/include/preload/preload.hpp +6 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,14 @@ #define IOINTERCEPT_PRELOAD_HPP #include <memory> #include <map> #include <mutex> #include <iostream> #include <sys/statfs.h> #include <stdio.h> #include <stdint.h> #include <fcntl.h> #include <errno.h> #include "../../configure.hpp" Loading ifs/src/db/db_ops.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -51,14 +51,13 @@ bool db_update_metadentry(const std::string& old_key, const std::string& new_key return db->Write(ADAFS_DATA->rdb_write_options(), &batch).ok(); } bool db_iterate_all_entries() { void db_iterate_all_entries() { string key; string val; auto db = ADAFS_DATA->rdb(); // Do RangeScan on parent inode auto iter = db->NewIterator(rocksdb::ReadOptions()); for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { // while (iter->Valid()) { key = iter->key().ToString(); val = iter->value().ToString(); ADAFS_DATA->spdlogger()->trace("key '{}' value '{}'", key, val); Loading ifs/src/preload/open_file_map.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ using namespace std; OpenFile::OpenFile(const string& path, const bool append_flag) : path_(path), append_flag_(append_flag) { tmp_file_ = tmpfile(); // create a temporary file in memory and if (tmp_file_ == NULL) { LD_LOG_ERROR(debug_fd, "Error while creating temporary file in OpenFile constructor %s\n", strerror(errno)); cout << strerror(errno) << endl; exit(1); } fd_ = fileno(tmp_file_); // get a valid file descriptor from the kernel } Loading Loading
ifs/include/db/db_ops.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,6 @@ bool db_is_dir_entry(const std::string& dir_path); bool db_update_metadentry(const std::string& old_key, const std::string& new_key, const std::string& val); bool db_iterate_all_entries(); void db_iterate_all_entries(); #endif //IFS_DB_OPS_HPP
ifs/include/preload/open_file_map.hpp +1 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,7 @@ #ifndef IFS_OPEN_FILE_MAP_HPP #define IFS_OPEN_FILE_MAP_HPP #include <map> #include <mutex> #include <memory> #include <preload/preload.hpp> class OpenFile { private: Loading
ifs/include/preload/preload.hpp +6 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,14 @@ #define IOINTERCEPT_PRELOAD_HPP #include <memory> #include <map> #include <mutex> #include <iostream> #include <sys/statfs.h> #include <stdio.h> #include <stdint.h> #include <fcntl.h> #include <errno.h> #include "../../configure.hpp" Loading
ifs/src/db/db_ops.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -51,14 +51,13 @@ bool db_update_metadentry(const std::string& old_key, const std::string& new_key return db->Write(ADAFS_DATA->rdb_write_options(), &batch).ok(); } bool db_iterate_all_entries() { void db_iterate_all_entries() { string key; string val; auto db = ADAFS_DATA->rdb(); // Do RangeScan on parent inode auto iter = db->NewIterator(rocksdb::ReadOptions()); for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { // while (iter->Valid()) { key = iter->key().ToString(); val = iter->value().ToString(); ADAFS_DATA->spdlogger()->trace("key '{}' value '{}'", key, val); Loading
ifs/src/preload/open_file_map.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ using namespace std; OpenFile::OpenFile(const string& path, const bool append_flag) : path_(path), append_flag_(append_flag) { tmp_file_ = tmpfile(); // create a temporary file in memory and if (tmp_file_ == NULL) { LD_LOG_ERROR(debug_fd, "Error while creating temporary file in OpenFile constructor %s\n", strerror(errno)); cout << strerror(errno) << endl; exit(1); } fd_ = fileno(tmp_file_); // get a valid file descriptor from the kernel } Loading