1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 05:48:12 +00:00

Kernel: Tidy up TmpFS and TmpFSInode construction

- Use KResultOr<NonnullRefPtr<T>>
- Propagate errors
- Use TRY() at call sites
This commit is contained in:
Andreas Kling 2021-09-06 02:28:38 +02:00
parent 5e61382849
commit a8516681b7
3 changed files with 15 additions and 22 deletions

View file

@ -19,7 +19,7 @@ class TmpFS final : public FileSystem {
public:
virtual ~TmpFS() override;
static RefPtr<TmpFS> create();
static KResultOr<NonnullRefPtr<TmpFS>> try_create();
virtual KResult initialize() override;
virtual StringView class_name() const override { return "TmpFS"sv; }
@ -71,8 +71,8 @@ public:
private:
TmpFSInode(TmpFS& fs, const InodeMetadata& metadata, InodeIdentifier parent);
static RefPtr<TmpFSInode> create(TmpFS&, const InodeMetadata& metadata, InodeIdentifier parent);
static RefPtr<TmpFSInode> create_root(TmpFS&);
static KResultOr<NonnullRefPtr<TmpFSInode>> try_create(TmpFS&, InodeMetadata const& metadata, InodeIdentifier parent);
static KResultOr<NonnullRefPtr<TmpFSInode>> try_create_root(TmpFS&);
void notify_watchers();
struct Child {