git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/FAT - Implimentation of FAT_Link, validity unknown but it compiles
[tpg/acess2.git]
/
KernelLand
/
Modules
/
Filesystems
/
FAT
/
nodecache.c
diff --git
a/KernelLand/Modules/Filesystems/FAT/nodecache.c
b/KernelLand/Modules/Filesystems/FAT/nodecache.c
index
e181e98
..
c862dca
100644
(file)
--- a/
KernelLand/Modules/Filesystems/FAT/nodecache.c
+++ b/
KernelLand/Modules/Filesystems/FAT/nodecache.c
@@
-155,13
+155,14
@@
tVFS_Node *FAT_int_CacheNode(tFAT_VolInfo *Disk, const tVFS_Node *Node)
return &cnode->Node;
}
return &cnode->Node;
}
-
void
FAT_int_DerefNode(tVFS_Node *Node)
+
int
FAT_int_DerefNode(tVFS_Node *Node)
{
tFAT_VolInfo *Disk = Node->ImplPtr;
tFAT_CachedNode *cnode, *prev = NULL;
{
tFAT_VolInfo *Disk = Node->ImplPtr;
tFAT_CachedNode *cnode, *prev = NULL;
+ int bFreed = 0;
if( Node == &Disk->rootNode )
if( Node == &Disk->rootNode )
- return
;
+ return
0;
Mutex_Acquire(&Disk->lNodeCache);
Node->ReferenceCount --;
Mutex_Acquire(&Disk->lNodeCache);
Node->ReferenceCount --;
@@
-175,15
+176,19
@@
void FAT_int_DerefNode(tVFS_Node *Node)
break;
}
}
break;
}
}
+ if(Node->ReferenceCount == 0 && cnode) {
+ // Already out of the list :)
+ free(cnode->Node.Data);
+ free(cnode);
+ bFreed = 1;
+ }
Mutex_Release(&Disk->lNodeCache);
if( !cnode ) {
// Not here?
Mutex_Release(&Disk->lNodeCache);
if( !cnode ) {
// Not here?
- return ;
+ return
-1
;
}
}
- // Already out of the list :)
- free(cnode->Node.Data);
- free(cnode);
+ return bFreed;
}
void FAT_int_ClearNodeCache(tFAT_VolInfo *Disk)
}
void FAT_int_ClearNodeCache(tFAT_VolInfo *Disk)
UCC
git Repository :: git.ucc.asn.au