This commit is contained in:
parent
fe0fef2f21
commit
54b70f99cc
@ -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__)
|
||||
|
@ -337,7 +337,7 @@ auto fuse_drive::fallocate_impl(std::string /*api_path*/, int mode,
|
||||
static_cast<std::uint64_t>(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<i_open_file> 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<remote::file_offset>(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<remote::file_offset>(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))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user