• Home
  • Raw
  • Download

Lines Matching refs:offset

43 static int find_offset(uint64_t file_size, int roots, uint64_t *offset,  in find_offset()  argument
46 check(offset); in find_offset()
70 *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, &header, sizeof(fec_header), offset)) { in parse_ecc_header()
121 offset -= offset % FEC_BLOCKSIZE; in parse_ecc_header()
149 if (offset < header.fec_size || in parse_ecc_header()
150 offset - header.fec_size != header.inp_size) { in parse_ecc_header()
151 error("unexpected input size: %" PRIu64 " vs %" PRIu64, offset, in parse_ecc_header()
205 static int parse_ecc(fec_handle *f, uint64_t offset) in parse_ecc() argument
208 check(offset % FEC_BLOCKSIZE == 0); in parse_ecc()
209 check(offset < UINT64_MAX - FEC_BLOCKSIZE); in parse_ecc()
212 if (parse_ecc_header(f, offset) == 0) { in parse_ecc()
217 if (parse_ecc_header(f, offset + FEC_BLOCKSIZE - sizeof(fec_header)) == 0) { in parse_ecc()
227 static int get_squashfs_size(fec_handle *f, uint64_t *offset) in get_squashfs_size() argument
230 check(offset); in get_squashfs_size()
249 *offset = sq.bytes_used_4K_padded; in get_squashfs_size()
255 static int get_ext4_size(fec_handle *f, uint64_t *offset) in get_ext4_size() argument
259 check(offset); in get_ext4_size()
276 *offset = info.len; in get_ext4_size()
282 static int get_fs_size(fec_handle *f, uint64_t *offset) in get_fs_size() argument
285 check(offset); in get_fs_size()
288 return get_ext4_size(f, offset); in get_fs_size()
290 return get_squashfs_size(f, offset); in get_fs_size()
293 int rc = get_ext4_size(f, offset); in get_fs_size()
300 rc = get_squashfs_size(f, offset); in get_fs_size()
316 uint64_t offset = f->data_size - VERITY_METADATA_SIZE; in load_verity() local
319 if (verity_parse_header(f, offset) == 0) { in load_verity()
320 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
328 if (find_verity_offset(f, &offset) == 0 && in load_verity()
329 verity_parse_header(f, offset) == 0) { in load_verity()
330 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
336 int rc = get_fs_size(f, &offset); in load_verity()
339 debug("file system size = %" PRIu64, offset); in load_verity()
340 rc = verity_parse_header(f, offset); in load_verity()
343 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_verity()
357 uint64_t offset = f->data_size - FEC_BLOCKSIZE; in load_ecc() local
359 if (parse_ecc(f, offset) == 0) { in load_ecc()
360 debug("found at %" PRIu64 " (start %" PRIu64 ")", offset, in load_ecc()