Resize caches in all cases when cutting areas

* Adds VMCache::MovePageRange() and VMCache::Rebase() to facilitate
  this.

Applied on top of hrev45098 and rebased with the hrev45564 page_num_t to
off_t change included.

Change-Id: Ie61bf43696783e3376fb4144ddced3781aa092ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2581
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Hamish Morrison
2020-05-08 21:56:56 +00:00
committed by waddlesplash
parent 905284b397
commit c6657ffe02
6 changed files with 268 additions and 22 deletions
+4
View File
@@ -110,8 +110,11 @@ public:
vm_page* LookupPage(off_t offset);
void InsertPage(vm_page* page, off_t offset);
void RemovePage(vm_page* page);
void MovePage(vm_page* page, off_t offset);
void MovePage(vm_page* page);
void MoveAllPages(VMCache* fromCache);
void MovePageRange(VMCache* source, off_t offset,
off_t size, off_t newOffset);
inline page_num_t WiredPagesCount() const;
inline void IncrementWiredPagesCount();
@@ -130,6 +133,7 @@ public:
status_t SetMinimalCommitment(off_t commitment,
int priority);
virtual status_t Resize(off_t newSize, int priority);
virtual status_t Rebase(off_t newBase, int priority);
status_t FlushAndRemoveAllPages();