Take inode size from Ext2 superblock.

svn path=/trunk/; revision=42723
This commit is contained in:
Dmitry Gorbachev 2009-08-16 01:20:22 +00:00
parent 961afecdd8
commit 2a60b44d65
4 changed files with 19 additions and 10 deletions

View file

@ -452,8 +452,9 @@ typedef struct _Ext2VolumeControlBlock
ULONG ReservedBlocksCount;
ULONG FreeBlocksCount;
ULONG FreeInodesCount;
ULONG LogBlockSize; // Block size = 1024 << LogBlockSize
ULONG LogBlockSize; // Block size = 1024 << LogBlockSize
ULONG InodeSize;
// Group Information Saved up in the VCB...
PtrExt2GroupDescriptors PtrGroupDescriptors;
ULONG NoOfGroups;

View file

@ -368,6 +368,14 @@ Ext2MountVolume (
PtrVCB->NoOfGroups = ( SuperBlock->s_blocks_count - SuperBlock->s_first_data_block
+ SuperBlock->s_blocks_per_group - 1 )
/ SuperBlock->s_blocks_per_group;
if( SuperBlock->s_rev_level )
{
PtrVCB->InodeSize = SuperBlock->s_inode_size;
}
else
{
PtrVCB->InodeSize = sizeof( EXT2_INODE );
}
PtrVCB->PtrGroupDescriptors = Ext2AllocatePool( NonPagedPool, sizeof( Ext2GroupDescriptors ) * PtrVCB->NoOfGroups );
@ -465,9 +473,9 @@ Ext2MountVolume (
ZeroSize.QuadPart = 0;
if ( !NT_SUCCESS( Ext2CreateNewFCB(
&PtrVCB->PtrRootDirectoryFCB, // Root FCB
ZeroSize, // AllocationSize,
ZeroSize, // EndOfFile,
PtrRootFileObject, // The Root Dircetory File Object
ZeroSize, // AllocationSize,
ZeroSize, // EndOfFile,
PtrRootFileObject, // The Root Dircetory File Object
PtrVCB,
PtrObjectName ) ) )
{

View file

@ -184,7 +184,7 @@ NTSTATUS NTAPI Ext2PassDownMultiReadWriteIRP(
}
for( i = 0; i < Count; i++ ) {
DbgPrint("PASSING DOWN IRP %d TO TARGET DEVICE\n", i);
// DbgPrint("PASSING DOWN IRP %d TO TARGET DEVICE\n", i);
IoCallDriver( PtrVCB->TargetDeviceObject, PtrIoRuns[ i].PtrAssociatedIrp );
}
@ -194,7 +194,7 @@ NTSTATUS NTAPI Ext2PassDownMultiReadWriteIRP(
// Synchronous IO
// Wait for the IO to complete...
//
DbgPrint("DEADLY WAIT (%d)\n", KeGetCurrentIrql());
DbgPrint("DEADLY WAIT (%d)\n", KeGetCurrentIrql());
KeWaitForSingleObject( PtrSyncEvent,
Executive, KernelMode, FALSE, (PLARGE_INTEGER)NULL );
DbgPrint("DEADLY WAIT DONE\n");

View file

@ -102,9 +102,9 @@ NTSTATUS NTAPI Ext2ReadInode (
NumberOfBytesToRead = sizeof(EXT2_INODE); // LogicalBlockSize;
VolumeByteOffset.QuadPart = PtrVcb->PtrGroupDescriptors[ GroupNo ].InodeTablesBlock
* LogicalBlockSize + Index * sizeof(EXT2_INODE);
* LogicalBlockSize + Index * PtrVcb->InodeSize;
//VolumeByteOffset.QuadPart = PtrVcb->InodeTableBlock[ GroupNo ] * LogicalBlockSize +
// Index * sizeof(EXT2_INODE);
// Index * PtrVcb->InodeSize;
TempOffset.QuadPart = Ext2Align64( VolumeByteOffset.QuadPart, LogicalBlockSize );
if( TempOffset.QuadPart != VolumeByteOffset.QuadPart )
@ -752,7 +752,7 @@ NTSTATUS NTAPI Ext2WriteInode(
NumberOfBytesToRead = sizeof(EXT2_INODE);
VolumeByteOffset.QuadPart = PtrVcb->PtrGroupDescriptors[ GroupNo ].InodeTablesBlock
* LogicalBlockSize + Index * sizeof(EXT2_INODE);
* LogicalBlockSize + Index * PtrVcb->InodeSize;
TempOffset.QuadPart = Ext2Align64( VolumeByteOffset.QuadPart, LogicalBlockSize );
if( TempOffset.QuadPart != VolumeByteOffset.QuadPart )