diff --git a/kernel/src/fs/VFS.h b/kernel/src/fs/VFS.h index ea9a8084..5e5e6387 100644 --- a/kernel/src/fs/VFS.h +++ b/kernel/src/fs/VFS.h @@ -20,7 +20,23 @@ namespace VFS virtual ~Inode() = default; - InodeType type; + virtual InodeType type() const = 0; + }; + + class FileInode : Inode + { + public: + Result find(const char*) const override + { + return err(ENOTDIR); + } + + InodeType type() const override + { + return InodeType::RegularFile; + } + + virtual ~FileInode() = default; }; class FileSystem diff --git a/kernel/src/fs/tmpfs/FileSystem.h b/kernel/src/fs/tmpfs/FileSystem.h index 81a4b996..2b41105f 100644 --- a/kernel/src/fs/tmpfs/FileSystem.h +++ b/kernel/src/fs/tmpfs/FileSystem.h @@ -26,18 +26,13 @@ namespace TmpFS Vector> m_inodes; }; - class Inode : public VFS::Inode + class Inode : public VFS::FileInode { public: Inode(); void set_fs(FileSystem& fs, Badge); - Result find(const char*) const override - { - return err(ENOTSUP); - } - VFS::FileSystem& fs() const override { return *m_fs;