mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 14:02:00 +00:00
Kernel/DevPtsFS: Add tightly typed DevPtsFSInode::fs()
This commit is contained in:
parent
65c8fa9f91
commit
fc0cd8317a
Notes:
sideshowbarker
2024-07-18 05:35:59 +09:00
Author: https://github.com/awesomekling
Commit: fc0cd8317a
2 changed files with 4 additions and 3 deletions
|
@ -145,11 +145,9 @@ KResultOr<NonnullRefPtr<Inode>> DevPtsFSInode::lookup(StringView name)
|
||||||
if (name == "." || name == "..")
|
if (name == "." || name == "..")
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
auto& fs = static_cast<DevPtsFS&>(this->fs());
|
|
||||||
|
|
||||||
auto pty_index = name.to_uint();
|
auto pty_index = name.to_uint();
|
||||||
if (pty_index.has_value() && s_ptys->contains(pty_index.value())) {
|
if (pty_index.has_value() && s_ptys->contains(pty_index.value())) {
|
||||||
auto inode = fs.get_inode({ fsid(), pty_index_to_inode_index(pty_index.value()) });
|
auto inode = fs().get_inode({ fsid(), pty_index_to_inode_index(pty_index.value()) });
|
||||||
if (!inode)
|
if (!inode)
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
return inode.release_nonnull();
|
return inode.release_nonnull();
|
||||||
|
|
|
@ -43,6 +43,9 @@ class DevPtsFSInode final : public Inode {
|
||||||
public:
|
public:
|
||||||
virtual ~DevPtsFSInode() override;
|
virtual ~DevPtsFSInode() override;
|
||||||
|
|
||||||
|
DevPtsFS& fs() { return static_cast<DevPtsFS&>(Inode::fs()); }
|
||||||
|
DevPtsFS const& fs() const { return static_cast<DevPtsFS const&>(Inode::fs()); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DevPtsFSInode(DevPtsFS&, InodeIndex, SlavePTY*);
|
DevPtsFSInode(DevPtsFS&, InodeIndex, SlavePTY*);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue