ramfs: Miscellaneous code cleanups.

No behavioral change intended.
This commit is contained in:
Augustin Cavalier
2025-08-28 19:38:40 -04:00
parent 2d6a1945f0
commit 8aae7e134a
2 changed files with 6 additions and 8 deletions
@@ -134,17 +134,17 @@ DataContainer::Resize(off_t newSize)
{
// PRINT("DataContainer::Resize(%lld), fSize: %lld\n", newSize, fSize);
status_t error = B_OK;
if (_RequiresCacheMode(newSize)) {
if (newSize < fSize) {
// shrink
// resize the VMCache, which will automatically free pages
AutoLocker<VMCache> _(fCache);
error = fCache->Resize(newSize, VM_PRIORITY_USER);
status_t error = fCache->Resize(newSize, VM_PRIORITY_USER);
if (error != B_OK)
return error;
} else {
// grow
status_t error = B_OK;
if (!_IsCacheMode())
error = _SwitchToCacheMode();
if (error != B_OK)
@@ -171,9 +171,7 @@ DataContainer::Resize(off_t newSize)
}
fSize = newSize;
// PRINT("DataContainer::Resize() done: %lx, fSize: %lld\n", error, fSize);
return error;
return B_OK;
}
@@ -75,11 +75,11 @@ void
Index::Dump()
{
D(
PRINT("Index: `%s', type: %lx\n", GetName(), GetType());
PRINT("Index: `%s', type: %" B_PRIx32 "\n", GetName(), GetType());
for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) {
Entry *entry = it.GetCurrent();
PRINT(" entry: `%s', dir: %lld\n", entry->GetName(),
entry->GetParent()->GetID());
PRINT(" entry: `%s', dir: %" B_PRIdINO "\n", entry->GetName(),
entry->GetParent()->GetID());
}
)
}