1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

Kernel/SysFS: Make it clear that some components must be created in boot

Using the phrase "create" doesn't give information on whether the object
must be allocated or a failure to do so can be handled gracefully.
Therefore, we must use better phrase for such purpose, so "must_create"
for the allocate-and-construct static methods is definitely good choice.
This commit is contained in:
Liav A 2021-12-12 16:46:11 +02:00 committed by Andreas Kling
parent 478f543899
commit 381fdaa163
5 changed files with 15 additions and 22 deletions

View file

@ -72,7 +72,7 @@ protected:
class DMIEntryPointExposedBlob : public BIOSSysFSComponent {
public:
virtual StringView name() const override { return "smbios_entry_point"sv; }
static NonnullRefPtr<DMIEntryPointExposedBlob> create(PhysicalAddress dmi_entry_point, size_t blob_size);
static NonnullRefPtr<DMIEntryPointExposedBlob> must_create(PhysicalAddress dmi_entry_point, size_t blob_size);
private:
DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size);
@ -84,7 +84,7 @@ private:
class SMBIOSExposedTable : public BIOSSysFSComponent {
public:
virtual StringView name() const override { return "DMI"sv; }
static NonnullRefPtr<SMBIOSExposedTable> create(PhysicalAddress, size_t blob_size);
static NonnullRefPtr<SMBIOSExposedTable> must_create(PhysicalAddress, size_t blob_size);
private:
SMBIOSExposedTable(PhysicalAddress dmi_entry_point, size_t blob_size);
@ -97,7 +97,7 @@ private:
class BIOSSysFSDirectory : public SysFSDirectory {
public:
virtual StringView name() const override { return "bios"sv; }
static ErrorOr<NonnullRefPtr<BIOSSysFSDirectory>> try_create(FirmwareSysFSDirectory&);
static NonnullRefPtr<BIOSSysFSDirectory> must_create(FirmwareSysFSDirectory&);
void create_components();