From 207890788079c82d81a1a7f2a0972ed165583798 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 27 Dec 2012 14:41:29 -0500 Subject: [PATCH] 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 --- src/WINNT/afsrdr/kernel/lib/AFSClose.cpp | 73 ++----------------- src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp | 8 +- .../afsrdr/kernel/lib/Include/AFSCommon.h | 2 +- 3 files changed, 11 insertions(+), 72 deletions(-) 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); -- 2.39.5