Kernel: Remove some more harmless InodeVMObject miscasts

This commit is contained in:
Andreas Kling 2020-03-01 12:27:03 +01:00
parent b614462079
commit fee20bd8de
Notes: sideshowbarker 2024-07-19 08:57:29 +09:00
2 changed files with 3 additions and 3 deletions

View File

@ -541,7 +541,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot)
if (whole_region->access() == prot_to_region_access_flags(prot))
return 0;
if (whole_region->vmobject().is_inode()
&& !validate_inode_mmap_prot(*this, prot, static_cast<const SharedInodeVMObject&>(whole_region->vmobject()).inode(), whole_region->is_shared())) {
&& !validate_inode_mmap_prot(*this, prot, static_cast<const InodeVMObject&>(whole_region->vmobject()).inode(), whole_region->is_shared())) {
return -EACCES;
}
whole_region->set_readable(prot & PROT_READ);
@ -560,7 +560,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot)
if (old_region->access() == prot_to_region_access_flags(prot))
return 0;
if (old_region->vmobject().is_inode()
&& !validate_inode_mmap_prot(*this, prot, static_cast<const SharedInodeVMObject&>(old_region->vmobject()).inode(), old_region->is_shared())) {
&& !validate_inode_mmap_prot(*this, prot, static_cast<const InodeVMObject&>(old_region->vmobject()).inode(), old_region->is_shared())) {
return -EACCES;
}

View File

@ -146,7 +146,7 @@ size_t Region::amount_dirty() const
{
if (!vmobject().is_inode())
return amount_resident();
return static_cast<const SharedInodeVMObject&>(vmobject()).amount_dirty();
return static_cast<const InodeVMObject&>(vmobject()).amount_dirty();
}
size_t Region::amount_resident() const