X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2Finclude%2Fvfs_int.h;h=c2dacd349771c5e6028c6e92caf42e644636a6f5;hb=HEAD;hp=06ad8dabf836cbe23cd701c386782f6a192429b8;hpb=fe07801ccb8de442c9fc665cd1706faa0f12c166;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_int.h b/KernelLand/Kernel/include/vfs_int.h index 06ad8dab..c2dacd34 100644 --- a/KernelLand/Kernel/include/vfs_int.h +++ b/KernelLand/Kernel/include/vfs_int.h @@ -73,6 +73,18 @@ static inline void _CloseNode(tVFS_Node *Node) if(Node && Node->Type && Node->Type->Close) Node->Type->Close( Node ); } +static inline void _ReferenceNode(tVFS_Node *Node) +{ + if( !MM_GetPhysAddr(Node->Type) ) { + Log_Error("VFS", "Node %p's type is invalid (%p bad pointer) - %P corrupted", + Node, Node->Type, MM_GetPhysAddr(&Node->Type)); + return ; + } + if( Node->Type && Node->Type->Reference ) + Node->Type->Reference( Node ); + else + Node->ReferenceCount ++; +} #endif