Author: dgorbachev
Date: Sun Aug 16 03:20:22 2009
New Revision: 42723
URL:
http://svn.reactos.org/svn/reactos?rev=42723&view=rev
Log:
Take inode size from Ext2 superblock.
Modified:
trunk/reactos/drivers/filesystems/ext2/inc/struct.h
trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c
trunk/reactos/drivers/filesystems/ext2/src/io.c
trunk/reactos/drivers/filesystems/ext2/src/metadata.c
Modified: trunk/reactos/drivers/filesystems/ext2/inc/struct.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/i…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/inc/struct.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/inc/struct.h [iso-8859-1] Sun Aug 16 03:20:22
2009
@@ -452,8 +452,9 @@
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;
Modified: trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/src/fsctrl.c [iso-8859-1] Sun Aug 16 03:20:22
2009
@@ -368,6 +368,14 @@
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 @@
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 ) ) )
{
Modified: trunk/reactos/drivers/filesystems/ext2/src/io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/src/io.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/src/io.c [iso-8859-1] Sun Aug 16 03:20:22 2009
@@ -184,7 +184,7 @@
}
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 @@
// 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");
Modified: trunk/reactos/drivers/filesystems/ext2/src/metadata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/src/metadata.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/src/metadata.c [iso-8859-1] Sun Aug 16 03:20:22
2009
@@ -102,9 +102,9 @@
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 @@
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 )