Changeset 39798 in vbox for trunk/src/VBox
- Timestamp:
- Jan 18, 2012 4:55:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r39612 r39798 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 87 87 /** Disk this image is part of */ 88 88 PVBOXHDD pDisk; 89 /** Flag whether to ignore flush requests. */ 90 bool fIgnoreFlush; 89 91 } VDIO, *PVDIO; 90 92 … … 3944 3946 static int vdIOIntFlushSync(void *pvUser, PVDIOSTORAGE pIoStorage) 3945 3947 { 3948 int rc = VINF_SUCCESS; 3946 3949 PVDIO pVDIo = (PVDIO)pvUser; 3947 return pVDIo->pInterfaceIo->pfnFlushSync(pVDIo->pInterfaceIo->Core.pvUser, 3948 pIoStorage->pStorage); 3950 3951 if (!pVDIo->fIgnoreFlush) 3952 rc = pVDIo->pInterfaceIo->pfnFlushSync(pVDIo->pInterfaceIo->Core.pvUser, 3953 pIoStorage->pStorage); 3954 3955 return rc; 3949 3956 } 3950 3957 … … 4323 4330 LogFlowFunc(("pvUser=%#p pIoStorage=%#p pIoCtx=%#p\n", 4324 4331 pvUser, pIoStorage, pIoCtx)); 4332 4333 if (pVDIo->fIgnoreFlush) 4334 return VINF_SUCCESS; 4325 4335 4326 4336 /* Allocate a new meta transfer. */ … … 5221 5231 AssertRC(rc); 5222 5232 5223 pImage->uOpenFlags = uOpenFlags & (VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_DISCARD );5233 pImage->uOpenFlags = uOpenFlags & (VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_DISCARD | VD_OPEN_FLAGS_IGNORE_FLUSH); 5224 5234 rc = pImage->Backend->pfnOpen(pImage->pszFilename, 5225 uOpenFlags & ~ VD_OPEN_FLAGS_HONOR_SAME,5235 uOpenFlags & ~(VD_OPEN_FLAGS_HONOR_SAME | VD_OPEN_FLAGS_IGNORE_FLUSH), 5226 5236 pDisk->pVDIfsDisk, 5227 5237 pImage->pVDIfsImage, … … 5258 5268 5259 5269 pImage->VDIo.pBackendData = pImage->pBackendData; 5270 pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0; 5260 5271 5261 5272 /* Check image type. As the image itself has only partial knowledge … … 5749 5760 { 5750 5761 pImage->VDIo.pBackendData = pImage->pBackendData; 5762 pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0; 5751 5763 pImage->uImageFlags = uImageFlags; 5752 5764 … … 6025 6037 { 6026 6038 pImage->VDIo.pBackendData = pImage->pBackendData; 6039 pImage->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0; 6027 6040 pImage->uImageFlags = uImageFlags; 6028 6041 … … 6276 6289 6277 6290 pCache->VDIo.pBackendData = pCache->pBackendData; 6291 pCache->VDIo.fIgnoreFlush = (uOpenFlags & VD_OPEN_FLAGS_IGNORE_FLUSH) != 0; 6278 6292 6279 6293 /* Re-check state, as the lock wasn't held and another image
Note:
See TracChangeset
for help on using the changeset viewer.