}\r
\r
/**\r
- \fn tVFS_Node *Ext2_initDevice(char *Device, char **Options)\r
+ \fn tVFS_Node *Ext2_InitDevice(char *Device, char **Options)\r
\brief Initializes a device to be read by by the driver\r
\param Device String - Device to read from\r
\param Options NULL Terminated array of option strings\r
// Open Disk\r
fd = VFS_Open(Device, VFS_OPENFLAG_READ|VFS_OPENFLAG_WRITE); //Open Device\r
if(fd == -1) {\r
- Warning("[EXT2 ] Unable to open '%s'\n", Device);\r
+ Warning("[EXT2 ] Unable to open '%s'", Device);\r
LEAVE('n');\r
return NULL;\r
}\r
\r
// Sanity Check Magic value\r
if(sb.s_magic != 0xEF53) {\r
- Warning("[EXT2 ] Volume '%s' is not an EXT2 volume\n", Device);\r
+ Warning("[EXT2 ] Volume '%s' is not an EXT2 volume", Device);\r
VFS_Close(fd);\r
LEAVE('n');\r
return NULL;\r
// Allocate Disk Information\r
disk = malloc(sizeof(tExt2_Disk) + sizeof(tExt2_Group)*groupCount);\r
if(!disk) {\r
- Warning("[EXT2 ] Unable to allocate disk structure\n");\r
+ Warning("[EXT2 ] Unable to allocate disk structure");\r
VFS_Close(fd);\r
LEAVE('n');\r
return NULL;\r
Offset = Offset / disk->BlockSize;\r
base = Ext2_int_GetBlockAddr(disk, inode.i_block, block);\r
if(base == 0) {\r
- Warning("[EXT2 ] NULL Block Detected in INode 0x%llx\n", Node->Inode);\r
+ Warning("[EXT2 ] NULL Block Detected in INode 0x%llx", Node->Inode);\r
LEAVE('i', 0);\r
return 0;\r
}\r
{\r
base = Ext2_int_GetBlockAddr(disk, inode.i_block, block);\r
if(base == 0) {\r
- Warning("[EXT2 ] NULL Block Detected in INode 0x%llx\n", Node->Inode);\r
+ Warning("[EXT2 ] NULL Block Detected in INode 0x%llx", Node->Inode);\r
LEAVE('i', 0);\r
return 0;\r
}\r
}\r
\r
/**\r
- * \fn void Ext2_CloseFile(vfs_node *Node)\r
+ * \fn void Ext2_CloseFile(tVFS_Node *Node)\r
* \brief Close a file (Remove it from the cache)\r
*/\r
void Ext2_CloseFile(tVFS_Node *Node)\r
Ext2_int_GetInode(Node, &inode);\r
size = inode.i_size;\r
\r
- LOG("inode.i_block[0] = 0x%x\n", inode.i_block[0]);\r
+ LOG("inode.i_block[0] = 0x%x", inode.i_block[0]);\r
\r
// Find Entry\r
// Get First Block\r
if(ofs >= disk->BlockSize) {\r
block ++;\r
if( ofs > disk->BlockSize ) {\r
- Warning("[EXT2] Directory Entry %i of inode %i extends over a block boundary, ignoring\n",\r
+ Warning("[EXT2] Directory Entry %i of inode %i extends over a block boundary, ignoring",\r
entNum-1, Node->Inode);\r
}\r
ofs = 0;\r
}\r
}\r
\r
- if(size <= 0) return NULL;\r
+ // Check for the end of the list\r
+ if(size <= 0) {\r
+ LEAVE('n');\r
+ return NULL;\r
+ }\r
\r
// Read Entry\r
VFS_ReadAt( disk->FD, Base+ofs, sizeof(tExt2_DirEnt), &dirent );\r
- //LOG("dirent.inode = %i\n", dirent.inode);\r
- //LOG("dirent.rec_len = %i\n", dirent.rec_len);\r
- //LOG("dirent.name_len = %i\n", dirent.name_len);\r
+ //LOG("dirent.inode = %i", dirent.inode);\r
+ //LOG("dirent.rec_len = %i", dirent.rec_len);\r
+ //LOG("dirent.name_len = %i", dirent.name_len);\r
VFS_ReadAt( disk->FD, Base+ofs+sizeof(tExt2_DirEnt), dirent.name_len, namebuf );\r
namebuf[ dirent.name_len ] = '\0'; // Cap off string\r
\r
if(ofs >= disk->BlockSize) {\r
block ++;\r
if( ofs > disk->BlockSize ) {\r
- Warning("[EXT2 ] Directory Entry %i of inode %i extends over a block boundary, ignoring\n",\r
+ Warning("[EXT2 ] Directory Entry %i of inode %i extends over a block boundary, ignoring",\r
entNum-1, Node->Inode);\r
}\r
ofs = 0;\r
\r
\r
/**\r
- \fn int Ext2_int_GetInode(vfs_node *Node, tExt2_Inode *Inode)\r
- \brief Gets the inode descriptor for a node\r
- \param node node to get the Inode of\r
- \param inode Destination\r
-*/\r
+ * \fn int Ext2_int_GetInode(tVFS_Node *Node, tExt2_Inode *Inode)\r
+ * \brief Gets the inode descriptor for a node\r
+ * \param Node node to get the Inode of\r
+ * \param Inode Destination\r
+ */\r
int Ext2_int_GetInode(tVFS_Node *Node, tExt2_Inode *Inode)\r
{\r
return Ext2_int_ReadInode(Node->ImplPtr, Node->Inode, Inode);\r
{\r
int group, subId;\r
\r
- //LogF("Ext2_int_ReadInode: (Disk=%p, InodeId=%i, Inode=%p)\n", Disk, InodeId, Inode);\r
+ //LogF("Ext2_int_ReadInode: (Disk=%p, InodeId=%i, Inode=%p)", Disk, InodeId, Inode);\r
+ //ENTER("pDisk iInodeId pInode", Disk, InodeId, Inode);\r
\r
if(InodeId == 0) return 0;\r
\r
group = InodeId / Disk->SuperBlock.s_inodes_per_group;\r
subId = InodeId % Disk->SuperBlock.s_inodes_per_group;\r
\r
- //LogF(" Ext2_int_ReadInode: group=%i, subId = %i\n", group, subId);\r
+ //LOG("group=%i, subId = %i", group, subId);\r
\r
// Read Inode\r
VFS_ReadAt(Disk->FD,\r