From 85b2220e86d5c5828ec48a4163290a56dd9d1d91 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Thu, 20 Mar 2025 16:01:47 +0100 Subject: [PATCH 1/2] Add new user functions and export additional library functions --- CHANGELOG.md | 1 + include/client/preload_context.hpp | 1 + include/client/user_functions.hpp | 31 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87c775712..d8f714326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - resolve_new accepts the parameter resolve_last_link,([!209](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/209)) - This solves an issue with the ci when looks at gcl-build directory (mainly lxstat) - Refactor and modernize sfind and gfind ([!226](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/226)) + - Export extra user library functions ([!227](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/227)) ### Fixed diff --git a/include/client/preload_context.hpp b/include/client/preload_context.hpp index b0662c063..6daaca24a 100644 --- a/include/client/preload_context.hpp +++ b/include/client/preload_context.hpp @@ -138,6 +138,7 @@ private: std::bitset protected_fds_; std::string hostname; int replicas_; + bool protect_fds_{false}; std::shared_ptr write_metrics_; diff --git a/include/client/user_functions.hpp b/include/client/user_functions.hpp index 2fd937ba7..7825a64c6 100644 --- a/include/client/user_functions.hpp +++ b/include/client/user_functions.hpp @@ -48,6 +48,7 @@ extern "C" { #include } +struct linux_dirent; struct linux_dirent64; namespace gkfs { @@ -61,6 +62,8 @@ gkfs_create(const std::string& path, mode_t mode); int gkfs_remove(const std::string& path); +int +gkfs_rmdir(const std::string& path); ssize_t gkfs_write(int fd, const void* buf, size_t count); @@ -83,11 +86,39 @@ gkfs_pread(int fd, void* buf, size_t count, off64_t offset); int gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true); +int +gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask, + struct statx* buf, bool follow_links = true); + int gkfs_remove(const std::string& path); +int +gkfs_dup(const int oldfd); + +int +gkfs_dup2(const int oldfd, const int newfd); + +int +gkfs_access(const std::string& path, const int mask, bool follow_links); + std::vector gkfs_get_file_list(const std::string& path); + + +int +gkfs_opendir(const std::string& path); + +int +gkfs_getdents(unsigned int fd, struct linux_dirent* dirp, unsigned int count); + +int +gkfs_getdents64(unsigned int fd, struct linux_dirent64* dirp, + unsigned int count); +int +gkfs_truncate(const std::string& path, off_t offset); + + } // namespace syscall namespace malleable { -- GitLab From 23da7c52372445f1a7b62e79563c6d5dd8c8ede4 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Thu, 20 Mar 2025 16:08:22 +0100 Subject: [PATCH 2/2] typo --- include/client/preload_context.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/client/preload_context.hpp b/include/client/preload_context.hpp index 6daaca24a..9f4b38875 100644 --- a/include/client/preload_context.hpp +++ b/include/client/preload_context.hpp @@ -138,7 +138,7 @@ private: std::bitset protected_fds_; std::string hostname; int replicas_; - + bool protect_fds_{false}; std::shared_ptr write_metrics_; -- GitLab