Lines Matching defs:pos

110 Stream::_FindCluster(off_t pos, uint32& _cluster)
112 //TRACE(("FATFS::Stream::%s(%lld,,)\n", __FUNCTION__, pos));
113 uint32 index = (uint32)(pos / fVolume.ClusterSize());
114 if (pos > fSize || index >= fClusterCount)
156 Stream::_FindOrCreateCluster(off_t pos, uint32& _cluster, bool& _added)
158 status_t error = _FindCluster(pos, _cluster);
165 uint32 index = (uint32)(pos / fVolume.ClusterSize());
212 Stream::FindBlock(off_t pos, off_t &block, off_t &offset)
215 status_t error = _FindCluster(pos, cluster);
221 offset += (pos %= fVolume.ClusterSize());
232 Stream::ReadAt(off_t pos, void *_buffer, size_t *_length, off_t *diskOffset)
234 TRACE(("FATFS::Stream::%s(%lld, )\n", __FUNCTION__, pos));
238 // set/check boundaries for pos/length
239 if (pos < 0)
241 if (pos >= fSize) {
257 if (pos + (off_t)length > fSize)
258 length = fSize - pos;
262 if (FindBlock(pos, num, offset) < B_OK) {
277 // pos % block_size == (pos - offset) % block_size, offset % block_size == 0
278 if (pos % blockSize != 0) {
285 bytesRead = blockSize - (pos % blockSize);
289 memcpy(buffer, block + (pos % blockSize), bytesRead);
290 pos += bytesRead;
298 if (FindBlock(pos, num, offset) < B_OK) {
309 // offset is the offset to the current pos in the block_run
334 pos += bytes;
336 if (FindBlock(pos, num, offset) < B_OK) {
348 Stream::WriteAt(off_t pos, const void* _buffer, size_t* _length,
351 if (pos < 0)
365 error = _FindOrCreateCluster(pos, cluster, added);
370 off_t inClusterOffset = pos % fVolume.ClusterSize();
411 pos += toWrite;
415 if (pos > fSize)
416 fSize = pos;