forked from Bananymous/banan-os
Kernel: Start making device numbers unique for each device
This commit is contained in:
@@ -19,7 +19,6 @@ namespace Kernel
|
||||
void add_device(BAN::RefPtr<Device>);
|
||||
void add_inode(BAN::StringView path, BAN::RefPtr<TmpInode>);
|
||||
|
||||
dev_t get_next_dev() const;
|
||||
int get_next_input_device() const;
|
||||
|
||||
void initiate_sync(bool should_block);
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace Kernel
|
||||
|
||||
virtual BAN::RefPtr<Inode> root_inode() override { return m_root_inode; }
|
||||
|
||||
virtual dev_t dev() const override { return m_block_device->rdev(); };
|
||||
|
||||
private:
|
||||
Ext2FS(BAN::RefPtr<BlockDevice> block_device)
|
||||
: m_block_device(block_device)
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace Kernel
|
||||
public:
|
||||
virtual ~FileSystem() {}
|
||||
virtual BAN::RefPtr<Inode> root_inode() = 0;
|
||||
|
||||
virtual dev_t dev() const = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace Kernel
|
||||
|
||||
virtual BAN::RefPtr<Inode> root_inode() override { return m_root_inode; }
|
||||
|
||||
virtual dev_t dev() const override { return m_rdev; }
|
||||
|
||||
BAN::ErrorOr<BAN::RefPtr<TmpInode>> open_inode(ino_t ino);
|
||||
|
||||
BAN::ErrorOr<void> add_to_cache(BAN::RefPtr<TmpInode>);
|
||||
@@ -115,6 +117,8 @@ namespace Kernel
|
||||
paddr_t find_indirect(PageInfo root, size_t index, size_t depth);
|
||||
|
||||
private:
|
||||
const dev_t m_rdev;
|
||||
|
||||
RecursiveSpinLock m_lock;
|
||||
|
||||
BAN::HashMap<ino_t, BAN::RefPtr<TmpInode>> m_inode_cache;
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace Kernel
|
||||
virtual timespec ctime() const override { return m_inode_info.ctime; }
|
||||
virtual blksize_t blksize() const override { return PAGE_SIZE; }
|
||||
virtual blkcnt_t blocks() const override { return m_inode_info.blocks; }
|
||||
virtual dev_t dev() const override { return 0; } // TODO
|
||||
virtual dev_t rdev() const override { return 0; } // TODO
|
||||
virtual dev_t dev() const override;
|
||||
virtual dev_t rdev() const override { return 0; }
|
||||
|
||||
public:
|
||||
static BAN::ErrorOr<BAN::RefPtr<TmpInode>> create_from_existing(TmpFileSystem&, ino_t, const TmpInodeInfo&);
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace Kernel
|
||||
|
||||
virtual BAN::RefPtr<Inode> root_inode() override { return m_root_fs->root_inode(); }
|
||||
|
||||
// FIXME:
|
||||
virtual dev_t dev() const override { return 0; }
|
||||
|
||||
BAN::ErrorOr<void> mount(const Credentials&, BAN::StringView, BAN::StringView);
|
||||
BAN::ErrorOr<void> mount(const Credentials&, FileSystem*, BAN::StringView);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user