Kernel: Remove use of copy_ref() in favor of regular RefPtr copies.

This is obviously more readable. If we ever run into a situation where
ref count churn is actually causing trouble in the future, we can deal with
it then. For now, let's keep it simple. :^)
This commit is contained in:
Andreas Kling 2019-07-11 15:38:47 +02:00
parent 560d037c41
commit 5254a320d8
Notes: sideshowbarker 2024-07-19 13:19:54 +09:00
14 changed files with 34 additions and 34 deletions

View file

@ -31,7 +31,7 @@ static u8 to_ext2_file_type(mode_t mode)
return EXT2_FT_UNKNOWN;
}
NonnullRefPtr<Ext2FS> Ext2FS::create(NonnullRefPtr<DiskDevice>&& device)
NonnullRefPtr<Ext2FS> Ext2FS::create(NonnullRefPtr<DiskDevice> device)
{
return adopt(*new Ext2FS(move(device)));
}
@ -475,7 +475,7 @@ RefPtr<Inode> Ext2FS::get_inode(InodeIdentifier inode) const
return (*it).value;
auto new_inode = adopt(*new Ext2FSInode(const_cast<Ext2FS&>(*this), inode.index()));
memcpy(&new_inode->m_raw_inode, reinterpret_cast<ext2_inode*>(block.offset_pointer(offset)), sizeof(ext2_inode));
m_inode_cache.set(inode.index(), new_inode.copy_ref());
m_inode_cache.set(inode.index(), new_inode);
return new_inode;
}