forked from Bananymous/banan-os
Kernel: Inode::Mode is now a struct so we can have functions in it
This commit is contained in:
@@ -252,7 +252,7 @@ namespace Kernel
|
||||
{
|
||||
// FIXME: update atime if needed
|
||||
|
||||
if (ifdir())
|
||||
if (mode().ifdir())
|
||||
return BAN::Error::from_errno(EISDIR);
|
||||
|
||||
if (offset >= m_inode.size)
|
||||
@@ -286,7 +286,7 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<BAN::Vector<BAN::String>> Ext2Inode::read_directory_entries(size_t index)
|
||||
{
|
||||
if (!ifdir())
|
||||
if (!mode().ifdir())
|
||||
return BAN::Error::from_errno(ENOTDIR);
|
||||
|
||||
uint32_t data_block_count = blocks();
|
||||
@@ -318,7 +318,7 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<void> Ext2Inode::create_file(BAN::StringView name, mode_t mode)
|
||||
{
|
||||
if (!ifdir())
|
||||
if (!this->mode().ifdir())
|
||||
return BAN::Error::from_errno(ENOTDIR);
|
||||
|
||||
if (name.size() > 255)
|
||||
@@ -403,7 +403,7 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<BAN::RefPtr<Inode>> Ext2Inode::read_directory_inode(BAN::StringView file_name)
|
||||
{
|
||||
if (!ifdir())
|
||||
if (!mode().ifdir())
|
||||
return BAN::Error::from_errno(ENOTDIR);
|
||||
|
||||
uint32_t block_size = m_fs.block_size();
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Kernel
|
||||
BAN::ErrorOr<void> VirtualFileSystem::mount(FileSystem* file_system, BAN::StringView path)
|
||||
{
|
||||
auto file = TRY(file_from_absolute_path(path));
|
||||
if (!file.inode->ifdir())
|
||||
if (!file.inode->mode().ifdir())
|
||||
return BAN::Error::from_errno(ENOTDIR);
|
||||
TRY(m_mount_points.push_back({ file, file_system }));
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user