mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Kernel: Make AddressSpace::amount_clean_inode() OOM-fallible
This commit is contained in:
parent
daf6b59a01
commit
bd603003b5
3 changed files with 4 additions and 4 deletions
|
@ -498,7 +498,7 @@ private:
|
|||
process_object.add("amount_virtual", process.address_space().amount_virtual());
|
||||
process_object.add("amount_resident", process.address_space().amount_resident());
|
||||
process_object.add("amount_dirty_private", process.address_space().amount_dirty_private());
|
||||
process_object.add("amount_clean_inode", process.address_space().amount_clean_inode());
|
||||
process_object.add("amount_clean_inode", TRY(process.address_space().amount_clean_inode()));
|
||||
process_object.add("amount_shared", process.address_space().amount_shared());
|
||||
process_object.add("amount_purgeable_volatile", process.address_space().amount_purgeable_volatile());
|
||||
process_object.add("amount_purgeable_nonvolatile", process.address_space().amount_purgeable_nonvolatile());
|
||||
|
|
|
@ -341,13 +341,13 @@ size_t AddressSpace::amount_dirty_private() const
|
|||
return amount;
|
||||
}
|
||||
|
||||
size_t AddressSpace::amount_clean_inode() const
|
||||
ErrorOr<size_t> AddressSpace::amount_clean_inode() const
|
||||
{
|
||||
SpinlockLocker lock(m_lock);
|
||||
HashTable<const InodeVMObject*> vmobjects;
|
||||
for (auto const& region : m_regions) {
|
||||
if (region->vmobject().is_inode())
|
||||
vmobjects.set(&static_cast<const InodeVMObject&>(region->vmobject()));
|
||||
TRY(vmobjects.try_set(&static_cast<const InodeVMObject&>(region->vmobject())));
|
||||
}
|
||||
size_t amount = 0;
|
||||
for (auto& vmobject : vmobjects)
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
RecursiveSpinlock& get_lock() const { return m_lock; }
|
||||
|
||||
size_t amount_clean_inode() const;
|
||||
ErrorOr<size_t> amount_clean_inode() const;
|
||||
size_t amount_dirty_private() const;
|
||||
size_t amount_virtual() const;
|
||||
size_t amount_resident() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue