Lines Matching refs:offset

42 static int find_offset(uint64_t file_size, int roots, uint64_t *offset,  in find_offset()  argument
45 check(offset); in find_offset()
69 *offset = mi; in find_offset()
89 static int find_verity_offset(fec_handle *f, uint64_t *offset) in find_verity_offset() argument
92 check(offset); in find_verity_offset()
94 return find_offset(f->data_size, 0, offset, get_verity_size, in find_verity_offset()
99 static int parse_ecc_header(fec_handle *f, uint64_t offset) in parse_ecc_header() argument
105 debug("offset = %" PRIu64, offset); in parse_ecc_header()
107 if (offset > f->size - sizeof(fec_header)) { in parse_ecc_header()
115 if (!raw_pread(f->fd, &header, sizeof(fec_header), offset)) { in parse_ecc_header()
121 offset -= offset % FEC_BLOCKSIZE; in parse_ecc_header()
198 static int parse_ecc(fec_handle *f, uint64_t offset) in parse_ecc() argument
201 check(offset % FEC_BLOCKSIZE == 0); in parse_ecc()
202 check(offset < UINT64_MAX - FEC_BLOCKSIZE); in parse_ecc()
205 if (parse_ecc_header(f, offset) == 0) { in parse_ecc()
210 if (parse_ecc_header(f, offset + FEC_BLOCKSIZE - sizeof(fec_header)) == 0) { in parse_ecc()
220 static int get_squashfs_size(fec_handle *f, uint64_t *offset) in get_squashfs_size() argument
223 check(offset); in get_squashfs_size()
242 *offset = sq.bytes_used_4K_padded; in get_squashfs_size()
248 static int get_ext4_size(fec_handle *f, uint64_t *offset) in get_ext4_size() argument
252 check(offset); in get_ext4_size()
269 *offset = info.len; in get_ext4_size()
275 static int get_fs_size(fec_handle *f, uint64_t *offset) in get_fs_size() argument
278 check(offset); in get_fs_size()
281 return get_ext4_size(f, offset); in get_fs_size()
283 return get_squashfs_size(f, offset); in get_fs_size()
286 int rc = get_ext4_size(f, offset); in get_fs_size()
293 rc = get_squashfs_size(f, offset); in get_fs_size()
309 uint64_t offset = f->data_size - VERITY_METADATA_SIZE; in load_verity() local
312 if (verity_parse_header(f, offset) == 0) { in load_verity()
313 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
321 if (find_verity_offset(f, &offset) == 0 && in load_verity()
322 verity_parse_header(f, offset) == 0) { in load_verity()
323 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
329 int rc = get_fs_size(f, &offset); in load_verity()
331 debug("file system size = %" PRIu64, offset); in load_verity()
333 offset += verity_get_size(offset, NULL, NULL, SHA256_DIGEST_LENGTH); in load_verity()
334 rc = verity_parse_header(f, offset); in load_verity()
337 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
351 uint64_t offset = f->data_size - FEC_BLOCKSIZE; in load_ecc() local
353 if (parse_ecc(f, offset) == 0) { in load_ecc()
354 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_ecc()