* \return A pointer to the node in the node cache
*/
extern tVFS_Node *Inode_CacheNode(int Handle, tVFS_Node *Node);
+extern tVFS_Node *Inode_CacheNodeEx(int Handle, tVFS_Node *Node, size_t Size);
/**
* \fn int Inode_UncacheNode(int Handle, Uint64 Inode)
* \brief Dereferences (and removes if needed) a node from the cache
* \fn tVFS_Node *Inode_CacheNode(int Handle, tVFS_Node *Node)
*/
tVFS_Node *Inode_CacheNode(int Handle, tVFS_Node *Node)
+{
+ return Inode_CacheNodeEx(Handle, Node, sizeof(*Node));
+}
+
+tVFS_Node *Inode_CacheNodeEx(int Handle, tVFS_Node *Node, size_t Size)
{
tInodeCache *cache;
tCachedInode *newEnt, *ent, *prev = NULL;
-
+
+ ASSERT(Size >= sizeof(tVFS_Node));
+
cache = Inode_int_GetFSCache(Handle);
if(!cache) return NULL;
}
// Create new entity
- newEnt = malloc(sizeof(tCachedInode));
+ newEnt = malloc(sizeof(tCachedInode) + (Size - sizeof(tVFS_Node)));
newEnt->Next = ent;
- memcpy(&newEnt->Node, Node, sizeof(tVFS_Node));
+ memcpy(&newEnt->Node, Node, Size);
if( prev )
prev->Next = newEnt;
else