fs: revise allocation-fail result names

This commit is contained in:
Michael Scire 2022-03-13 01:51:42 -08:00 committed by SciresM
parent 11e4bed199
commit e13b81aa9e
50 changed files with 304 additions and 218 deletions

View file

@ -223,7 +223,7 @@ namespace ams::fs::impl {
R_TRY(m_impl->OpenFile(std::addressof(file), normalized_path, mode));
auto accessor = new FileAccessor(std::move(file), this, mode);
R_UNLESS(accessor != nullptr, fs::ResultAllocationFailureInFileSystemAccessorA());
R_UNLESS(accessor != nullptr, fs::ResultAllocationMemoryFailedInFileSystemAccessorA());
{
std::scoped_lock lk(m_open_list_lock);
@ -251,7 +251,7 @@ namespace ams::fs::impl {
R_TRY(m_impl->OpenDirectory(std::addressof(dir), normalized_path, mode));
auto accessor = new DirectoryAccessor(std::move(dir), *this);
R_UNLESS(accessor != nullptr, fs::ResultAllocationFailureInFileSystemAccessorB());
R_UNLESS(accessor != nullptr, fs::ResultAllocationMemoryFailedInFileSystemAccessorB());
{
std::scoped_lock lk(m_open_list_lock);

View file

@ -21,21 +21,21 @@ namespace ams::fs::fsa {
Result Register(const char *name, std::unique_ptr<IFileSystem> &&fs) {
auto accessor = std::make_unique<impl::FileSystemAccessor>(name, std::move(fs));
R_UNLESS(accessor != nullptr, fs::ResultAllocationFailureInRegisterA());
R_UNLESS(accessor != nullptr, fs::ResultAllocationMemoryFailedInRegisterA());
return impl::Register(std::move(accessor));
}
Result Register(const char *name, std::unique_ptr<IFileSystem> &&fs, std::unique_ptr<ICommonMountNameGenerator> &&generator) {
auto accessor = std::make_unique<impl::FileSystemAccessor>(name, std::move(fs), std::move(generator));
R_UNLESS(accessor != nullptr, fs::ResultAllocationFailureInRegisterB());
R_UNLESS(accessor != nullptr, fs::ResultAllocationMemoryFailedInRegisterB());
return impl::Register(std::move(accessor));
}
Result Register(const char *name, std::unique_ptr<IFileSystem> &&fs, std::unique_ptr<ICommonMountNameGenerator> &&generator, bool use_data_cache, bool use_path_cache, bool support_multi_commit) {
auto accessor = std::make_unique<impl::FileSystemAccessor>(name, std::move(fs), std::move(generator));
R_UNLESS(accessor != nullptr, fs::ResultAllocationFailureInRegisterB());
R_UNLESS(accessor != nullptr, fs::ResultAllocationMemoryFailedInRegisterB());
accessor->SetFileDataCacheAttachable(use_data_cache);
accessor->SetPathBasedFileDataCacheAttachable(use_path_cache);

View file

@ -201,7 +201,7 @@ namespace ams::fs {
AMS_FS_R_UNLESS(out != nullptr, fs::ResultNullptrArgument());
auto file_accessor = std::make_unique<impl::FileAccessor>(std::move(file), nullptr, static_cast<OpenMode>(mode));
AMS_FS_R_UNLESS(file_accessor != nullptr, fs::ResultAllocationFailureInNew());
AMS_FS_R_UNLESS(file_accessor != nullptr, fs::ResultAllocationMemoryFailedNew());
out->handle = file_accessor.release();
R_SUCCEED();