bfs_read_vnode() no longer tries to load a block when there can't be an inode

(since it knows that it doesn't place any inodes before the end of the log area).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14068 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-08-26 02:37:57 +00:00
parent e432cef296
commit 15612acb76
1 changed files with 5 additions and 2 deletions

View File

@ -257,8 +257,11 @@ bfs_read_vnode(void *_ns, vnode_id id, void **_node, bool reenter)
//FUNCTION_START(("vnode_id = %Ld\n", id));
Volume *volume = (Volume *)_ns;
if (id < 0 || id > volume->NumBlocks()) {
FATAL(("inode at %Ld requested!\n", id));
// first inode may be after the log area, we don't go through
// the hassle and try to load an earlier block from disk
if (id < volume->ToBlock(volume->Log()) + volume->Log().Length()
|| id > volume->NumBlocks()) {
INFORM(("inode at %Ld requested!\n", id));
return B_ERROR;
}