Replace rand() implementation - fixes threading lockups
[tpg/acess2.git] / Modules / Filesystems / FAT / fat.c
index e3a681a..5d1c7f5 100644 (file)
@@ -17,7 +17,7 @@
  * \todo Implement changing of the parent directory when a file is written to\r
  * \todo Implement file creation / deletion\r
  */\r
-#define DEBUG  0\r
+#define DEBUG  1\r
 #define VERBOSE        1\r
 \r
 #define CACHE_FAT      0       //!< Caches the FAT in memory\r
@@ -73,10 +73,10 @@ Uint64      FAT_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
 #endif\r
 // --- Directory IO\r
 char   *FAT_ReadDir(tVFS_Node *Node, int ID);\r
-tVFS_Node      *FAT_FindDir(tVFS_Node *Node, char *Name);\r
+tVFS_Node      *FAT_FindDir(tVFS_Node *Node, const char *Name);\r
 #if SUPPORT_WRITE\r
- int   FAT_Mknod(tVFS_Node *Node, char *Name, Uint Flags);\r
- int   FAT_Relink(tVFS_Node *node, char *OldName, char *NewName);\r
+ int   FAT_Mknod(tVFS_Node *Node, const char *Name, Uint Flags);\r
+ int   FAT_Relink(tVFS_Node *node, const char *OldName, const char *NewName);\r
 #endif\r
 void   FAT_CloseFile(tVFS_Node *node);\r
 \r
@@ -393,7 +393,7 @@ Uint32 FAT_int_GetFatValue(tFAT_VolInfo *Disk, Uint32 cluster)
        Uint32  val = 0;\r
        Uint32  ofs;\r
        ENTER("pDisk xCluster", Disk, cluster);\r
-       LOCK( &Disk->lFAT );\r
+       Mutex_Acquire( &Disk->lFAT );\r
        #if CACHE_FAT\r
        if( Disk->ClusterCount <= giFAT_MaxCachedClusters )\r
        {\r
@@ -420,7 +420,7 @@ Uint32 FAT_int_GetFatValue(tFAT_VolInfo *Disk, Uint32 cluster)
        #if CACHE_FAT\r
        }\r
        #endif /*CACHE_FAT*/\r
-       RELEASE( &Disk->lFAT );\r
+       Mutex_Release( &Disk->lFAT );\r
        LEAVE('x', val);\r
        return val;\r
 }\r
@@ -1303,7 +1303,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
  * \fn tVFS_Node *FAT_FindDir(tVFS_Node *node, char *name)\r
  * \brief Finds an entry in the current directory\r
  */\r
-tVFS_Node *FAT_FindDir(tVFS_Node *Node, char *Name)\r
+tVFS_Node *FAT_FindDir(tVFS_Node *Node, const char *Name)\r
 {\r
        fat_filetable   fileinfo[16];\r
        char    tmpName[13];\r

UCC git Repository :: git.ucc.asn.au