Lines Matching refs:count

234 static ssize_t ecc_read(fec_handle *f, uint8_t *dest, size_t count,  in ecc_read()  argument
240 check(offset + count <= f->data_size); in ecc_read()
243 debug("[%" PRIu64 ", %" PRIu64 ")", offset, offset + count); in ecc_read()
254 size_t left = count; in ecc_read()
279 return count; in ecc_read()
285 static ssize_t verity_read(fec_handle *f, uint8_t *dest, size_t count, in verity_read() argument
291 check(offset + count <= f->data_size); in verity_read()
295 debug("[%" PRIu64 ", %" PRIu64 ")", offset, offset + count); in verity_read()
306 size_t left = count; in verity_read()
346 offset, offset + count, curr); in verity_read()
350 offset, offset + count, curr); in verity_read()
370 offset, offset + count, curr, curr_offset); in verity_read()
399 return count; in verity_read()
444 ssize_t fec_read(struct fec_handle *f, void *buf, size_t count) in fec_read() argument
446 ssize_t rc = fec_pread(f, buf, count, f->pos); in fec_read()
458 static inline size_t get_max_count(uint64_t offset, size_t count, uint64_t max) in get_max_count() argument
462 } else if (offset > max - count) { in get_max_count()
466 return count; in get_max_count()
471 bool raw_pread(int fd, void *buf, size_t count, uint64_t offset) { in raw_pread() argument
475 size_t remaining = count; in raw_pread()
493 bool raw_pwrite(int fd, const void *buf, size_t count, uint64_t offset) { in raw_pwrite() argument
497 size_t remaining = count; in raw_pwrite()
516 ssize_t fec_pread(struct fec_handle *f, void *buf, size_t count, in fec_pread() argument
522 if (unlikely(offset > UINT64_MAX - count)) { in fec_pread()
529 get_max_count(offset, count, f->data_size), offset, in fec_pread()
534 count = get_max_count(offset, count, f->data_size); in fec_pread()
535 ssize_t rc = process(f, (uint8_t *)buf, count, offset, ecc_read); in fec_pread()
544 count = get_max_count(offset, count, f->size); in fec_pread()
547 if (raw_pread(f->fd, buf, count, offset)) { in fec_pread()
548 return count; in fec_pread()