Kernel: Move Partition out of StorageDevice and rename functions

This commit is contained in:
Bananymous
2023-03-29 13:23:01 +03:00
parent ae05ad3f38
commit dd84a2175f
10 changed files with 51 additions and 48 deletions

View File

@@ -142,7 +142,7 @@ namespace Kernel
virtual BAN::ErrorOr<void> create_file(BAN::StringView, mode_t) override;
virtual Type type() const override { return Type::Ext2; }
virtual InodeType type() const override { return InodeType::Ext2; }
virtual bool operator==(const Inode& other) const override;
protected:
@@ -175,12 +175,12 @@ namespace Kernel
class Ext2FS : public FileSystem
{
public:
static BAN::ErrorOr<Ext2FS*> create(StorageDevice::Partition&);
static BAN::ErrorOr<Ext2FS*> create(Partition&);
virtual BAN::RefPtr<Inode> root_inode() override { return m_root_inode; }
private:
Ext2FS(StorageDevice::Partition& partition)
Ext2FS(Partition& partition)
: m_partition(partition)
{}
@@ -207,7 +207,7 @@ namespace Kernel
uint32_t block_size() const { return 1024 << superblock().log_block_size; }
private:
StorageDevice::Partition& m_partition;
Partition& m_partition;
BAN::RefPtr<Inode> m_root_inode;

View File

@@ -33,7 +33,7 @@ namespace Kernel
IFREG = 0x8000,
};
enum class Type
enum class InodeType
{
DeviceManager,
Device,
@@ -66,7 +66,7 @@ namespace Kernel
virtual BAN::ErrorOr<size_t> read(size_t, void*, size_t) = 0;
virtual BAN::ErrorOr<void> create_file(BAN::StringView, mode_t) = 0;
virtual Type type() const = 0;
virtual InodeType type() const = 0;
virtual bool operator==(const Inode&) const = 0;
protected: