Lines Matching refs:offset
79 int Fadvise(int fd, off_t offset, size_t len, int advice) { in Fadvise() argument
81 return posix_fadvise(fd, offset, len, advice); in Fadvise()
84 (void)offset; in Fadvise()
120 bool PosixPositionedWrite(int fd, const char* buf, size_t nbyte, off_t offset) { in PosixPositionedWrite() argument
129 ssize_t done = pwrite(fd, src, bytes_to_write, offset); in PosixPositionedWrite()
137 offset += done; in PosixPositionedWrite()
255 IOStatus PosixSequentialFile::PositionedRead(uint64_t offset, size_t n, in PositionedRead() argument
260 assert(IsSectorAligned(offset, GetRequiredBufferAlignment())); in PositionedRead()
269 r = pread(fd_, ptr, left, static_cast<off_t>(offset)); in PositionedRead()
277 offset += r; in PositionedRead()
288 "While pread " + ToString(n) + " bytes from offset " + ToString(offset), in PositionedRead()
303 IOStatus PosixSequentialFile::InvalidateCache(size_t offset, size_t length) { in InvalidateCache() argument
305 (void)offset; in InvalidateCache()
311 int ret = Fadvise(fd_, offset, length, POSIX_FADV_DONTNEED); in InvalidateCache()
313 return IOError("While fadvise NotNeeded offset " + ToString(offset) + in InvalidateCache()
566 IOStatus PosixRandomAccessFile::Read(uint64_t offset, size_t n, in Read() argument
571 assert(IsSectorAligned(offset, GetRequiredBufferAlignment())); in Read()
580 r = pread(fd_, ptr, left, static_cast<off_t>(offset)); in Read()
588 offset += r; in Read()
600 "While pread offset " + ToString(offset) + " len " + ToString(n), in Read()
668 rep_to_submit->req->offset + rep_to_submit->finished_len); in MultiRead()
708 Read(req->offset + req_wrap->finished_len, in MultiRead()
733 IOStatus PosixRandomAccessFile::Prefetch(uint64_t offset, size_t n, in Prefetch() argument
740 r = readahead(fd_, offset, n); in Prefetch()
744 advice.ra_offset = static_cast<off_t>(offset); in Prefetch()
749 s = IOError("While prefetching offset " + ToString(offset) + " len " + in Prefetch()
789 IOStatus PosixRandomAccessFile::InvalidateCache(size_t offset, size_t length) { in InvalidateCache() argument
794 (void)offset; in InvalidateCache()
799 int ret = Fadvise(fd_, offset, length, POSIX_FADV_DONTNEED); in InvalidateCache()
803 return IOError("While fadvise NotNeeded offset " + ToString(offset) + in InvalidateCache()
837 IOStatus PosixMmapReadableFile::Read(uint64_t offset, size_t n, in Read() argument
842 if (offset > length_) { in Read()
844 return IOError("While mmap read offset " + ToString(offset) + in Read()
847 } else if (offset + n > length_) { in Read()
848 n = static_cast<size_t>(length_ - offset); in Read()
850 *result = Slice(reinterpret_cast<char*>(mmapped_region_) + offset, n); in Read()
854 IOStatus PosixMmapReadableFile::InvalidateCache(size_t offset, size_t length) { in InvalidateCache() argument
856 (void)offset; in InvalidateCache()
861 int ret = Fadvise(fd_, offset, length, POSIX_FADV_DONTNEED); in InvalidateCache()
865 return IOError("While fadvise not needed. Offset " + ToString(offset) + in InvalidateCache()
1074 IOStatus PosixMmapFile::InvalidateCache(size_t offset, size_t length) { in InvalidateCache() argument
1076 (void)offset; in InvalidateCache()
1081 int ret = Fadvise(fd_, offset, length, POSIX_FADV_DONTNEED); in InvalidateCache()
1090 IOStatus PosixMmapFile::Allocate(uint64_t offset, uint64_t len, in Allocate() argument
1093 assert(offset <= static_cast<uint64_t>(std::numeric_limits<off_t>::max())); in Allocate()
1100 static_cast<off_t>(offset), static_cast<off_t>(len)); in Allocate()
1106 "While fallocate offset " + ToString(offset) + " len " + ToString(len), in Allocate()
1159 IOStatus PosixWritableFile::PositionedAppend(const Slice& data, uint64_t offset, in PositionedAppend() argument
1163 assert(IsSectorAligned(offset, GetRequiredBufferAlignment())); in PositionedAppend()
1167 assert(offset <= static_cast<uint64_t>(std::numeric_limits<off_t>::max())); in PositionedAppend()
1170 if (!PosixPositionedWrite(fd_, src, nbytes, static_cast<off_t>(offset))) { in PositionedAppend()
1171 return IOError("While pwrite to file at offset " + ToString(offset), in PositionedAppend()
1174 filesize_ = offset + nbytes; in PositionedAppend()
1293 IOStatus PosixWritableFile::InvalidateCache(size_t offset, size_t length) { in InvalidateCache() argument
1298 (void)offset; in InvalidateCache()
1303 int ret = Fadvise(fd_, offset, length, POSIX_FADV_DONTNEED); in InvalidateCache()
1312 IOStatus PosixWritableFile::Allocate(uint64_t offset, uint64_t len, in Allocate() argument
1315 assert(offset <= static_cast<uint64_t>(std::numeric_limits<off_t>::max())); in Allocate()
1323 static_cast<off_t>(offset), static_cast<off_t>(len)); in Allocate()
1329 "While fallocate offset " + ToString(offset) + " len " + ToString(len), in Allocate()
1335 IOStatus PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes, in RangeSync() argument
1339 assert(offset <= static_cast<uint64_t>(std::numeric_limits<off_t>::max())); in RangeSync()
1348 sync_file_range(fd_, 0, static_cast<off_t>(offset + nbytes), in RangeSync()
1351 ret = sync_file_range(fd_, static_cast<off_t>(offset), in RangeSync()
1361 return FSWritableFile::RangeSync(offset, nbytes, opts, dbg); in RangeSync()
1384 IOStatus PosixRandomRWFile::Write(uint64_t offset, const Slice& data, in Write() argument
1389 if (!PosixPositionedWrite(fd_, src, nbytes, static_cast<off_t>(offset))) { in Write()
1391 "While write random read/write file at offset " + ToString(offset), in Write()
1398 IOStatus PosixRandomRWFile::Read(uint64_t offset, size_t n, in Read() argument
1404 ssize_t done = pread(fd_, ptr, left, offset); in Read()
1412 ToString(offset) + " len " + ToString(n), in Read()
1421 offset += done; in Read()