Windows: Tear down extents upon file deletion
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 17 Dec 2011 17:14:28 +0000 (12:14 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 18 Dec 2011 14:52:50 +0000 (06:52 -0800)
When processing AFS_INVALIDATE_REMOVED, tear down all extents
since they are no longer necessary and return them to the service
for recycling.

Change-Id: Iec6c0d2c68db16dbf3bd04c51536e13d45f0c1b8
Reviewed-on: http://gerrit.openafs.org/6365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index 7462d58..70af572 100644 (file)
@@ -1814,6 +1814,20 @@ AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB)
                                                 ulFilter,
                                                 FILE_ACTION_REMOVED);
 
+                if( pObjectInfo->FileType == AFS_FILE_TYPE_FILE &&
+                    pObjectInfo->Fcb != NULL)
+                {
+
+
+                    //
+                    // Clear out the extents
+                    // And get rid of them (note this involves waiting
+                    // for any writes or reads to the cache to complete)
+                    //
+
+                    (VOID) AFSTearDownFcbExtents( pObjectInfo->Fcb);
+                }
+
                 break;
             }