diff options
Diffstat (limited to 'Kernel/FileSystem/RAMFS')
-rw-r--r-- | Kernel/FileSystem/RAMFS/FileSystem.h | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/RAMFS/Inode.cpp | 14 | ||||
-rw-r--r-- | Kernel/FileSystem/RAMFS/Inode.h | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/Kernel/FileSystem/RAMFS/FileSystem.h b/Kernel/FileSystem/RAMFS/FileSystem.h index bfe965e0dc..08273f1e00 100644 --- a/Kernel/FileSystem/RAMFS/FileSystem.h +++ b/Kernel/FileSystem/RAMFS/FileSystem.h @@ -30,7 +30,7 @@ public: private: RAMFS(); - LockRefPtr<RAMFSInode> m_root_inode; + RefPtr<RAMFSInode> m_root_inode; // NOTE: We start by assigning InodeIndex of 2, because 0 is invalid and 1 // is reserved for the root directory inode. diff --git a/Kernel/FileSystem/RAMFS/Inode.cpp b/Kernel/FileSystem/RAMFS/Inode.cpp index d2368d0b22..0441a34c46 100644 --- a/Kernel/FileSystem/RAMFS/Inode.cpp +++ b/Kernel/FileSystem/RAMFS/Inode.cpp @@ -32,14 +32,14 @@ RAMFSInode::RAMFSInode(RAMFS& fs) RAMFSInode::~RAMFSInode() = default; -ErrorOr<NonnullLockRefPtr<RAMFSInode>> RAMFSInode::try_create(RAMFS& fs, InodeMetadata const& metadata, LockWeakPtr<RAMFSInode> parent) +ErrorOr<NonnullRefPtr<RAMFSInode>> RAMFSInode::try_create(RAMFS& fs, InodeMetadata const& metadata, LockWeakPtr<RAMFSInode> parent) { - return adopt_nonnull_lock_ref_or_enomem(new (nothrow) RAMFSInode(fs, metadata, move(parent))); + return adopt_nonnull_ref_or_enomem(new (nothrow) RAMFSInode(fs, metadata, move(parent))); } -ErrorOr<NonnullLockRefPtr<RAMFSInode>> RAMFSInode::try_create_root(RAMFS& fs) +ErrorOr<NonnullRefPtr<RAMFSInode>> RAMFSInode::try_create_root(RAMFS& fs) { - return adopt_nonnull_lock_ref_or_enomem(new (nothrow) RAMFSInode(fs)); + return adopt_nonnull_ref_or_enomem(new (nothrow) RAMFSInode(fs)); } InodeMetadata RAMFSInode::metadata() const @@ -234,7 +234,7 @@ ErrorOr<void> RAMFSInode::truncate_to_block_index(size_t block_index) return {}; } -ErrorOr<NonnullLockRefPtr<Inode>> RAMFSInode::lookup(StringView name) +ErrorOr<NonnullRefPtr<Inode>> RAMFSInode::lookup(StringView name) { MutexLocker locker(m_inode_lock, Mutex::Mode::Shared); VERIFY(is_directory()); @@ -243,7 +243,7 @@ ErrorOr<NonnullLockRefPtr<Inode>> RAMFSInode::lookup(StringView name) return *this; if (name == "..") { if (auto parent = m_parent.strong_ref()) - return parent.release_nonnull(); + return *parent; return ENOENT; } @@ -292,7 +292,7 @@ ErrorOr<void> RAMFSInode::chown(UserID uid, GroupID gid) return {}; } -ErrorOr<NonnullLockRefPtr<Inode>> RAMFSInode::create_child(StringView name, mode_t mode, dev_t dev, UserID uid, GroupID gid) +ErrorOr<NonnullRefPtr<Inode>> RAMFSInode::create_child(StringView name, mode_t mode, dev_t dev, UserID uid, GroupID gid) { MutexLocker locker(m_inode_lock); auto now = kgettimeofday(); diff --git a/Kernel/FileSystem/RAMFS/Inode.h b/Kernel/FileSystem/RAMFS/Inode.h index 730b521e67..72ddeb0ea3 100644 --- a/Kernel/FileSystem/RAMFS/Inode.h +++ b/Kernel/FileSystem/RAMFS/Inode.h @@ -26,9 +26,9 @@ public: // ^Inode virtual InodeMetadata metadata() const override; virtual ErrorOr<void> traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override; - virtual ErrorOr<NonnullLockRefPtr<Inode>> lookup(StringView name) override; + virtual ErrorOr<NonnullRefPtr<Inode>> lookup(StringView name) override; virtual ErrorOr<void> flush_metadata() override; - virtual ErrorOr<NonnullLockRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, UserID, GroupID) override; + virtual ErrorOr<NonnullRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, UserID, GroupID) override; virtual ErrorOr<void> add_child(Inode&, StringView name, mode_t) override; virtual ErrorOr<void> remove_child(StringView name) override; virtual ErrorOr<void> replace_child(StringView name, Inode& child) override; @@ -40,8 +40,8 @@ public: private: RAMFSInode(RAMFS& fs, InodeMetadata const& metadata, LockWeakPtr<RAMFSInode> parent); explicit RAMFSInode(RAMFS& fs); - static ErrorOr<NonnullLockRefPtr<RAMFSInode>> try_create(RAMFS&, InodeMetadata const& metadata, LockWeakPtr<RAMFSInode> parent); - static ErrorOr<NonnullLockRefPtr<RAMFSInode>> try_create_root(RAMFS&); + static ErrorOr<NonnullRefPtr<RAMFSInode>> try_create(RAMFS&, InodeMetadata const& metadata, LockWeakPtr<RAMFSInode> parent); + static ErrorOr<NonnullRefPtr<RAMFSInode>> try_create_root(RAMFS&); // ^Inode virtual ErrorOr<size_t> read_bytes_locked(off_t, size_t, UserOrKernelBuffer& buffer, OpenFileDescription*) const override; @@ -51,7 +51,7 @@ private: struct Child { NonnullOwnPtr<KString> name; - NonnullLockRefPtr<RAMFSInode> inode; + NonnullRefPtr<RAMFSInode> inode; IntrusiveListNode<Child> list_node {}; using List = IntrusiveList<&Child::list_node>; }; |