Merge pull request #1891 from DarkLordZach/istorage-getsize
fsp_srv: Implement IStorage::GetSize
This commit is contained in:
commit
9bae3ac33a
|
@ -45,8 +45,12 @@ public:
|
||||||
explicit IStorage(FileSys::VirtualFile backend_)
|
explicit IStorage(FileSys::VirtualFile backend_)
|
||||||
: ServiceFramework("IStorage"), backend(std::move(backend_)) {
|
: ServiceFramework("IStorage"), backend(std::move(backend_)) {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &IStorage::Read, "Read"}, {1, nullptr, "Write"}, {2, nullptr, "Flush"},
|
{0, &IStorage::Read, "Read"},
|
||||||
{3, nullptr, "SetSize"}, {4, nullptr, "GetSize"}, {5, nullptr, "OperateRange"},
|
{1, nullptr, "Write"},
|
||||||
|
{2, nullptr, "Flush"},
|
||||||
|
{3, nullptr, "SetSize"},
|
||||||
|
{4, &IStorage::GetSize, "GetSize"},
|
||||||
|
{5, nullptr, "OperateRange"},
|
||||||
};
|
};
|
||||||
RegisterHandlers(functions);
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
@ -83,6 +87,15 @@ private:
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetSize(Kernel::HLERequestContext& ctx) {
|
||||||
|
const u64 size = backend->GetSize();
|
||||||
|
LOG_DEBUG(Service_FS, "called, size={}", size);
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 4};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.Push<u64>(size);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class IFile final : public ServiceFramework<IFile> {
|
class IFile final : public ServiceFramework<IFile> {
|
||||||
|
|
Reference in New Issue