X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2Finclude%2Fvfs.h;h=f7666137bbdb21db53ed485bcd64423d0f9226b1;hb=6b5fe5c5491e925bb1dd0d0650eeafd363538b1a;hp=d2cdf2049a48fb8028ba83589cf65d1641e335b4;hpb=d31175a3542b5139e11b5835b1a50df0b06954fa;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs.h b/KernelLand/Kernel/include/vfs.h index d2cdf204..f7666137 100644 --- a/KernelLand/Kernel/include/vfs.h +++ b/KernelLand/Kernel/include/vfs.h @@ -496,12 +496,17 @@ extern int VFS_MarkError(tVFS_Node *Node, BOOL IsErrorState); * fast cleanup when a filesystem is unmounted. * \{ */ + +typedef struct sInodeCache tInodeCache; + +typedef void (*tInode_CleanUpNode)(tVFS_Node *Node); + /** * \fn int Inode_GetHandle(void) * \brief Gets a unique handle to the Node Cache * \return A unique handle for use for the rest of the Inode_* functions */ -extern int Inode_GetHandle(void); +extern tInodeCache *Inode_GetHandle(tInode_CleanUpNode CleanUpNode); /** * \fn tVFS_Node *Inode_GetCache(int Handle, Uint64 Inode) * \brief Gets an inode from the node cache @@ -509,7 +514,7 @@ extern int Inode_GetHandle(void); * \param Inode Value of the Inode field of the ::tVFS_Node you want * \return A pointer to the cached node */ -extern tVFS_Node *Inode_GetCache(int Handle, Uint64 Inode); +extern tVFS_Node *Inode_GetCache(tInodeCache *Handle, Uint64 Inode); /** * \fn tVFS_Node *Inode_CacheNode(int Handle, tVFS_Node *Node) * \brief Caches a node in the Node Cache @@ -517,8 +522,8 @@ extern tVFS_Node *Inode_GetCache(int Handle, Uint64 Inode); * \param Node A pointer to the node to be cached (a copy is taken) * \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); +extern tVFS_Node *Inode_CacheNode(tInodeCache *Handle, tVFS_Node *Node); +extern tVFS_Node *Inode_CacheNodeEx(tInodeCache *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 @@ -526,13 +531,13 @@ extern tVFS_Node *Inode_CacheNodeEx(int Handle, tVFS_Node *Node, size_t Size); * \param Inode Value of the Inode field of the ::tVFS_Node you want to remove * \return -1: Error (not present), 0: Not freed, 1: Freed */ -extern int Inode_UncacheNode(int Handle, Uint64 Inode); +extern int Inode_UncacheNode(tInodeCache *Handle, Uint64 Inode); /** * \fn void Inode_ClearCache(int Handle) * \brief Clears the cache for a handle * \param Handle A handle returned by Inode_GetHandle() */ -extern void Inode_ClearCache(int Handle); +extern void Inode_ClearCache(tInodeCache *Handle); /** * \}