ramfs: Miscellaneous code cleanups.
No behavioral change intended.
This commit is contained in:
@@ -134,17 +134,17 @@ DataContainer::Resize(off_t newSize)
|
|||||||
{
|
{
|
||||||
// PRINT("DataContainer::Resize(%lld), fSize: %lld\n", newSize, fSize);
|
// PRINT("DataContainer::Resize(%lld), fSize: %lld\n", newSize, fSize);
|
||||||
|
|
||||||
status_t error = B_OK;
|
|
||||||
if (_RequiresCacheMode(newSize)) {
|
if (_RequiresCacheMode(newSize)) {
|
||||||
if (newSize < fSize) {
|
if (newSize < fSize) {
|
||||||
// shrink
|
// shrink
|
||||||
// resize the VMCache, which will automatically free pages
|
// resize the VMCache, which will automatically free pages
|
||||||
AutoLocker<VMCache> _(fCache);
|
AutoLocker<VMCache> _(fCache);
|
||||||
error = fCache->Resize(newSize, VM_PRIORITY_USER);
|
status_t error = fCache->Resize(newSize, VM_PRIORITY_USER);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
} else {
|
} else {
|
||||||
// grow
|
// grow
|
||||||
|
status_t error = B_OK;
|
||||||
if (!_IsCacheMode())
|
if (!_IsCacheMode())
|
||||||
error = _SwitchToCacheMode();
|
error = _SwitchToCacheMode();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
@@ -171,9 +171,7 @@ DataContainer::Resize(off_t newSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fSize = newSize;
|
fSize = newSize;
|
||||||
|
return B_OK;
|
||||||
// PRINT("DataContainer::Resize() done: %lx, fSize: %lld\n", error, fSize);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ void
|
|||||||
Index::Dump()
|
Index::Dump()
|
||||||
{
|
{
|
||||||
D(
|
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()) {
|
for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) {
|
||||||
Entry *entry = it.GetCurrent();
|
Entry *entry = it.GetCurrent();
|
||||||
PRINT(" entry: `%s', dir: %lld\n", entry->GetName(),
|
PRINT(" entry: `%s', dir: %" B_PRIdINO "\n", entry->GetName(),
|
||||||
entry->GetParent()->GetID());
|
entry->GetParent()->GetID());
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user