Ticket #5706: ext2_numInodes.patch
File ext2_numInodes.patch, 2.0 KB (added by , 14 years ago) |
---|
-
src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
158 158 { 159 159 Volume* volume = (Volume*)_volume->private_volume; 160 160 161 if (id < 2 || id > volume->Num Blocks()) {161 if (id < 2 || id > volume->NumInodes()) { 162 162 dprintf("ext2: inode at %Ld requested!\n", id); 163 163 return B_ERROR; 164 164 } -
src/add-ons/kernel/file_systems/ext2/Volume.cpp
200 200 if (Magic() != (uint32)EXT2_SUPER_BLOCK_MAGIC) 201 201 return false; 202 202 203 if (State() == 2) 204 // File system contains errors 205 return false; 206 203 207 return true; 204 208 } 205 209 … … 278 282 fBlockSize = 1UL << fSuperBlock.BlockShift(); 279 283 fFirstDataBlock = fSuperBlock.FirstDataBlock(); 280 284 285 fNumInodes = fSuperBlock.NumInodes(); 281 286 fNumGroups = (fSuperBlock.NumBlocks() - fFirstDataBlock - 1) 282 287 / fSuperBlock.BlocksPerGroup() + 1; 283 288 fGroupsPerBlock = fBlockSize / sizeof(ext2_block_group); -
src/add-ons/kernel/file_systems/ext2/Volume.h
38 38 fs_volume* FSVolume() const { return fFSVolume; } 39 39 const char* Name() const; 40 40 41 uint32 NumInodes() const 42 { return fNumInodes; } 41 43 off_t NumBlocks() const 42 44 { return fSuperBlock.NumBlocks(); } 43 45 off_t FreeBlocks() const … … 74 76 uint32 fBlockSize; 75 77 uint32 fBlockShift; 76 78 uint32 fFirstDataBlock; 79 uint32 fNumInodes; 77 80 uint32 fNumGroups; 78 81 uint32 fGroupsPerBlock; 79 82 ext2_block_group** fGroupBlocks;