* Changed to use Volume::InodeSize() over sizeof(ext2_inode) as described
in ticket #2707. Thanks Adrian! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28536 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a418aa5f4f
commit
5d8428e023
@ -32,10 +32,12 @@ Inode::Inode(Volume* volume, ino_t id)
|
||||
uint32 block;
|
||||
if (volume->GetInodeBlock(id, block) == B_OK) {
|
||||
TRACE("inode %Ld at block %lu\n", ID(), block);
|
||||
ext2_inode* inodes = (ext2_inode*)block_cache_get(volume->BlockCache(),
|
||||
uint8* inodeBlock = (uint8*)block_cache_get(volume->BlockCache(),
|
||||
block);
|
||||
if (inodes != NULL)
|
||||
fNode = inodes + volume->InodeBlockIndex(id);
|
||||
if (inodeBlock != NULL) {
|
||||
fNode = (ext2_inode*)(inodeBlock + volume->InodeBlockIndex(id)
|
||||
* volume->InodeSize());
|
||||
}
|
||||
}
|
||||
|
||||
if (fNode != NULL) {
|
||||
|
@ -297,7 +297,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
memset(fGroupBlocks, 0, blockCount * sizeof(void*));
|
||||
fInodesPerBlock = fBlockSize / sizeof(ext2_inode);
|
||||
fInodesPerBlock = fBlockSize / InodeSize();
|
||||
|
||||
// check if the device size is large enough to hold the file system
|
||||
off_t diskSize;
|
||||
|
Loading…
Reference in New Issue
Block a user