kernel/vm: Add some more AssertLocked()s in VMCache commitment methods.

And remove a now-redundant one.
This commit is contained in:
Augustin Cavalier
2024-10-02 16:08:41 -04:00
parent a0fd8467d9
commit b11cc78c16
3 changed files with 4 additions and 2 deletions
@@ -720,6 +720,8 @@ VMAnonymousCache::Commit(off_t size, int priority)
{
TRACE("%p->VMAnonymousCache::Commit(%" B_PRIdOFF ")\n", this, size);
AssertLocked();
// If we can overcommit, we don't commit here, but in Fault(). We always
// unreserve memory, if we're asked to shrink our commitment, though.
if (fCanOvercommit && size > committed_size) {
@@ -61,6 +61,8 @@ VMAnonymousNoSwapCache::Init(bool canOvercommit, int32 numPrecommittedPages,
status_t
VMAnonymousNoSwapCache::Commit(off_t size, int priority)
{
AssertLocked();
// If we can overcommit, we don't commit here, but in Fault(). We always
// unreserve memory, if we're asked to shrink our commitment, though.
if (fCanOvercommit && size > committed_size) {
-2
View File
@@ -1083,8 +1083,6 @@ VMCache::SetMinimalCommitment(off_t commitment, int priority)
{
TRACE(("VMCache::SetMinimalCommitment(cache %p, commitment %" B_PRIdOFF
")\n", this, commitment));
AssertLocked();
T(SetMinimalCommitment(this, commitment));
status_t status = B_OK;