Windows: AFSRemoveCcb cannot fail
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 27 Dec 2012 19:41:29 +0000 (14:41 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 31 Jan 2013 19:17:37 +0000 (11:17 -0800)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSClose.cpp
src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h

index 9c347f5..2c19d7d 100644 (file)
@@ -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);
 
index f863d4c..25dc993 100644 (file)
@@ -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
index f6320d6..ee25a3c 100644 (file)
@@ -545,7 +545,7 @@ AFSInitCcb( IN OUT AFSCcb **Ccb);
 void
 AFSRemoveFcb( IN AFSFcb **Fcb);
 
-NTSTATUS
+void
 AFSRemoveCcb( IN AFSFcb *Fcb,
               IN AFSCcb *Ccb);