debugging
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
Scott E. Graves 2025-04-04 13:21:07 -05:00
parent 0603463885
commit 28d1789f04
2 changed files with 36 additions and 33 deletions

View File

@ -85,8 +85,8 @@ auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid,
struct fuse_file_info * /*file_info*/) struct fuse_file_info * /*file_info*/)
-> api_error { -> api_error {
#else #else
auto fuse_drive::chown_impl(std::string api_path, uid_t uid, auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid)
gid_t gid) -> api_error { -> api_error {
#endif #endif
return check_and_perform( return check_and_perform(
api_path, X_OK, [&](api_meta_map &meta) -> api_error { api_path, X_OK, [&](api_meta_map &meta) -> api_error {
@ -464,7 +464,7 @@ auto fuse_drive::get_file_size(const std::string &api_path) const
std::uint64_t file_size{}; std::uint64_t file_size{};
auto res = provider_.get_file_size(api_path, file_size); auto res = provider_.get_file_size(api_path, file_size);
if (res == api_error::success) { if (res != api_error::success) {
utils::error::raise_api_path_error(function_name, api_path, res, utils::error::raise_api_path_error(function_name, api_path, res,
"failed to get file size from provider"); "failed to get file size from provider");
} }
@ -494,8 +494,8 @@ auto fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st,
struct fuse_file_info * /*file_info*/) struct fuse_file_info * /*file_info*/)
-> api_error { -> api_error {
#else #else
auto fuse_drive::getattr_impl(std::string api_path, auto fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st)
struct stat *unix_st) -> api_error { -> api_error {
#endif #endif
auto parent = utils::path::get_parent_api_path(api_path); auto parent = utils::path::get_parent_api_path(api_path);
@ -561,8 +561,8 @@ auto fuse_drive::getxtimes_impl(std::string api_path, struct timespec *bkuptime,
#endif // __APPLE__ #endif // __APPLE__
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_drive::init_impl(struct fuse_conn_info *conn, auto fuse_drive::init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
struct fuse_config *cfg) -> void * { -> void * {
#else #else
void *fuse_drive::init_impl(struct fuse_conn_info *conn) { void *fuse_drive::init_impl(struct fuse_conn_info *conn) {
#endif #endif
@ -804,8 +804,9 @@ auto fuse_drive::release_impl(std::string /*api_path*/,
return api_error::success; return api_error::success;
} }
auto fuse_drive::releasedir_impl( auto fuse_drive::releasedir_impl(std::string /*api_path*/,
std::string /*api_path*/, struct fuse_file_info *file_info) -> api_error { struct fuse_file_info *file_info)
-> api_error {
auto iter = directory_cache_->get_directory(file_info->fh); auto iter = directory_cache_->get_directory(file_info->fh);
if (iter == nullptr) { if (iter == nullptr) {
return api_error::invalid_handle; return api_error::invalid_handle;
@ -823,8 +824,8 @@ auto fuse_drive::rename_directory(const std::string &from_api_path,
} }
auto fuse_drive::rename_file(const std::string &from_api_path, auto fuse_drive::rename_file(const std::string &from_api_path,
const std::string &to_api_path, const std::string &to_api_path, bool overwrite)
bool overwrite) -> int { -> int {
auto res = fm_->rename_file(from_api_path, to_api_path, overwrite); auto res = fm_->rename_file(from_api_path, to_api_path, overwrite);
errno = std::abs(utils::from_api_error(res)); errno = std::abs(utils::from_api_error(res));
return (res == api_error::success) ? 0 : -1; return (res == api_error::success) ? 0 : -1;
@ -834,8 +835,8 @@ auto fuse_drive::rename_file(const std::string &from_api_path,
auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path, auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path,
unsigned int /*flags*/) -> api_error { unsigned int /*flags*/) -> api_error {
#else #else
auto fuse_drive::rename_impl(std::string from_api_path, auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path)
std::string to_api_path) -> api_error { -> api_error {
#endif #endif
auto res = check_parent_access(to_api_path, W_OK | X_OK); auto res = check_parent_access(to_api_path, W_OK | X_OK);
if (res != api_error::success) { if (res != api_error::success) {
@ -937,15 +938,15 @@ auto fuse_drive::getxattr_impl(std::string api_path, const char *name,
} }
#else // __APPLE__ #else // __APPLE__
auto fuse_drive::getxattr_impl(std::string api_path, const char *name, auto fuse_drive::getxattr_impl(std::string api_path, const char *name,
char *value, size_t size, char *value, size_t size, int &attribute_size)
int &attribute_size) -> api_error { -> api_error {
return getxattr_common(api_path, name, value, size, attribute_size, nullptr); return getxattr_common(api_path, name, value, size, attribute_size, nullptr);
} }
#endif // __APPLE__ #endif // __APPLE__
auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size, auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size,
int &required_size, int &required_size, bool &return_size)
bool &return_size) -> api_error { -> api_error {
auto check_size = (size == 0); auto check_size = (size == 0);
auto res = check_parent_access(api_path, X_OK); auto res = check_parent_access(api_path, X_OK);
@ -985,8 +986,8 @@ auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size,
return res; return res;
} }
auto fuse_drive::removexattr_impl(std::string api_path, auto fuse_drive::removexattr_impl(std::string api_path, const char *name)
const char *name) -> api_error { -> api_error {
std::string attribute_name; std::string attribute_name;
#if defined(__APPLE__) #if defined(__APPLE__)
auto res = parse_xattr_parameters(name, 0, attribute_name, api_path); auto res = parse_xattr_parameters(name, 0, attribute_name, api_path);
@ -1014,8 +1015,8 @@ auto fuse_drive::setxattr_impl(std::string api_path, const char *name,
uint32_t position) -> api_error { uint32_t position) -> api_error {
#else // __APPLE__ #else // __APPLE__
auto fuse_drive::setxattr_impl(std::string api_path, const char *name, auto fuse_drive::setxattr_impl(std::string api_path, const char *name,
const char *value, size_t size, const char *value, size_t size, int flags)
int flags) -> api_error { -> api_error {
#endif #endif
std::string attribute_name; std::string attribute_name;
#if defined(__APPLE__) #if defined(__APPLE__)
@ -1093,8 +1094,8 @@ void fuse_drive::set_item_meta(const std::string &api_path,
} }
#if defined(__APPLE__) #if defined(__APPLE__)
auto fuse_drive::setattr_x_impl(std::string api_path, auto fuse_drive::setattr_x_impl(std::string api_path, struct setattr_x *attr)
struct setattr_x *attr) -> api_error { -> api_error {
bool exists{}; bool exists{};
auto res = provider_.is_file(api_path, exists); auto res = provider_.is_file(api_path, exists);
if (res != api_error::success) { if (res != api_error::success) {
@ -1148,7 +1149,7 @@ auto fuse_drive::setattr_x_impl(std::string api_path,
ts[0].tv_sec = attr->acctime.tv_sec; ts[0].tv_sec = attr->acctime.tv_sec;
ts[0].tv_nsec = attr->acctime.tv_nsec; ts[0].tv_nsec = attr->acctime.tv_nsec;
} else { } else {
struct timeval tv {}; struct timeval tv{};
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
ts[0].tv_sec = tv.tv_sec; ts[0].tv_sec = tv.tv_sec;
ts[0].tv_nsec = tv.tv_usec * 1000; ts[0].tv_nsec = tv.tv_usec * 1000;
@ -1193,8 +1194,9 @@ auto fuse_drive::setattr_x_impl(std::string api_path,
return api_error::success; return api_error::success;
} }
auto fuse_drive::setbkuptime_impl( auto fuse_drive::setbkuptime_impl(std::string api_path,
std::string api_path, const struct timespec *bkuptime) -> api_error { const struct timespec *bkuptime)
-> api_error {
return check_and_perform( return check_and_perform(
api_path, X_OK, [&](api_meta_map &meta) -> api_error { api_path, X_OK, [&](api_meta_map &meta) -> api_error {
auto nanos = bkuptime->tv_nsec + auto nanos = bkuptime->tv_nsec +
@ -1230,8 +1232,8 @@ auto fuse_drive::setvolname_impl(const char * /*volname*/) -> api_error {
return api_error::success; return api_error::success;
} }
auto fuse_drive::statfs_x_impl(std::string /*api_path*/, auto fuse_drive::statfs_x_impl(std::string /*api_path*/, struct statfs *stbuf)
struct statfs *stbuf) -> api_error { -> api_error {
if (statfs(&config_.get_cache_directory()[0], stbuf) != 0) { if (statfs(&config_.get_cache_directory()[0], stbuf) != 0) {
return api_error::os_error; return api_error::os_error;
} }
@ -1256,8 +1258,8 @@ auto fuse_drive::statfs_x_impl(std::string /*api_path*/,
return api_error::success; return api_error::success;
} }
#else // __APPLE__ #else // __APPLE__
auto fuse_drive::statfs_impl(std::string /*api_path*/, auto fuse_drive::statfs_impl(std::string /*api_path*/, struct statvfs *stbuf)
struct statvfs *stbuf) -> api_error { -> api_error {
if (statvfs(config_.get_cache_directory().data(), stbuf) != 0) { if (statvfs(config_.get_cache_directory().data(), stbuf) != 0) {
return api_error::os_error; return api_error::os_error;
} }
@ -1341,8 +1343,8 @@ auto fuse_drive::utimens_impl(std::string api_path, const struct timespec tv[2],
struct fuse_file_info * /*file_info*/) struct fuse_file_info * /*file_info*/)
-> api_error { -> api_error {
#else #else
auto fuse_drive::utimens_impl(std::string api_path, auto fuse_drive::utimens_impl(std::string api_path, const struct timespec tv[2])
const struct timespec tv[2]) -> api_error { -> api_error {
#endif #endif
api_meta_map meta; api_meta_map meta;
auto res = provider_.get_item_meta(api_path, meta); auto res = provider_.get_item_meta(api_path, meta);

View File

@ -188,6 +188,8 @@ auto remote_client::winfsp_create(PWSTR file_name, UINT32 create_options,
DECODE_OR_IGNORE(&response, normalized_name); DECODE_OR_IGNORE(&response, normalized_name);
DECODE_OR_IGNORE(&response, exists); DECODE_OR_IGNORE(&response, exists);
fmt::println("{}|{}", exists, ret);
if (exists == 0U) { if (exists == 0U) {
*file_desc = reinterpret_cast<PVOID>(handle); *file_desc = reinterpret_cast<PVOID>(handle);
set_open_info(to_handle(*file_desc), set_open_info(to_handle(*file_desc),
@ -205,7 +207,6 @@ auto remote_client::winfsp_create(PWSTR file_name, UINT32 create_options,
#endif // defined(_WIN32) #endif // defined(_WIN32)
} }
fmt::println("{}|{}|{}", utils::string::to_utf8(file_name), exists, ret);
return ret; return ret;
} }