From: Jeffrey Altman Date: Thu, 27 Dec 2012 19:41:29 +0000 (-0500) Subject: Windows: AFSRemoveCcb cannot fail X-Git-Tag: upstream/1.8.0_pre1^2~1638 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=207890788079c82d81a1a7f2a0972ed165583798;p=packages%2Fo%2Fopenafs.git Windows: AFSRemoveCcb cannot fail Since AFSRemoveCcb cannot fail, change the signature from returning NTSTATUS to void. Remove all error handling code. Change-Id: Ifa893a714f97cefb9bd122ab84508e5d36987e88 Reviewed-on: http://gerrit.openafs.org/8851 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp b/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp index 9c347f555..2c19d7d8d 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp @@ -150,22 +150,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject, // Remove the Ccb and de-allocate it // - ntStatus = AFSRemoveCcb( pFcb, - pCcb); - - if( !NT_SUCCESS( ntStatus)) - { - - AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, - AFS_TRACE_LEVEL_WARNING, - "AFSClose Failed to remove Ccb from Fcb Status %08lX\n", ntStatus); - - // - // We can't actually fail a close operation so reset the status - // - - ntStatus = STATUS_SUCCESS; - } + AFSRemoveCcb( pFcb, + pCcb); lCount = InterlockedDecrement( &pDirCB->DirOpenReferenceCount); @@ -231,22 +217,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject, // Remove the Ccb and de-allocate it // - ntStatus = AFSRemoveCcb( pFcb, - pCcb); - - if( !NT_SUCCESS( ntStatus)) - { - - AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, - AFS_TRACE_LEVEL_WARNING, - "AFSClose Failed to remove Ccb from Fcb Status %08lX\n", ntStatus); - - // - // We can't actually fail a close operation so reset the status - // - - ntStatus = STATUS_SUCCESS; - } + AFSRemoveCcb( pFcb, + pCcb); lCount = InterlockedDecrement( &pDirCB->DirOpenReferenceCount); @@ -363,23 +335,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject, // Remove the Ccb and de-allocate it // - ntStatus = AFSRemoveCcb( pFcb, - pCcb); - - if( !NT_SUCCESS( ntStatus)) - { - - AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, - AFS_TRACE_LEVEL_WARNING, - "AFSClose Failed to remove Ccb from Fcb Status %08lX\n", - ntStatus); - - // - // We can't actually fail a close operation so reset the status - // - - ntStatus = STATUS_SUCCESS; - } + AFSRemoveCcb( pFcb, + pCcb); // // If this entry is deleted then remove the object from the volume tree @@ -583,22 +540,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject, // Remove the Ccb and de-allocate it // - ntStatus = AFSRemoveCcb( pFcb, - pCcb); - - if( !NT_SUCCESS( ntStatus)) - { - - AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, - AFS_TRACE_LEVEL_WARNING, - "AFSClose Failed to remove Ccb from Fcb Status %08lX\n", ntStatus); - - // - // We can't actually fail a close operation so reset the status - // - - ntStatus = STATUS_SUCCESS; - } + AFSRemoveCcb( pFcb, + pCcb); lCount = InterlockedDecrement( &pDirCB->DirOpenReferenceCount); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp index f863d4c7d..25dc99332 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp @@ -1230,16 +1230,14 @@ try_exit: // // Return: // -// A status is returned for the function +// None // -NTSTATUS +void AFSRemoveCcb( IN AFSFcb *Fcb, IN AFSCcb *Ccb) { - NTSTATUS ntStatus = STATUS_SUCCESS; - AFSAcquireExcl( &Ccb->NPCcb->CcbLock, TRUE); @@ -1332,8 +1330,6 @@ AFSRemoveCcb( IN AFSFcb *Fcb, AFSExFreePoolWithTag( Ccb->NPCcb, AFS_CCB_NP_ALLOCATION_TAG); AFSExFreePoolWithTag( Ccb, AFS_CCB_ALLOCATION_TAG); - - return ntStatus; } NTSTATUS diff --git a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h index f6320d6d2..ee25a3c66 100644 --- a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h +++ b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h @@ -545,7 +545,7 @@ AFSInitCcb( IN OUT AFSCcb **Ccb); void AFSRemoveFcb( IN AFSFcb **Fcb); -NTSTATUS +void AFSRemoveCcb( IN AFSFcb *Fcb, IN AFSCcb *Ccb);