Loading ifs/include/preload/adafs_functions.hpp +5 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ int adafs_stat64(const std::string& path, struct stat64* buf); off64_t adafs_lseek(int fd, off64_t offset, int whence); off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence); off64_t adafs_lseek(std::shared_ptr<OpenFile> adafs_fd, off64_t offset, int whence); int adafs_dup(int oldfd); int adafs_dup2(int oldfd, int newfd); ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off64_t offset); Loading ifs/include/preload/open_file_map.hpp +7 −2 Original line number Diff line number Diff line Loading @@ -51,13 +51,14 @@ class OpenFileMap { private: std::map<int, std::shared_ptr<OpenFile>> files_; std::mutex files_mutex_; std::recursive_mutex files_mutex_; int safe_generate_fd_idx_(); public: OpenFileMap(); OpenFile* get(int fd); std::shared_ptr<OpenFile> get(int fd); bool exist(int fd); Loading @@ -65,6 +66,10 @@ public: bool remove(int fd); int dup(int oldfd); int dup2(int oldfd, int newfd); }; Loading ifs/include/preload/passthrough.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ extern void* libc_ftruncate; extern void* libc_dup; extern void* libc_dup2; extern void* libc_dup3; void init_passthrough_if_needed(); Loading ifs/include/preload/preload_util.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -101,9 +101,7 @@ extern std::shared_ptr<spdlog::logger> ld_logger; // rpc address cache typedef lru11::Cache<uint64_t, hg_addr_t> KVCache; extern KVCache rpc_address_cache; // file descriptor indices extern int fd_idx; extern std::mutex fd_idx_mutex; // file descriptor index validation flag extern std::atomic<bool> fd_validation_needed; // typedefs Loading @@ -114,6 +112,8 @@ typedef unsigned long rpc_chnk_id_t; int generate_fd_idx(); int get_fd_idx(); bool is_fs_path(const char* path); // TODO template these two suckers Loading ifs/src/preload/adafs_functions.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ off64_t adafs_lseek(int fd, off64_t offset, int whence) { return adafs_lseek(file_map.get(fd), offset, whence); } off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence) { off64_t adafs_lseek(shared_ptr<OpenFile> adafs_fd, off64_t offset, int whence) { init_ld_env_if_needed(); switch (whence) { case SEEK_SET: Loading Loading @@ -121,6 +121,13 @@ off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence) { return adafs_fd->pos(); } int adafs_dup(const int oldfd) { return file_map.dup(oldfd); } int adafs_dup2(const int oldfd, const int newfd) { return file_map.dup2(oldfd, newfd); } ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off64_t offset) { init_ld_env_if_needed(); Loading Loading
ifs/include/preload/adafs_functions.hpp +5 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,11 @@ int adafs_stat64(const std::string& path, struct stat64* buf); off64_t adafs_lseek(int fd, off64_t offset, int whence); off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence); off64_t adafs_lseek(std::shared_ptr<OpenFile> adafs_fd, off64_t offset, int whence); int adafs_dup(int oldfd); int adafs_dup2(int oldfd, int newfd); ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off64_t offset); Loading
ifs/include/preload/open_file_map.hpp +7 −2 Original line number Diff line number Diff line Loading @@ -51,13 +51,14 @@ class OpenFileMap { private: std::map<int, std::shared_ptr<OpenFile>> files_; std::mutex files_mutex_; std::recursive_mutex files_mutex_; int safe_generate_fd_idx_(); public: OpenFileMap(); OpenFile* get(int fd); std::shared_ptr<OpenFile> get(int fd); bool exist(int fd); Loading @@ -65,6 +66,10 @@ public: bool remove(int fd); int dup(int oldfd); int dup2(int oldfd, int newfd); }; Loading
ifs/include/preload/passthrough.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ extern void* libc_ftruncate; extern void* libc_dup; extern void* libc_dup2; extern void* libc_dup3; void init_passthrough_if_needed(); Loading
ifs/include/preload/preload_util.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -101,9 +101,7 @@ extern std::shared_ptr<spdlog::logger> ld_logger; // rpc address cache typedef lru11::Cache<uint64_t, hg_addr_t> KVCache; extern KVCache rpc_address_cache; // file descriptor indices extern int fd_idx; extern std::mutex fd_idx_mutex; // file descriptor index validation flag extern std::atomic<bool> fd_validation_needed; // typedefs Loading @@ -114,6 +112,8 @@ typedef unsigned long rpc_chnk_id_t; int generate_fd_idx(); int get_fd_idx(); bool is_fs_path(const char* path); // TODO template these two suckers Loading
ifs/src/preload/adafs_functions.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ off64_t adafs_lseek(int fd, off64_t offset, int whence) { return adafs_lseek(file_map.get(fd), offset, whence); } off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence) { off64_t adafs_lseek(shared_ptr<OpenFile> adafs_fd, off64_t offset, int whence) { init_ld_env_if_needed(); switch (whence) { case SEEK_SET: Loading Loading @@ -121,6 +121,13 @@ off64_t adafs_lseek(OpenFile* adafs_fd, off64_t offset, int whence) { return adafs_fd->pos(); } int adafs_dup(const int oldfd) { return file_map.dup(oldfd); } int adafs_dup2(const int oldfd, const int newfd) { return file_map.dup2(oldfd, newfd); } ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off64_t offset) { init_ld_env_if_needed(); Loading