X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FFilesystems%2FExt2%2Fext2.c;h=ad96cc85c1bbcf628756f99b6cf295b53b582fba;hb=4e949acb1c98bc071af2d5d9038b4a3e703bf33d;hp=aa15e1033dd5fecd796050f3ce51e138cc55f35e;hpb=4f80abddbbc0e7237b0de6f150da4b8b43fbe499;p=tpg%2Facess2.git diff --git a/Modules/Filesystems/Ext2/ext2.c b/Modules/Filesystems/Ext2/ext2.c index aa15e103..ad96cc85 100644 --- a/Modules/Filesystems/Ext2/ext2.c +++ b/Modules/Filesystems/Ext2/ext2.c @@ -15,7 +15,7 @@ // === PROTOTYPES === int Ext2_Install(char **Arguments); // Interface Functions -tVFS_Node *Ext2_InitDevice(char *Device, char **Options); +tVFS_Node *Ext2_InitDevice(const char *Device, const char **Options); void Ext2_Unmount(tVFS_Node *Node); void Ext2_CloseFile(tVFS_Node *Node); // Internal Helpers @@ -44,13 +44,12 @@ int Ext2_Install(char **Arguments) } /** - \fn tVFS_Node *Ext2_InitDevice(char *Device, char **Options) \brief Initializes a device to be read by by the driver \param Device String - Device to read from \param Options NULL Terminated array of option strings \return Root Node */ -tVFS_Node *Ext2_InitDevice(char *Device, char **Options) +tVFS_Node *Ext2_InitDevice(const char *Device, const char **Options) { tExt2_Disk *disk; int fd; @@ -73,7 +72,8 @@ tVFS_Node *Ext2_InitDevice(char *Device, char **Options) // Sanity Check Magic value if(sb.s_magic != 0xEF53) { - Log_Warning("EXT2", "Volume '%s' is not an EXT2 volume", Device); + Log_Warning("EXT2", "Volume '%s' is not an EXT2 volume (0x%x != 0xEF53)", + Device, sb.s_magic); VFS_Close(fd); LEAVE('n'); return NULL; @@ -323,7 +323,7 @@ void Ext2_int_UpdateSuperblock(tExt2_Disk *Disk) #define INT_MAX (((long long int)1<<(sizeof(int)*8))-1) // Powers of 3 - for( i = 3; i < ngrp && i < INT_MAX; i *= 3 ) + for( i = 3; i < ngrp && i < INT_MAX/3; i *= 3 ) VFS_WriteAt(Disk->FD, i*bpg*Disk->BlockSize, 1024, &Disk->SuperBlock); // Powers of 5