update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
3 changed files with 7 additions and 8 deletions
Showing only changes of commit dedb2a2399 - Show all commits

View File

@ -25,9 +25,9 @@ namespace Kernel
{ {
protected: protected:
BlockDevice(mode_t mode, uid_t uid, gid_t gid) BlockDevice(mode_t mode, uid_t uid, gid_t gid)
: Device(Mode::IFBLK | mode, uid, gid) : Device(mode, uid, gid)
{ {
ASSERT(Device::mode().ifblk()); m_inode_info.mode |= Inode::Mode::IFBLK;
} }
}; };
@ -35,9 +35,9 @@ namespace Kernel
{ {
protected: protected:
CharacterDevice(mode_t mode, uid_t uid, gid_t gid) CharacterDevice(mode_t mode, uid_t uid, gid_t gid)
: Device(Mode::IFCHR | mode, uid, gid) : Device(mode, uid, gid)
{ {
ASSERT(Device::mode().ifchr()); m_inode_info.mode |= Inode::Mode::IFCHR;
} }
}; };

View File

@ -52,7 +52,9 @@ namespace Kernel
RamInode(RamFileSystem& fs, const FullInodeInfo& inode_info) RamInode(RamFileSystem& fs, const FullInodeInfo& inode_info)
: m_fs(fs) : m_fs(fs)
, m_inode_info(inode_info) , m_inode_info(inode_info)
{} {
ASSERT((inode_info.mode & Inode::Mode::TYPE_MASK) == 0);
}
protected: protected:
RamFileSystem& m_fs; RamFileSystem& m_fs;

View File

@ -45,7 +45,6 @@ namespace Kernel
RamFileInode::RamFileInode(RamFileSystem& fs, const FullInodeInfo& inode_info) RamFileInode::RamFileInode(RamFileSystem& fs, const FullInodeInfo& inode_info)
: RamInode(fs, inode_info) : RamInode(fs, inode_info)
{ {
ASSERT((m_inode_info.mode & Inode::Mode::TYPE_MASK) == 0);
m_inode_info.mode |= Inode::Mode::IFREG; m_inode_info.mode |= Inode::Mode::IFREG;
} }
@ -108,7 +107,6 @@ namespace Kernel
: RamInode(fs, inode_info) : RamInode(fs, inode_info)
, m_parent(parent) , m_parent(parent)
{ {
ASSERT((m_inode_info.mode & Inode::Mode::TYPE_MASK) == 0);
m_inode_info.mode |= Inode::Mode::IFDIR; m_inode_info.mode |= Inode::Mode::IFDIR;
} }
@ -263,7 +261,6 @@ namespace Kernel
: RamInode(fs, inode_info) : RamInode(fs, inode_info)
, m_target(BAN::move(target)) , m_target(BAN::move(target))
{ {
ASSERT((m_inode_info.mode & Inode::Mode::TYPE_MASK) == 0);
m_inode_info.mode |= Inode::Mode::IFLNK; m_inode_info.mode |= Inode::Mode::IFLNK;
} }