Lines Matching refs:off
86 uint64_t off;
130 pCur->off = RTFOFF_MAX;
165 static PRTVFSMEMEXTENT rtVfsMemFile_LocateExtentSlow(PRTVFSMEMFILE pThis, uint64_t off, bool *pfHit)
172 if (!pExtent || pExtent->off < off)
181 if (off - pExtent->off < pExtent->cb)
192 while (off - pExtent->off >= pExtent->cb)
194 Assert(pExtent->off <= off);
197 || pNext->off > off)
215 * @returns The closest extent. NULL if off is 0 and there are no extent
218 * @param off The offset (0-positive).
223 DECLINLINE(PRTVFSMEMEXTENT) rtVfsMemFile_LocateExtent(PRTVFSMEMFILE pThis, uint64_t off, bool *pfHit)
231 return rtVfsMemFile_LocateExtentSlow(pThis, off, pfHit);
233 if (off - pExtent->off >= pExtent->cb)
237 || off - pExtent->off >= pExtent->cb)
238 return rtVfsMemFile_LocateExtentSlow(pThis, off, pfHit);
250 static DECLCALLBACK(int) rtVfsMemFile_Read(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)
255 Assert(off < 0);
261 uint64_t offUnsigned = off < 0 ? pThis->offCurPos : (uint64_t)off;
305 Assert(offUnsigned - pExtent->off < pExtent->cb);
306 size_t const offExtent = (size_t)(offUnsigned - pExtent->off);
311 memcpy(pbDst, &pExtent->abData[offUnsigned - pExtent->off], cbThisRead);
322 && pNext->off == pExtent->off + pExtent->cb)
328 Assert(!pNext || pNext->off > pExtent->off);
333 Assert(!pExtent || pExtent->off > offUnsigned);
339 || offUnsigned + cbLeftToRead <= pExtent->off)
342 cbThisRead = (size_t)(pExtent->off - offUnsigned);
410 uint64_t const offPrev = pPrev ? pPrev->off + pPrev->cb : 0;
416 uint64_t cbMaxExtent = pNext->off - offExtent;
427 pNew->off = offExtent;
445 static DECLCALLBACK(int) rtVfsMemFile_Write(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)
450 Assert(off < 0);
459 uint64_t offUnsigned = off < 0 ? pThis->offCurPos : (uint64_t)off;
474 Assert(!pExtent || pExtent->off > offUnsigned);
481 uint64_t const cbToNext = pExtent ? pExtent->off - offUnsigned : UINT64_MAX;
489 Assert(!pExtent || offUnsigned <= pExtent->off);
490 if (pExtent && pExtent->off == offUnsigned)
505 Assert(offUnsigned - pExtent->off < pExtent->cb);
510 uint32_t const offDst = (uint32_t)(offUnsigned - pExtent->off);
521 Assert(offUnsigned == pExtent->off + pExtent->cb);
527 fHit = pExtent && (offUnsigned - pExtent->off < pExtent->cb);
683 && pThis->pCurExt->off - offNew >= pThis->pCurExt->cb)