mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
Kernel: Remove some more harmless InodeVMObject miscasts
This commit is contained in:
parent
b614462079
commit
fee20bd8de
Notes:
sideshowbarker
2024-07-19 08:57:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fee20bd8de0
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user