From 54b70f99cc1eee940f1655f0e3cdd4a6ff309dfe Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Mon, 11 Nov 2024 14:15:00 -0600 Subject: [PATCH] refactor --- .../include/drives/fuse/fuse_drive.hpp | 6 ++-- .../src/drives/fuse/fuse_drive.cpp | 33 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/repertory/librepertory/include/drives/fuse/fuse_drive.hpp b/repertory/librepertory/include/drives/fuse/fuse_drive.hpp index 30a9ee0a..c3922a24 100644 --- a/repertory/librepertory/include/drives/fuse/fuse_drive.hpp +++ b/repertory/librepertory/include/drives/fuse/fuse_drive.hpp @@ -103,7 +103,7 @@ protected: struct fuse_file_info *file_info) -> api_error override; [[nodiscard]] auto - fgetattr_impl(std::string api_path, struct stat *st, + fgetattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info *file_info) -> api_error override; #if defined(__APPLE__) @@ -124,11 +124,11 @@ protected: #if FUSE_USE_VERSION >= 30 [[nodiscard]] auto - getattr_impl(std::string api_path, struct stat *st, + getattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info *file_info) -> api_error override; #else [[nodiscard]] auto getattr_impl(std::string api_path, - struct stat *st) -> api_error override; + struct stat *unix_st) -> api_error override; #endif #if defined(__APPLE__) diff --git a/repertory/librepertory/src/drives/fuse/fuse_drive.cpp b/repertory/librepertory/src/drives/fuse/fuse_drive.cpp index d8920c03..7064df64 100644 --- a/repertory/librepertory/src/drives/fuse/fuse_drive.cpp +++ b/repertory/librepertory/src/drives/fuse/fuse_drive.cpp @@ -337,7 +337,7 @@ auto fuse_drive::fallocate_impl(std::string /*api_path*/, int mode, static_cast(offset + length), allocator); } -auto fuse_drive::fgetattr_impl(std::string api_path, struct stat *st, +auto fuse_drive::fgetattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info *file_info) -> api_error { std::shared_ptr open_file; if (not fm_->get_open_file(file_info->fh, false, open_file)) { @@ -356,7 +356,7 @@ auto fuse_drive::fgetattr_impl(std::string api_path, struct stat *st, return res; } fuse_drive_base::populate_stat(api_path, open_file->get_file_size(), meta, - directory, provider_, st); + directory, provider_, unix_st); return api_error::success; } @@ -464,12 +464,12 @@ auto fuse_drive::get_item_meta(const std::string &api_path, } #if FUSE_USE_VERSION >= 30 -auto fuse_drive::getattr_impl(std::string api_path, struct stat *st, +auto fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st, struct fuse_file_info * /*file_info*/) -> api_error { #else auto fuse_drive::getattr_impl(std::string api_path, - struct stat *st) -> api_error { + struct stat *unix_st) -> api_error { #endif auto parent = utils::path::get_parent_api_path(api_path); @@ -484,7 +484,7 @@ auto fuse_drive::getattr_impl(std::string api_path, found = (iter.get_directory_item(api_path, dir_item) == api_error::success); if (found) { fuse_drive_base::populate_stat(api_path, dir_item.size, dir_item.meta, - dir_item.directory, provider_, st); + dir_item.directory, provider_, unix_st); } }); @@ -502,7 +502,7 @@ auto fuse_drive::getattr_impl(std::string api_path, } fuse_drive_base::populate_stat(api_path, utils::string::to_uint64(meta[META_SIZE]), - meta, directory, provider_, st); + meta, directory, provider_, unix_st); } return api_error::success; @@ -753,16 +753,17 @@ auto fuse_drive::readdir_impl(std::string api_path, void *buf, } while (res == api_error::success) { - res = (iter->fill_buffer( - static_cast(offset++), fuse_fill_dir, buf, - [this](const std::string &cur_api_path, - std::uint64_t cur_file_size, const api_meta_map &meta, - bool directory, struct stat *st) { - fuse_drive_base::populate_stat(cur_api_path, cur_file_size, - meta, directory, provider_, st); - }) == 0) - ? api_error::success - : api_error::os_error; + res = + (iter->fill_buffer( + static_cast(offset++), fuse_fill_dir, buf, + [this](const std::string &cur_api_path, + std::uint64_t cur_file_size, const api_meta_map &meta, + bool directory, struct stat *unix_st) { + fuse_drive_base::populate_stat(cur_api_path, cur_file_size, meta, + directory, provider_, unix_st); + }) == 0) + ? api_error::success + : api_error::os_error; } if ((res == api_error::os_error) && ((errno == 120) || (errno == ENOMEM))) {