From: Jeffrey Altman Date: Sat, 17 Dec 2011 17:14:28 +0000 (-0500) Subject: Windows: Tear down extents upon file deletion X-Git-Tag: upstream/1.8.0_pre1^2~2924 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=714ae7f1840757e0575d25c910b0b9fa2499e354;p=packages%2Fo%2Fopenafs.git Windows: Tear down extents upon file deletion 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp index 7462d5880..70af5727f 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp @@ -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; }