Make PrepareIndices() fail if there isn't anything left to do.
This commit is contained in:
@@ -1360,8 +1360,14 @@ BlockAllocator::CheckNextNode(check_control* control)
|
|||||||
|
|
||||||
fCheckCookie->pass = BFS_CHECK_PASS_INDEX;
|
fCheckCookie->pass = BFS_CHECK_PASS_INDEX;
|
||||||
fCheckCookie->control.pass = BFS_CHECK_PASS_INDEX;
|
fCheckCookie->control.pass = BFS_CHECK_PASS_INDEX;
|
||||||
|
|
||||||
|
status_t status = _PrepareIndices();
|
||||||
|
if (status != B_OK) {
|
||||||
|
fCheckCookie->control.status = status;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
fCheckCookie->stack.Push(fVolume->Root());
|
fCheckCookie->stack.Push(fVolume->Root());
|
||||||
_PrepareIndices();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2018,6 +2024,8 @@ BlockAllocator::_CheckInodeBlocks(Inode* inode, const char* name)
|
|||||||
status_t
|
status_t
|
||||||
BlockAllocator::_PrepareIndices()
|
BlockAllocator::_PrepareIndices()
|
||||||
{
|
{
|
||||||
|
int32 count = 0;
|
||||||
|
|
||||||
for (int32 i = 0; i < fCheckCookie->indices.CountItems(); i++) {
|
for (int32 i = 0; i < fCheckCookie->indices.CountItems(); i++) {
|
||||||
check_index* index = fCheckCookie->indices.Array()[i];
|
check_index* index = fCheckCookie->indices.Array()[i];
|
||||||
Vnode vnode(fVolume, index->run);
|
Vnode vnode(fVolume, index->run);
|
||||||
@@ -2041,9 +2049,10 @@ BlockAllocator::_PrepareIndices()
|
|||||||
|
|
||||||
index->inode = inode;
|
index->inode = inode;
|
||||||
vnode.Keep();
|
vnode.Keep();
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return count == 0 ? B_ENTRY_NOT_FOUND : B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user