Windows: afsredirlib log messages
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSClose.cpp
index 959aad9..a757bb2 100644 (file)
@@ -136,7 +136,7 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                 AFSProcessRequest( AFS_REQUEST_TYPE_PIOCTL_CLOSE,
                                    AFS_REQUEST_FLAG_SYNCHRONOUS,
-                                   &pFcb->AuthGroup,
+                                   &pCcb->AuthGroup,
                                    NULL,
                                    &stParentFileId,
                                    (void *)&stPIOCtlClose,
@@ -150,7 +150,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 // Remove the Ccb and de-allocate it
                 //
 
-                ntStatus = AFSRemoveCcb( pCcb);
+                ntStatus = AFSRemoveCcb( pFcb,
+                                         pCcb);
 
                 if( !NT_SUCCESS( ntStatus))
                 {
@@ -230,7 +231,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 // Remove the Ccb and de-allocate it
                 //
 
-                ntStatus = AFSRemoveCcb( pCcb);
+                ntStatus = AFSRemoveCcb( pFcb,
+                                         pCcb);
 
                 if( !NT_SUCCESS( ntStatus))
                 {
@@ -305,27 +307,6 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 pDirCB = pCcb->DirectoryCB;
 
                 //
-                // Remove the Ccb and de-allocate it
-                //
-
-                ntStatus = AFSRemoveCcb( 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;
-                }
-
-                //
                 // If this entry is deleted then remove the object from the volume tree
                 //
 
@@ -396,10 +377,14 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                         AFSDbgLogMsg( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
                                       AFS_TRACE_LEVEL_VERBOSE,
-                                      "AFSClose Deleting dir entry %08lX (%08lX) for %wZ\n",
+                                      "AFSClose Deleting dir entry %08lX (%08lX) for %wZ  FID %08lX-%08lX-%08lX-%08lX\n",
                                       pDirCB,
                                       pObjectInfo,
-                                      &pDirCB->NameInformation.FileName);
+                                      &pDirCB->NameInformation.FileName,
+                                      pObjectInfo->FileId.Cell,
+                                      pObjectInfo->FileId.Volume,
+                                      pObjectInfo->FileId.Vnode,
+                                      pObjectInfo->FileId.Unique);
 
                         //
                         // Remove and delete the directory entry from the parent list
@@ -482,7 +467,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                     if( pFcb->Specific.File.ExtentsDirtyCount)
                     {
 
-                        AFSFlushExtents( pFcb);
+                        AFSFlushExtents( pFcb,
+                                         &pCcb->AuthGroup);
                     }
 
                     //
@@ -500,7 +486,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                     // Tear 'em down, we'll not be needing them again
                     //
 
-                    if( AFSTearDownFcbExtents( pFcb))
+                    if( AFSTearDownFcbExtents( pFcb,
+                                               &pCcb->AuthGroup))
                     {
 
                         //
@@ -510,7 +497,7 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
 
                         AFSProcessRequest( AFS_REQUEST_TYPE_FLUSH_FILE,
                                            AFS_REQUEST_FLAG_SYNCHRONOUS,
-                                           &pFcb->AuthGroup,
+                                           &pCcb->AuthGroup,
                                            NULL,
                                            &pFcb->ObjectInformation->FileId,
                                            NULL,
@@ -528,7 +515,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                         if( pFcb->Specific.File.ExtentsDirtyCount)
                         {
 
-                            AFSFlushExtents( pFcb);
+                            AFSFlushExtents( pFcb,
+                                             &pCcb->AuthGroup);
                         }
                     }
 
@@ -536,6 +524,28 @@ 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;
+                }
+
+                //
                 // Decrement the reference count on the Fcb. this is protecting it from teardown.
                 //
 
@@ -597,7 +607,8 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject,
                 // Remove the Ccb and de-allocate it
                 //
 
-                ntStatus = AFSRemoveCcb( pCcb);
+                ntStatus = AFSRemoveCcb( pFcb,
+                                         pCcb);
 
                 if( !NT_SUCCESS( ntStatus))
                 {