Changeset 75476 in vbox for trunk/src/VBox/ImageMounter/vboxraw/vboxraw.cpp
- Timestamp:
- Nov 15, 2018 5:39:01 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ImageMounter/vboxraw/vboxraw.cpp
r75475 r75476 306 306 307 307 uint64_t const cbMisalignHead = off & VD_SECTOR_MASK; 308 uint64_t const cb cbMisalignTail = (off + cbRead) & VD_SECTOR_MASK;309 310 if (cbMisalignHead + cb cbMisalignTail == 0) /* perfectly aligned request; just read it and done */308 uint64_t const cbMisalignTail = (off + cbRead) & VD_SECTOR_MASK; 309 310 if (cbMisalignHead + cbMisalignTail == 0) /* perfectly aligned request; just read it and done */ 311 311 rc = VDRead(pDisk, off, pvBuf, cbRead); 312 312 else … … 338 338 Assert(!(off % VD_SECTOR_SIZE)); 339 339 340 size_t cbPart = cbRead - cb cbMisalignTail;340 size_t cbPart = cbRead - cbMisalignTail; 341 341 Assert(!(cbPart % VD_SECTOR_SIZE)); 342 342 rc = VDRead(pDisk, off, pbBuf, cbPart); … … 352 352 if (RT_SUCCESS(rc) && cbRead) 353 353 { 354 Assert(cbRead == cb cbMisalignTail);354 Assert(cbRead == cbMisalignTail); 355 355 Assert(cbRead < VD_SECTOR_SIZE); 356 356 Assert(!(off % VD_SECTOR_SIZE)); … … 390 390 */ 391 391 uint64_t const cbMisalignHead = off & 511; 392 size_t const cb cbMisalignTail = (off + cbWrite) & 511;393 if (!cbMisalignHead && !cb cbMisalignTail)392 size_t const cbMisalignTail = (off + cbWrite) & 511; 393 if (!cbMisalignHead && !cbMisalignTail) 394 394 { 395 395 rc = VDWrite(pDisk, off, pbSrc, cbWrite); … … 438 438 { 439 439 Assert(!(off % VD_SECTOR_SIZE)); 440 size_t cbPart = cbWrite - cb cbMisalignTail;440 size_t cbPart = cbWrite - cbMisalignTail; 441 441 Assert(!(cbPart % VD_SECTOR_SIZE)); 442 442 rc = VDWrite(pDisk, off, pbSrc, cbPart); … … 454 454 if ( RT_SUCCESS(rc) && cbWrite > 0) 455 455 { 456 Assert(cbWrite == cb cbMisalignTail);456 Assert(cbWrite == cbMisalignTail); 457 457 Assert(cbWrite < VD_SECTOR_SIZE); 458 458 Assert(!(off % VD_SECTOR_SIZE)); … … 503 503 } 504 504 505 /** @ …fuse_operations::write */505 /** @copydoc fuse_operations::write */ 506 506 static int vboxrawOp_write(const char *pszPath, const char *pbBuf, size_t cbBuf, 507 507 off_t offset, struct fuse_file_info *pInfo)
Note:
See TracChangeset
for help on using the changeset viewer.