Lines Matching refs:buf

128   char* buf;  member in SparseFileBufSource
133 if (buf < buf_start) return -EOVERFLOW; in AccessOkay()
134 if (buf >= buf_end) return -EOVERFLOW; in AccessOkay()
135 if (len > buf_end - buf) return -EOVERFLOW; in AccessOkay()
141 SparseFileBufSource(char* buf, uint64_t len) { in SparseFileBufSource() argument
142 this->buf = buf; in SparseFileBufSource()
144 this->buf_start = buf; in SparseFileBufSource()
145 this->buf_end = buf + len; in SparseFileBufSource()
154 buf += off; in Seek()
162 buf = buf_start; in Rewind()
172 return sparse_file_add_data(s, buf, len, block); in AddToSparseFile()
180 memcpy(ptr, buf, len); in ReadValue()
181 buf += len; in ReadValue()
191 *crc32 = sparse_crc32(*crc32, buf, len); in GetCrc32()
192 buf += len; in GetCrc32()
460 static int do_sparse_file_read_normal(struct sparse_file* s, int fd, uint32_t* buf, int64_t offset, in do_sparse_file_read_normal() argument
468 if (!buf) { in do_sparse_file_read_normal()
474 ret = read_all(fd, buf, to_read); in do_sparse_file_read_normal()
483 if (buf[0] != buf[i]) { in do_sparse_file_read_normal()
494 sparse_file_add_fill(s, buf[0], to_read, block); in do_sparse_file_read_normal()
509 uint32_t* buf = (uint32_t*)malloc(s->block_size); in sparse_file_read_normal() local
511 if (!buf) in sparse_file_read_normal()
514 ret = do_sparse_file_read_normal(s, fd, buf, 0, s->len); in sparse_file_read_normal()
515 free(buf); in sparse_file_read_normal()
522 uint32_t* buf = (uint32_t*)malloc(s->block_size); in sparse_file_read_hole() local
526 if (!buf) { in sparse_file_read_hole()
538 free(buf); in sparse_file_read_hole()
547 free(buf); in sparse_file_read_hole()
555 free(buf); in sparse_file_read_hole()
559 ret = do_sparse_file_read_normal(s, fd, buf, start, end - start); in sparse_file_read_hole()
561 free(buf); in sparse_file_read_hole()
566 free(buf); in sparse_file_read_hole()
663 struct sparse_file* sparse_file_import_buf(char* buf, size_t len, bool verbose, bool crc) { in sparse_file_import_buf() argument
664 SparseFileBufSource source(buf, len); in sparse_file_import_buf()