This commit is contained in:
2025-01-02 12:07:01 -06:00
parent 270df62dbe
commit 71463bfee4
5 changed files with 46 additions and 46 deletions

View File

@ -118,8 +118,8 @@ auto fuse_base::chflags_(const char *path, uint32_t flags) -> int {
#endif // __APPLE__
#if FUSE_USE_VERSION >= 30
auto fuse_base::chmod_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int {
auto fuse_base::chmod_(const char *path, mode_t mode, struct fuse_file_info *fi)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -186,7 +186,7 @@ void fuse_base::display_options(
#if FUSE_USE_VERSION >= 30
fuse_cmdline_help();
#else
struct fuse_operations fuse_ops {};
struct fuse_operations fuse_ops{};
fuse_main(args.size(),
reinterpret_cast<char **>(const_cast<char **>(args.data())),
&fuse_ops, nullptr);
@ -196,7 +196,7 @@ void fuse_base::display_options(
}
void fuse_base::display_version_information(std::vector<const char *> args) {
struct fuse_operations fuse_ops {};
struct fuse_operations fuse_ops{};
fuse_main(static_cast<int>(args.size()),
reinterpret_cast<char **>(const_cast<char **>(args.data())),
&fuse_ops, nullptr);
@ -334,8 +334,8 @@ auto fuse_base::getxtimes_(const char *path, struct timespec *bkuptime,
#endif // __APPLE__
#if FUSE_USE_VERSION >= 30
auto fuse_base::init_(struct fuse_conn_info *conn,
struct fuse_config *cfg) -> void * {
auto fuse_base::init_(struct fuse_conn_info *conn, struct fuse_config *cfg)
-> void * {
REPERTORY_USES_FUNCTION_NAME();
return execute_void_pointer_callback(function_name, [&]() -> void * {
@ -408,7 +408,7 @@ auto fuse_base::mount(std::vector<std::string> args) -> int {
char *mount_location{nullptr};
#if FUSE_USE_VERSION >= 30
struct fuse_cmdline_opts opts {};
struct fuse_cmdline_opts opts{};
fuse_parse_cmdline(&fa, &opts);
mount_location = opts.mountpoint;
#else
@ -477,8 +477,8 @@ auto fuse_base::read_(const char *path, char *buffer, size_t read_size,
#if FUSE_USE_VERSION >= 30
auto fuse_base::readdir_(const char *path, void *buf,
fuse_fill_dir_t fuse_fill_dir, off_t offset,
struct fuse_file_info *fi,
fuse_readdir_flags flags) -> int {
struct fuse_file_info *fi, fuse_readdir_flags flags)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -510,8 +510,8 @@ auto fuse_base::release_(const char *path, struct fuse_file_info *fi) -> int {
});
}
auto fuse_base::releasedir_(const char *path,
struct fuse_file_info *fi) -> int {
auto fuse_base::releasedir_(const char *path, struct fuse_file_info *fi)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -521,8 +521,8 @@ auto fuse_base::releasedir_(const char *path,
}
#if FUSE_USE_VERSION >= 30
auto fuse_base::rename_(const char *from, const char *to,
unsigned int flags) -> int {
auto fuse_base::rename_(const char *from, const char *to, unsigned int flags)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -603,7 +603,7 @@ auto fuse_base::listxattr_(const char *path, char *buffer, size_t size) -> int {
void fuse_base::notify_fuse_args_parsed(const std::vector<std::string> &args) {
event_system::instance().raise<fuse_args_parsed>(std::accumulate(
args.begin(), args.end(), std::string(),
[](std::string command_line, const auto &arg) {
[](auto &&command_line, auto &&arg) -> auto {
command_line += (command_line.empty() ? arg : (" " + std::string(arg)));
return command_line;
}));
@ -765,8 +765,8 @@ auto fuse_base::setattr_x_(const char *path, struct setattr_x *attr) -> int {
});
}
auto fuse_base::setbkuptime_(const char *path,
const struct timespec *bkuptime) -> int {
auto fuse_base::setbkuptime_(const char *path, const struct timespec *bkuptime)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -775,8 +775,8 @@ auto fuse_base::setbkuptime_(const char *path,
});
}
auto fuse_base::setchgtime_(const char *path,
const struct timespec *chgtime) -> int {
auto fuse_base::setchgtime_(const char *path, const struct timespec *chgtime)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(
@ -785,8 +785,8 @@ auto fuse_base::setchgtime_(const char *path,
});
}
auto fuse_base::setcrtime_(const char *path,
const struct timespec *crtime) -> int {
auto fuse_base::setcrtime_(const char *path, const struct timespec *crtime)
-> int {
REPERTORY_USES_FUNCTION_NAME();
return instance().execute_callback(

View File

@ -42,7 +42,7 @@ void remote_open_file_table::close_all(const std::string &client_id) {
auto compat_handles =
std::accumulate(compat_file_lookup_.begin(), compat_file_lookup_.end(),
std::vector<remote::file_handle>(),
[&client_id](auto &&list, auto &&value) {
[&client_id](auto &&list, auto &&value) -> auto {
auto &&op_info = value.second;
if (op_info->client_id == client_id) {
list.insert(list.end(), op_info->handles.begin(),
@ -54,7 +54,7 @@ void remote_open_file_table::close_all(const std::string &client_id) {
auto handles = std::accumulate(
file_lookup_.begin(), file_lookup_.end(), std::vector<native_handle>(),
[&client_id](auto &&list, auto &&value) {
[&client_id](auto &&list, auto &&value) -> auto {
auto &&op_info = value.second;
if (op_info->client_id == client_id) {
list.insert(list.end(), op_info->handles.begin(),
@ -161,10 +161,10 @@ auto remote_open_file_table::has_compat_open_info(
void remote_open_file_table::remove_all(const std::string &file_path) {
unique_recur_mutex_lock lock(file_mutex_);
auto compat_open_list = std::accumulate(
compat_file_lookup_.begin(), compat_file_lookup_.end(),
auto compat_open_list =
std::accumulate(compat_file_lookup_.begin(), compat_file_lookup_.end(),
std::vector<remote::file_handle>(),
[&file_path](auto &&list, auto &&kv) -> std::vector<remote::file_handle> {
[&file_path](auto &&list, auto &&kv) -> auto {
if (kv.first == file_path) {
auto *op_info = kv.second.get();
list.insert(list.end(), op_info->handles.begin(),
@ -175,7 +175,7 @@ void remote_open_file_table::remove_all(const std::string &file_path) {
auto open_list = std::accumulate(
file_lookup_.begin(), file_lookup_.end(), std::vector<native_handle>(),
[&file_path](auto &&list, auto &&kv) -> std::vector<native_handle> {
[&file_path](auto &&list, auto &&kv) -> auto {
if (kv.first == file_path) {
auto *op_info = kv.second.get();
list.insert(list.end(), op_info->handles.begin(),

View File

@ -150,16 +150,16 @@ auto lock_data::set_mount_state(bool active, const std::string &mount_location,
(mount_state[mount_id]["Location"].get<std::string>() !=
mount_location)))) {
const auto lines = utils::file::read_file_lines(get_lock_data_file());
const auto txt =
std::accumulate(lines.begin(), lines.end(), std::string(),
[](std::string s, const std::string &s2) {
return std::move(s) + s2;
});
auto json = json::parse(txt.empty() ? "{}" : txt);
json[mount_id] = {{"Active", active},
const auto txt = std::accumulate(
lines.begin(), lines.end(), std::string(),
[](auto &&lines, auto &&line) -> auto { return lines + line; });
auto json_data = json::parse(txt.empty() ? "{}" : txt);
json_data[mount_id] = {
{"Active", active},
{"Location", active ? mount_location : ""},
{"PID", active ? pid : -1}};
ret = utils::file::write_json_file(get_lock_data_file(), json);
{"PID", active ? pid : -1},
};
ret = utils::file::write_json_file(get_lock_data_file(), json_data);
} else {
ret = true;
}

View File

@ -210,7 +210,7 @@ auto sia_provider::get_file(const std::string &api_path, api_file &file) const
auto size{
std::accumulate(
slabs.begin(), slabs.end(), std::uint64_t(0U),
[](std::uint64_t total_size, const json &slab) -> std::uint64_t {
[](auto &&total_size, const json &slab) -> std::uint64_t {
return total_size + slab["Length"].get<std::uint64_t>();
}),
};

View File

@ -35,7 +35,7 @@ void polling::frequency_thread(
unique_mutex_lock lock(mutex_);
auto futures = std::accumulate(
items_.begin(), items_.end(), std::deque<tasks::task_ptr>{},
[this, &freq](auto &&list, auto &&item) {
[this, &freq](auto &&list, auto &&item) -> auto {
if (item.second.freq != freq) {
return list;
}