Lines Matching refs:blk
132 image_chunk_find(lba_t blk) in image_chunk_find() argument
137 ch = (last != NULL && last->ch_block <= blk) in image_chunk_find()
140 if (ch->ch_block <= blk && in image_chunk_find()
141 (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) { in image_chunk_find()
168 image_chunk_memory(struct chunk *ch, lba_t blk) in image_chunk_memory() argument
177 if (ch->ch_block < blk) { in image_chunk_memory()
184 ch->ch_size = (blk - ch->ch_block) * secsz; in image_chunk_memory()
185 new->ch_block = blk; in image_chunk_memory()
249 image_chunk_append(lba_t blk, size_t sz, off_t ofs, int fd) in image_chunk_append() argument
256 blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) && in image_chunk_append()
261 blk = ch->ch_block + (ch->ch_size / secsz); in image_chunk_append()
269 ch->ch_block = blk; in image_chunk_append()
280 image_chunk_copyin(lba_t blk, void *buf, size_t sz, off_t ofs, int fd) in image_chunk_copyin() argument
289 error = image_chunk_skipto(blk + 1); in image_chunk_copyin()
291 error = image_chunk_append(blk, secsz, ofs, fd); in image_chunk_copyin()
292 blk++; in image_chunk_copyin()
348 image_copyin_stream(lba_t blk, int fd, uint64_t *sizep) in image_copyin_stream() argument
376 error = image_chunk_copyin(blk, &buffer[iof], rdsz, swofs, in image_copyin_stream()
388 blk += (rdsz + secsz - 1) / secsz; in image_copyin_stream()
397 image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep) in image_copyin_mapped() argument
413 return (image_copyin_stream(blk, fd, sizep)); in image_copyin_mapped()
448 blk += (pos - hole) / secsz; in image_copyin_mapped()
449 error = image_chunk_skipto(blk); in image_copyin_mapped()
464 error = image_chunk_copyin(blk, buf, in image_copyin_mapped()
470 blk += sz / secsz; in image_copyin_mapped()
491 image_copyin(lba_t blk, int fd, uint64_t *sizep) in image_copyin() argument
496 error = image_chunk_skipto(blk); in image_copyin()
499 error = image_copyin_stream(blk, fd, sizep); in image_copyin()
501 error = image_copyin_mapped(blk, fd, sizep); in image_copyin()
601 image_copyout_region(int fd, lba_t blk, lba_t size) in image_copyout_region() argument
611 ch = image_chunk_find(blk); in image_copyout_region()
616 ofs = (blk - ch->ch_block) * secsz; in image_copyout_region()
634 blk += sz / secsz; in image_copyout_region()
640 image_data(lba_t blk, lba_t size) in image_data() argument
646 ch = image_chunk_find(blk); in image_data()
652 if (lim >= blk + size) in image_data()
654 size -= lim - blk; in image_data()
655 blk = lim; in image_data()
668 image_set_size(lba_t blk) in image_set_size() argument
672 error = image_chunk_skipto(blk); in image_set_size()
674 image_size = blk; in image_set_size()
679 image_write(lba_t blk, void *buf, ssize_t len) in image_write() argument
685 ch = image_chunk_find(blk); in image_write()
692 ch = image_chunk_memory(ch, blk); in image_write()
699 blk++; in image_write()