Loading include/client/hooks.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,9 @@ hook_fstatfs(unsigned int fd, struct statfs* buf); int hook_fsync(unsigned int fd); int hook_getxattr(const char* path, const char* name, void* value, size_t size); } // namespace gkfs::hook #endif src/client/hooks.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,6 @@ hook_lstat(const char* path, struct stat* buf) { return with_errno(gkfs::syscall::gkfs_stat(rel_path, buf)); } return syscall_no_intercept_wrapper(SYS_lstat, rel_path.c_str(), buf); ; } int Loading Loading @@ -955,4 +954,17 @@ hook_fsync(unsigned int fd) { return syscall_no_intercept_wrapper(SYS_fsync, fd); } int hook_getxattr(const char* path, const char* name, void* value, size_t size) { LOG(DEBUG, "{}() called with path '{}' name '{}' value '{}' size '{}'", __func__, path, name, fmt::ptr(value), size); std::string rel_path; if(CTX->relativize_path(path, rel_path)) { return -ENOTSUP; } return syscall_no_intercept_wrapper(SYS_getxattr, path, name, value, size); } } // namespace gkfs::hook src/client/intercept.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -774,6 +774,13 @@ hook(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, *result = gkfs::hook::hook_fsync(static_cast<unsigned int>(arg0)); break; case SYS_getxattr: *result = gkfs::hook::hook_getxattr( reinterpret_cast<const char*>(arg0), reinterpret_cast<const char*>(arg1), reinterpret_cast<void*>(arg2), static_cast<size_t>(arg4)); break; default: // ignore any other syscalls, i.e.: pass them on to the kernel // (syscalls forwarded to the kernel that return are logged in Loading Loading
include/client/hooks.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,9 @@ hook_fstatfs(unsigned int fd, struct statfs* buf); int hook_fsync(unsigned int fd); int hook_getxattr(const char* path, const char* name, void* value, size_t size); } // namespace gkfs::hook #endif
src/client/hooks.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,6 @@ hook_lstat(const char* path, struct stat* buf) { return with_errno(gkfs::syscall::gkfs_stat(rel_path, buf)); } return syscall_no_intercept_wrapper(SYS_lstat, rel_path.c_str(), buf); ; } int Loading Loading @@ -955,4 +954,17 @@ hook_fsync(unsigned int fd) { return syscall_no_intercept_wrapper(SYS_fsync, fd); } int hook_getxattr(const char* path, const char* name, void* value, size_t size) { LOG(DEBUG, "{}() called with path '{}' name '{}' value '{}' size '{}'", __func__, path, name, fmt::ptr(value), size); std::string rel_path; if(CTX->relativize_path(path, rel_path)) { return -ENOTSUP; } return syscall_no_intercept_wrapper(SYS_getxattr, path, name, value, size); } } // namespace gkfs::hook
src/client/intercept.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -774,6 +774,13 @@ hook(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, *result = gkfs::hook::hook_fsync(static_cast<unsigned int>(arg0)); break; case SYS_getxattr: *result = gkfs::hook::hook_getxattr( reinterpret_cast<const char*>(arg0), reinterpret_cast<const char*>(arg1), reinterpret_cast<void*>(arg2), static_cast<size_t>(arg4)); break; default: // ignore any other syscalls, i.e.: pass them on to the kernel // (syscalls forwarded to the kernel that return are logged in Loading