X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fhandle.c;h=8cae80400a919ef365b2579e71050e37468854d2;hb=e91669b7a466b5c95cd6bc7b8b0c94e1a693f207;hp=d22f96562df5e5a08c28f373e59780e0d0f829c1;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/handle.c b/KernelLand/Kernel/vfs/handle.c index d22f9656..8cae8040 100644 --- a/KernelLand/Kernel/vfs/handle.c +++ b/KernelLand/Kernel/vfs/handle.c @@ -60,7 +60,7 @@ int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode) { int max_handles = *Threads_GetMaxFD(); // Allocate Buffer - if( MM_GetPhysAddr( (tVAddr)gaUserHandles ) == 0 ) + if( MM_GetPhysAddr( gaUserHandles ) == 0 ) { Uint addr, size; size = max_handles * sizeof(tVFS_Handle); @@ -87,7 +87,7 @@ int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode) else { // Allocate space if not already - if( MM_GetPhysAddr( (tVAddr)gaKernelHandles ) == 0 ) + if( MM_GetPhysAddr( gaKernelHandles ) == 0 ) { Uint addr, size; size = MAX_KERNEL_FILES * sizeof(tVFS_Handle); @@ -121,7 +121,7 @@ void VFS_ReferenceUserHandles(void) int max_handles = *Threads_GetMaxFD(); // Check if this process has any handles - if( MM_GetPhysAddr( (tVAddr)gaUserHandles ) == 0 ) + if( MM_GetPhysAddr( gaUserHandles ) == 0 ) return ; for( i = 0; i < max_handles; i ++ ) @@ -141,7 +141,7 @@ void VFS_CloseAllUserHandles(void) int max_handles = *Threads_GetMaxFD(); // Check if this process has any handles - if( MM_GetPhysAddr( (tVAddr)gaUserHandles ) == 0 ) + if( MM_GetPhysAddr( gaUserHandles ) == 0 ) return ; for( i = 0; i < max_handles; i ++ ) @@ -165,7 +165,7 @@ void *VFS_SaveHandles(int NumFDs, int *FDs) int max_handles = *Threads_GetMaxFD(); // Check if this process has any handles - if( MM_GetPhysAddr( (tVAddr)gaUserHandles ) == 0 ) + if( MM_GetPhysAddr( gaUserHandles ) == 0 ) return NULL; // Allocate @@ -198,6 +198,7 @@ void *VFS_SaveHandles(int NumFDs, int *FDs) continue ; if( h->Node->Type && h->Node->Type->Reference ) h->Node->Type->Reference( h->Node ); + h->Mount->OpenHandleCount ++; } return ret; @@ -213,7 +214,7 @@ void VFS_RestoreHandles(int NumFDs, void *Handles) return ; // Check if there is already a set of handles - if( MM_GetPhysAddr( (tVAddr)gaUserHandles ) != 0 ) + if( MM_GetPhysAddr( gaUserHandles ) != 0 ) return ; @@ -244,6 +245,7 @@ void VFS_RestoreHandles(int NumFDs, void *Handles) continue ; if( h->Node->Type && h->Node->Type->Reference ) h->Node->Type->Reference( h->Node ); + h->Mount->OpenHandleCount ++; } } @@ -265,6 +267,7 @@ void VFS_FreeSavedHandles(int NumFDs, void *Handles) continue ; if( h->Node->Type && h->Node->Type->Close ) h->Node->Type->Close( h->Node ); + h->Mount->OpenHandleCount --; } free( Handles ); }