Changeset 41549 in vbox for trunk/src/VBox/Runtime/common/filesystem
- Timestamp:
- Jun 1, 2012 5:29:05 PM (13 years ago)
- Location:
- trunk/src/VBox/Runtime/common/filesystem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/filesystem/filesystem.cpp
r40038 r41549 41 41 42 42 /******************************************************************************* 43 * Structures and Typedefs *44 *******************************************************************************/45 46 /**47 * Medium descriptor.48 */49 typedef struct RTFILESYSTEMMEDIUMINT50 {51 /** Size of the medium in bytes. */52 uint64_t cbMedium;53 /** Sector size. */54 uint64_t cbSector;55 /** Read callback */56 PFNRTFILESYSTEMREAD pfnRead;57 /** Write callback. */58 PFNRTFILESYSTEMWRITE pfnWrite;59 /** Opaque user data. */60 void *pvUser;61 } RTFILESYSTEMMEDIUMINT;62 /** Pointer to a disk descriptor. */63 typedef RTFILESYSTEMMEDIUMINT *PRTFILESYSTEMMEDIUMINT;64 /** Pointer to a const descriptor. */65 typedef const RTFILESYSTEMMEDIUMINT *PCRTFILESYSTEMMEDIUMINT;66 67 /**68 * The internal filesystem object structure.69 */70 typedef struct RTFILESYSTEMINT71 {72 /** The filesytem object magic (RTFILESYSTEM_MAGIC). */73 uint32_t u32Magic;74 /** Medium descriptor. */75 RTFILESYSTEMMEDIUMINT Medium;76 /** Filesystem format operations */77 PCRTFILESYSTEMFMTOPS pcFsFmtOps;78 /** Filesystem format handle. */79 RTFILESYSTEMFMT hFsFmt;80 /** Reference counter. */81 uint32_t volatile cRefs;82 } RTFILESYSTEMINT;83 /** Pointer to an internal volume manager. */84 typedef RTFILESYSTEMINT *PRTFILESYSTEMINT;85 86 /*******************************************************************************87 43 * Global variables * 88 44 *******************************************************************************/ 89 extern RTFILESYSTEMFMTOPS g_rtFilesystemFmtExt;90 45 91 46 /** 92 47 * Supported volume formats. 93 48 */ 94 static PCRTFILESYSTEM FMTOPS g_aFilesystemFmts[] =49 static PCRTFILESYSTEMDESC g_aFsFmts[] = 95 50 { 96 &g_rtF ilesystemFmtExt51 &g_rtFsExt 97 52 }; 98 53 99 DECLHIDDEN(uint64_t) rtFilesystemMediumGetSize(RTFILESYSTEMMEDIUM hMedium) 100 { 101 PRTFILESYSTEMMEDIUMINT pMedInt = hMedium; 102 AssertPtrReturn(pMedInt, 0); 103 104 return pMedInt->cbMedium; 105 } 106 107 DECLHIDDEN(int) rtFilesystemMediumRead(RTFILESYSTEMMEDIUM hMedium, uint64_t off, 108 void *pvBuf, size_t cbRead) 109 { 110 PRTFILESYSTEMMEDIUMINT pMedInt = hMedium; 111 AssertPtrReturn(pMedInt, VERR_INVALID_HANDLE); 112 113 return pMedInt->pfnRead(pMedInt->pvUser, off, pvBuf, cbRead); 114 } 115 116 DECLHIDDEN(int) rtFilesystemMediumWrite(RTFILESYSTEMMEDIUM hMedium, uint64_t off, 117 const void *pvBuf, size_t cbWrite) 118 { 119 PRTFILESYSTEMMEDIUMINT pMedInt = hMedium; 120 AssertPtrReturn(pMedInt, VERR_INVALID_HANDLE); 121 122 return pMedInt->pfnWrite(pMedInt->pvUser, off, pvBuf, cbWrite); 123 } 124 125 RTDECL(uint32_t) RTFilesystemRetain(RTFILESYSTEM hFs) 126 { 127 PRTFILESYSTEMINT pThis = hFs; 128 AssertPtrReturn(pThis, UINT32_MAX); 129 AssertReturn(pThis->u32Magic == RTFILESYSTEM_MAGIC, UINT32_MAX); 130 131 uint32_t cRefs = ASMAtomicIncU32(&pThis->cRefs); 132 AssertMsg(cRefs > 1 && cRefs < _1M, ("%#x %p\n", cRefs, pThis)); 133 return cRefs; 134 } 135 136 /** 137 * Destroys a volume manager handle. 138 * 139 * @param pThis The filesystem object to destroy. 140 */ 141 static void rtFilesystemDestroy(PRTFILESYSTEMINT pThis) 142 { 143 if (pThis->hFsFmt != NIL_RTFILESYSTEMFMT) 144 { 145 AssertPtr(pThis->pcFsFmtOps); 146 147 /* Let the backend do it's own cleanup first. */ 148 pThis->pcFsFmtOps->pfnClose(pThis->hFsFmt); 149 pThis->hFsFmt = NIL_RTFILESYSTEMFMT; 150 } 151 152 pThis->Medium.cbMedium = 0; 153 pThis->Medium.pvUser = NULL; 154 pThis->Medium.pfnRead = NULL; 155 pThis->Medium.pfnWrite = NULL; 156 pThis->u32Magic = RTFILESYSTEM_MAGIC_DEAD; 157 RTMemFree(pThis); 158 } 159 160 RTDECL(uint32_t) RTFilesystemRelease(RTFILESYSTEM hFs) 161 { 162 PRTFILESYSTEMINT pThis = hFs; 163 if (pThis == NIL_RTFILESYSTEM) 164 return 0; 165 AssertPtrReturn(pThis, UINT32_MAX); 166 AssertReturn(pThis->u32Magic == RTFILESYSTEM_MAGIC, UINT32_MAX); 167 168 uint32_t cRefs = ASMAtomicDecU32(&pThis->cRefs); 169 AssertMsg(cRefs < _1M, ("%#x %p\n", cRefs, pThis)); 170 if (cRefs == 0) 171 rtFilesystemDestroy(pThis); 172 return cRefs; 173 } 174 175 RTDECL(int) RTFilesystemOpen(PRTFILESYSTEM phFs, PFNRTFILESYSTEMREAD pfnRead, 176 PFNRTFILESYSTEMWRITE pfnWrite, uint64_t cbMedium, 177 uint64_t cbSector, void *pvUser, uint32_t fFlags) 54 static int rtFsGetFormat(RTVFSFILE hVfsFile, PCRTFILESYSTEMDESC *ppFsDesc) 178 55 { 179 56 int rc = VINF_SUCCESS; 180 57 uint32_t uScoreMax = RTFILESYSTEM_MATCH_SCORE_UNSUPPORTED; 181 PCRTFILESYSTEMFMTOPS pcFsFmtOpsMatch = NULL; 182 PRTFILESYSTEMINT pThis = NULL; 183 AssertPtrReturn(phFs, VERR_INVALID_POINTER); 184 AssertPtrReturn(pfnRead, VERR_INVALID_POINTER); 58 PCRTFILESYSTEMDESC pFsFmtMatch = NULL; 185 59 186 pThis = (PRTFILESYSTEMINT)RTMemAllocZ(sizeof(RTFILESYSTEMINT)); 187 if (!pThis) 188 return VERR_NO_MEMORY; 189 190 pThis->u32Magic = RTFILESYSTEM_MAGIC; 191 pThis->Medium.cbMedium = cbMedium; 192 pThis->Medium.cbSector = cbSector; 193 pThis->Medium.pfnRead = pfnRead; 194 pThis->Medium.pfnWrite = pfnWrite; 195 pThis->Medium.pvUser = pvUser; 196 pThis->cRefs = 1; 197 198 for (unsigned i = 0; i < RT_ELEMENTS(g_aFilesystemFmts); i++) 60 for (unsigned i = 0; i < RT_ELEMENTS(g_aFsFmts); i++) 199 61 { 200 62 uint32_t uScore; 201 PCRTFILESYSTEM FMTOPS pcFsFmtOps = g_aFilesystemFmts[i];63 PCRTFILESYSTEMDESC pFsFmt = g_aFsFmts[i]; 202 64 203 rc = p cFsFmtOps->pfnProbe(&pThis->Medium, &uScore);65 rc = pFsFmt->pfnProbe(hVfsFile, &uScore); 204 66 if ( RT_SUCCESS(rc) 205 67 && uScore > uScoreMax) 206 68 { 207 p cFsFmtOpsMatch = pcFsFmtOps;208 uScoreMax 69 pFsFmtMatch = pFsFmt; 70 uScoreMax = uScore; 209 71 } 210 72 else if (RT_FAILURE(rc)) … … 216 78 if (uScoreMax > RTFILESYSTEM_MATCH_SCORE_UNSUPPORTED) 217 79 { 218 AssertPtr(pcFsFmtOpsMatch); 219 220 /* Open the format. */ 221 rc = pcFsFmtOpsMatch->pfnOpen(&pThis->Medium, &pThis->hFsFmt); 222 if (RT_SUCCESS(rc)) 223 pThis->pcFsFmtOps = pcFsFmtOpsMatch; 80 AssertPtr(pFsFmtMatch); 81 *ppFsDesc = pFsFmtMatch; 224 82 } 225 83 else … … 227 85 } 228 86 87 return rc; 88 } 89 90 RTDECL(int) RTFilesystemVfsFromFile(RTVFSFILE hVfsFile, PRTVFS phVfs) 91 { 92 int rc = VINF_SUCCESS; 93 PCRTFILESYSTEMDESC pFsDesc = NULL; 94 RTVFS hVfs = NIL_RTVFS; 95 void *pvThis = NULL; 96 97 AssertPtrReturn(hVfsFile, VERR_INVALID_HANDLE); 98 AssertPtrReturn(phVfs, VERR_INVALID_POINTER); 99 100 rc = rtFsGetFormat(hVfsFile, &pFsDesc); 229 101 if (RT_SUCCESS(rc)) 230 *phFs = pThis; 231 else 232 RTMemFree(pThis); 102 { 103 rc = RTVfsNew(&pFsDesc->VfsOps, pFsDesc->cbFs, NIL_RTVFS, NIL_RTVFSLOCK, 104 &hVfs, &pvThis); 105 if (RT_SUCCESS(rc)) 106 { 107 rc = pFsDesc->pfnInit(pvThis, hVfsFile); 108 if (RT_SUCCESS(rc)) 109 *phVfs = hVfs; 110 else 111 RTVfsRelease(hVfs); 112 } 113 } 233 114 234 115 return rc; 235 116 } 236 117 237 RTDECL(const char *) RTFilesystemGetFormat(RTFILESYSTEM hFs)238 {239 PRTFILESYSTEMINT pThis = hFs;240 AssertPtrReturn(pThis, NULL);241 AssertReturn(pThis->u32Magic == RTFILESYSTEM_MAGIC, NULL);242 118 243 return pThis->pcFsFmtOps->pcszFmt;244 }245 246 RTDECL(uint64_t) RTFilesystemGetBlockSize(RTFILESYSTEM hFs)247 {248 PRTFILESYSTEMINT pThis = hFs;249 AssertPtrReturn(pThis, 0);250 AssertReturn(pThis->u32Magic == RTFILESYSTEM_MAGIC, 0);251 252 return pThis->pcFsFmtOps->pfnGetBlockSize(pThis->hFsFmt);253 }254 255 RTDECL(int) RTFilesystemQueryRangeUse(RTFILESYSTEM hFs, uint64_t offStart, size_t cb,256 bool *pfUsed)257 {258 PRTFILESYSTEMINT pThis = hFs;259 AssertPtrReturn(pThis, VERR_INVALID_HANDLE);260 AssertReturn(pThis->u32Magic == RTFILESYSTEM_MAGIC, VERR_INVALID_HANDLE);261 AssertPtrReturn(pfUsed, VERR_INVALID_POINTER);262 AssertReturn(offStart + cb <= pThis->Medium.cbMedium, VERR_OUT_OF_RANGE);263 264 return pThis->pcFsFmtOps->pfnQueryRangeUse(pThis->hFsFmt, offStart, cb, pfUsed);265 } -
trunk/src/VBox/Runtime/common/filesystem/filesystemext.cpp
r40038 r41549 35 35 #include <iprt/filesystem.h> 36 36 #include <iprt/string.h> 37 #include <iprt/vfs.h> 37 38 #include "internal/filesystem.h" 38 39 … … 151 152 * Cached block group descriptor data. 152 153 */ 153 typedef struct RTFILESYSTEM FMTEXTBLKGRP154 typedef struct RTFILESYSTEMEXTBLKGRP 154 155 { 155 156 /** Start offset (in bytes and from the start of the disk). */ … … 160 161 * and number of blocks per group). */ 161 162 uint8_t abBlockBitmap[1]; 162 } RTFILESYSTEM FMTEXTBLKGRP;163 } RTFILESYSTEMEXTBLKGRP; 163 164 /** Pointer to block group descriptor data. */ 164 typedef RTFILESYSTEM FMTEXTBLKGRP *PRTFILESYSTEMFMTEXTBLKGRP;165 typedef RTFILESYSTEMEXTBLKGRP *PRTFILESYSTEMEXTBLKGRP; 165 166 166 167 /** 167 168 * Ext2/3 filesystem data. 168 169 */ 169 typedef struct RTFILESYSTEM FMTINT170 { 171 /** Handle to the underlying medium. */172 RT FILESYSTEMMEDIUM hMedium;170 typedef struct RTFILESYSTEMEXT 171 { 172 /** VFS file handle. */ 173 RTVFSFILE hVfsFile; 173 174 /** Block number of the superblock. */ 174 175 uint32_t iSbBlock; … … 180 181 unsigned cBlockGroups; 181 182 /** Cached block group descriptor data. */ 182 PRTFILESYSTEM FMTEXTBLKGRPpBlkGrpDesc;183 } RTFILESYSTEM FMTINT;183 PRTFILESYSTEMEXTBLKGRP pBlkGrpDesc; 184 } RTFILESYSTEMEXT; 184 185 /** Pointer to the ext filesystem data. */ 185 typedef RTFILESYSTEM FMTINT *PRTFILESYSTEMFMTINT;186 typedef RTFILESYSTEMEXT *PRTFILESYSTEMEXT; 186 187 187 188 /******************************************************************************* … … 196 197 * @param iBlkGrp Block group number to load. 197 198 */ 198 static int rtF ilesystemExtLoadBlkGrpDesc(PRTFILESYSTEMFMTINT pThis, uint32_t iBlkGrp)199 static int rtFsExtLoadBlkGrpDesc(PRTFILESYSTEMEXT pThis, uint32_t iBlkGrp) 199 200 { 200 201 int rc = VINF_SUCCESS; 201 PRTFILESYSTEM FMTEXTBLKGRP pBlkGrpDesc = pThis->pBlkGrpDesc;202 PRTFILESYSTEMEXTBLKGRP pBlkGrpDesc = pThis->pBlkGrpDesc; 202 203 uint64_t offRead = (pThis->iSbBlock + 1) * pThis->cbBlock; 203 204 BlockGroupDesc BlkDesc; … … 210 211 if (!pBlkGrpDesc) 211 212 { 212 size_t cbBlkDesc = RT_OFFSETOF(RTFILESYSTEM FMTEXTBLKGRP, abBlockBitmap[cbBlockBitmap]);213 pBlkGrpDesc = (PRTFILESYSTEM FMTEXTBLKGRP)RTMemAllocZ(cbBlkDesc);213 size_t cbBlkDesc = RT_OFFSETOF(RTFILESYSTEMEXTBLKGRP, abBlockBitmap[cbBlockBitmap]); 214 pBlkGrpDesc = (PRTFILESYSTEMEXTBLKGRP)RTMemAllocZ(cbBlkDesc); 214 215 if (!pBlkGrpDesc) 215 216 return VERR_NO_MEMORY; 216 217 } 217 218 218 rc = rtFilesystemMediumRead(pThis->hMedium, offRead, &BlkDesc, sizeof(BlkDesc));219 rc = RTVfsFileReadAt(pThis->hVfsFile, offRead, &BlkDesc, sizeof(BlkDesc), NULL); 219 220 if (RT_SUCCESS(rc)) 220 221 { 221 222 pBlkGrpDesc->offStart = pThis->iSbBlock + (uint64_t)iBlkGrp * pThis->cBlocksPerGroup * pThis->cbBlock; 222 223 pBlkGrpDesc->offLast = pBlkGrpDesc->offStart + pThis->cBlocksPerGroup * pThis->cbBlock; 223 rc = rtFilesystemMediumRead(pThis->hMedium, BlkDesc.offBlockBitmap * pThis->cbBlock,224 &pBlkGrpDesc->abBlockBitmap[0], cbBlockBitmap);224 rc = RTVfsFileReadAt(pThis->hVfsFile, BlkDesc.offBlockBitmap * pThis->cbBlock, 225 &pBlkGrpDesc->abBlockBitmap[0], cbBlockBitmap, NULL); 225 226 } 226 227 … … 230 231 } 231 232 232 static DECLCALLBACK(int) rtFilesystemExtProbe(RTFILESYSTEMMEDIUM hMedium, uint32_t *puScore) 233 static bool rtFsExtIsBlockRangeInUse(PRTFILESYSTEMEXTBLKGRP pBlkGrpDesc, 234 uint32_t offBlockStart, uint32_t cBlocks) 235 { 236 bool fUsed = false; 237 238 while (cBlocks) 239 { 240 uint32_t idxByte = offBlockStart / 8; 241 uint32_t iBit = offBlockStart % 8; 242 243 if (pBlkGrpDesc->abBlockBitmap[idxByte] & RT_BIT(iBit)) 244 { 245 fUsed = true; 246 break; 247 } 248 249 cBlocks--; 250 offBlockStart++; 251 } 252 253 return fUsed; 254 } 255 256 257 static DECLCALLBACK(int) rtFsExtProbe(RTVFSFILE hVfsFile, uint32_t *puScore) 233 258 { 234 259 int rc = VINF_SUCCESS; 235 uint64_t cbMedium = rtFilesystemMediumGetSize(hMedium);260 uint64_t cbMedium = 0; 236 261 237 262 *puScore = RTFILESYSTEM_MATCH_SCORE_UNSUPPORTED; 238 263 239 if (cbMedium >= 2*sizeof(ExtSuperBlock)) 240 { 241 ExtSuperBlock SuperBlock; 242 243 rc = rtFilesystemMediumRead(hMedium, 1024, &SuperBlock, sizeof(ExtSuperBlock)); 244 if (RT_SUCCESS(rc)) 264 rc = RTVfsFileGetSize(hVfsFile, &cbMedium); 265 if (RT_SUCCESS(rc)) 266 { 267 if (cbMedium >= 2*sizeof(ExtSuperBlock)) 245 268 { 269 ExtSuperBlock SuperBlock; 270 271 rc = RTVfsFileReadAt(hVfsFile, 1024, &SuperBlock, sizeof(ExtSuperBlock), NULL); 272 if (RT_SUCCESS(rc)) 273 { 246 274 #if defined(RT_BIGENDIAN) 247 /** @todo: Convert to host endianess. */275 /** @todo: Convert to host endianess. */ 248 276 #endif 249 if (SuperBlock.u16Signature == RTFILESYSTEM_EXT2_SIGNATURE) 250 *puScore = RTFILESYSTEM_MATCH_SCORE_SUPPORTED; 277 if (SuperBlock.u16Signature == RTFILESYSTEM_EXT2_SIGNATURE) 278 *puScore = RTFILESYSTEM_MATCH_SCORE_SUPPORTED; 279 } 251 280 } 252 281 } … … 255 284 } 256 285 257 static DECLCALLBACK(int) rtF ilesystemExtOpen(RTFILESYSTEMMEDIUM hMedium, PRTFILESYSTEMFMT phFsFmt)286 static DECLCALLBACK(int) rtFsExtInit(void *pvThis, RTVFSFILE hVfsFile) 258 287 { 259 288 int rc = VINF_SUCCESS; 260 PRTFILESYSTEM FMTINT pThis;289 PRTFILESYSTEMEXT pThis = (PRTFILESYSTEMEXT)pvThis; 261 290 ExtSuperBlock SuperBlock; 262 291 263 pThis = (PRTFILESYSTEMFMTINT)RTMemAllocZ(sizeof(RTFILESYSTEMFMTINT)); 264 if (!pThis) 265 return VERR_NO_MEMORY; 266 267 pThis->hMedium = hMedium; 292 pThis->hVfsFile = hVfsFile; 268 293 pThis->pBlkGrpDesc = NULL; 269 294 270 rc = rtFilesystemMediumRead(hMedium, 1024, &SuperBlock, sizeof(ExtSuperBlock));295 rc = RTVfsFileReadAt(hVfsFile, 1024, &SuperBlock, sizeof(ExtSuperBlock), NULL); 271 296 if (RT_SUCCESS(rc)) 272 297 { … … 284 309 285 310 /* Load first block group descriptor. */ 286 rc = rtF ilesystemExtLoadBlkGrpDesc(pThis, 0);311 rc = rtFsExtLoadBlkGrpDesc(pThis, 0); 287 312 } 288 313 } 289 314 290 if (RT_SUCCESS(rc))291 *phFsFmt = pThis;292 else293 {294 if (pThis->pBlkGrpDesc)295 RTMemFree(pThis->pBlkGrpDesc);296 RTMemFree(pThis);297 }298 299 315 return rc; 300 316 } 301 317 302 static DECLCALLBACK( int) rtFilesystemExtClose(RTFILESYSTEMFMT hFsFmt)303 { 304 PRTFILESYSTEM FMTINT pThis = hFsFmt;318 static DECLCALLBACK(void) rtFsExtDestroy(void *pvThis) 319 { 320 PRTFILESYSTEMEXT pThis = (PRTFILESYSTEMEXT)pvThis; 305 321 306 322 if (pThis->pBlkGrpDesc) 307 323 RTMemFree(pThis->pBlkGrpDesc); 308 RTMemFree(pThis); 309 310 return VINF_SUCCESS; 311 } 312 313 static DECLCALLBACK(uint64_t) rtFilesystemExtGetBlockSize(RTFILESYSTEMFMT hFsFmt) 314 { 315 PRTFILESYSTEMFMTINT pThis = hFsFmt; 316 317 return pThis->cbBlock; 318 } 319 320 static bool rtFilesystemExtIsBlockRangeInUse(PRTFILESYSTEMFMTEXTBLKGRP pBlkGrpDesc, 321 uint32_t offBlockStart, 322 uint32_t cBlocks) 323 { 324 bool fUsed = false; 325 326 while (cBlocks) 327 { 328 uint32_t idxByte = offBlockStart / 8; 329 uint32_t iBit = offBlockStart % 8; 330 331 if (pBlkGrpDesc->abBlockBitmap[idxByte] & RT_BIT(iBit)) 332 { 333 fUsed = true; 334 break; 335 } 336 337 cBlocks--; 338 offBlockStart++; 339 } 340 341 return fUsed; 342 } 343 344 static DECLCALLBACK(int) rtFilesystemExtQueryRangeUse(RTFILESYSTEMFMT hFsFmt, uint64_t offStart, 345 size_t cb, bool *pfUsed) 324 } 325 326 static DECLCALLBACK(int) rtFsExtOpenRoot(void *pvThis, PRTVFSDIR phVfsDir) 327 { 328 return VERR_NOT_IMPLEMENTED; 329 } 330 331 static DECLCALLBACK(int) rtFsExtIsRangeInUse(void *pvThis, RTFOFF off, size_t cb, 332 bool *pfUsed) 346 333 { 347 334 int rc = VINF_SUCCESS; 348 PRTFILESYSTEMFMTINT pThis = hFsFmt; 335 uint64_t offStart = (uint64_t)off; 336 PRTFILESYSTEMEXT pThis = (PRTFILESYSTEMEXT)pvThis; 337 338 *pfUsed = false; 349 339 350 340 while (cb > 0) … … 360 350 { 361 351 /* Load new block descriptor. */ 362 rc = rtF ilesystemExtLoadBlkGrpDesc(pThis, iBlockGroup);352 rc = rtFsExtLoadBlkGrpDesc(pThis, iBlockGroup); 363 353 if (RT_FAILURE(rc)) 364 354 break; … … 366 356 367 357 cbThis = RT_MIN(cb, pThis->pBlkGrpDesc->offLast - offStart + 1); 368 fUsed = rtFilesystemExtIsBlockRangeInUse(pThis->pBlkGrpDesc, offBlockRelStart, 369 cbThis / pThis->cbBlock + 370 cbThis % pThis->cbBlock 371 ? 1 372 : 0); 358 fUsed = rtFsExtIsBlockRangeInUse(pThis->pBlkGrpDesc, offBlockRelStart, 359 cbThis / pThis->cbBlock + 360 (cbThis % pThis->cbBlock ? 1 : 0)); 373 361 374 362 if (fUsed) … … 378 366 } 379 367 380 cb -= cbThis;368 cb -= cbThis; 381 369 offStart += cbThis; 382 370 } … … 385 373 } 386 374 387 RTFILESYSTEMFMTOPS g_rtFilesystemFmtExt = 388 { 389 /* pcszFmt */ 390 "EXT", 391 /* pfnProbe */ 392 rtFilesystemExtProbe, 393 /* pfnOpen */ 394 rtFilesystemExtOpen, 395 /* pfnClose */ 396 rtFilesystemExtClose, 397 /* pfnGetBlockSize */ 398 rtFilesystemExtGetBlockSize, 399 /* pfnQueryRangeUse */ 400 rtFilesystemExtQueryRangeUse 375 DECL_HIDDEN_CONST(RTFILESYSTEMDESC) const g_rtFsExt = 376 { 377 /** cbFs */ 378 sizeof(RTFILESYSTEMEXT), 379 /** VfsOps */ 380 { 381 /** uVersion. */ 382 RTVFSOPS_VERSION, 383 /** fFeatures */ 384 0, 385 /** pszName */ 386 "ExtVfsOps", 387 /** pfnDestroy */ 388 rtFsExtDestroy, 389 /** pfnOpenRoot */ 390 rtFsExtOpenRoot, 391 /** pfnIsRangeInUse */ 392 rtFsExtIsRangeInUse, 393 /** uEndMarker */ 394 RTVFSOPS_VERSION 395 }, 396 /** pfnProbe */ 397 rtFsExtProbe, 398 /** pfnInit */ 399 rtFsExtInit 401 400 }; 402 401
Note:
See TracChangeset
for help on using the changeset viewer.