mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
Kernel: Tidy up DevFS construction and handle OOM errorso
- Use KResultOr and TRY() to propagate errors - Check for OOM - Move allocations out of the DevFS constructor
This commit is contained in:
parent
efe4e230ee
commit
788b91a65c
3 changed files with 16 additions and 21 deletions
|
@ -20,7 +20,7 @@ class DevFS final : public FileSystem {
|
|||
|
||||
public:
|
||||
virtual ~DevFS() override;
|
||||
static NonnullRefPtr<DevFS> create();
|
||||
static KResultOr<NonnullRefPtr<DevFS>> try_create();
|
||||
|
||||
virtual KResult initialize() override;
|
||||
virtual StringView class_name() const override { return "DevFS"sv; }
|
||||
|
@ -35,7 +35,7 @@ private:
|
|||
KResultOr<NonnullRefPtr<Inode>> get_inode(InodeIdentifier) const;
|
||||
size_t allocate_inode_index();
|
||||
|
||||
NonnullRefPtr<DevFSRootDirectoryInode> m_root_inode;
|
||||
RefPtr<DevFSRootDirectoryInode> m_root_inode;
|
||||
NonnullRefPtrVector<DevFSInode> m_nodes;
|
||||
|
||||
InodeIndex m_next_inode_index { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue