From ccd6614c8f92e349e1892fa59f814b615c8816e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 30 Dec 2011 01:10:08 -0500 Subject: [PATCH] Windows: Add AFSFileCleanupResultCB Add AFSFileCleanupResultCB which includes the parent directory data version number. This is necessary because object deletion occurs during the Cleanup processing and the redirector needs to know the resulting data version of the affected directory. Change-Id: Iac07ddaaa3e3373f1690c85d247313e070450169 Reviewed-on: http://gerrit.openafs.org/6453 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/common/AFSUserStructs.h | 8 ++++++++ src/WINNT/afsrdr/user/RDRFunction.c | 14 +++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsrdr/common/AFSUserStructs.h b/src/WINNT/afsrdr/common/AFSUserStructs.h index 24ebd0875..7aa09a8dd 100644 --- a/src/WINNT/afsrdr/common/AFSUserStructs.h +++ b/src/WINNT/afsrdr/common/AFSUserStructs.h @@ -981,6 +981,14 @@ typedef struct _AFS_FILE_CLEANUP_CB } AFSFileCleanupCB; +typedef struct _AFS_FILE_CLEANUP_RESULT_CB +{ + + LARGE_INTEGER ParentDataVersion; + +} AFSFileCleanupResultCB; + + // // Trace configuration cb // diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index c3048021b..02e8084b5 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -1642,7 +1642,8 @@ RDR_CleanupFileEntry( IN cm_user_t *userp, IN DWORD ResultBufferLength, IN OUT AFSCommResult **ResultCB) { - size_t size = sizeof(AFSCommResult); + AFSFileCleanupResultCB *pResultCB = NULL; + size_t size = sizeof(AFSCommResult) + ResultBufferLength - 1; cm_fid_t Fid; cm_fid_t parentFid; afs_uint32 code = 0; @@ -1967,14 +1968,21 @@ RDR_CleanupFileEntry( IN cm_user_t *userp, code = cm_Unlink(dscp, NULL, FileName, userp, &req); } + if ( ResultBufferLength >= sizeof( AFSFileCleanupResultCB)) + { + (*ResultCB)->ResultBufferLength = sizeof( AFSFileCleanupResultCB); + pResultCB = (AFSFileCleanupResultCB *)&(*ResultCB)->ResultData; + pResultCB->ParentDataVersion.QuadPart = dscp ? dscp->dataVersion : 0; + } else { + (*ResultCB)->ResultBufferLength = 0; + } + if (code == 0) { (*ResultCB)->ResultStatus = 0; - (*ResultCB)->ResultBufferLength = 0; osi_Log0(afsd_logp, "RDR_CleanupFileEntry SUCCESS"); } else { smb_MapNTError(cm_MapRPCError(code, &req), &status, TRUE); (*ResultCB)->ResultStatus = status; - (*ResultCB)->ResultBufferLength = 0; osi_Log2(afsd_logp, "RDR_CleanupFileEntry FAILURE code=0x%x status=0x%x", code, status); } -- 2.39.5