Lines Matching refs:off
414 off_t off; in vhd_batmap_header_offset() local
419 off = ctx->header.table_offset; in vhd_batmap_header_offset()
421 off += vhd_bytes_padded(bat); in vhd_batmap_header_offset()
423 *_off = off; in vhd_batmap_header_offset()
908 vhd_read_footer_at(vhd_context_t *ctx, vhd_footer_t *footer, off_t off) in vhd_read_footer_at() argument
915 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_footer_at()
939 ctx->file, off, err); in vhd_read_footer_at()
948 off_t off; in vhd_read_footer() local
954 off = vhd_position(ctx); in vhd_read_footer()
955 if (off == (off_t)-1) in vhd_read_footer()
958 err = vhd_read_footer_at(ctx, footer, off - 512); in vhd_read_footer()
973 vhd_read_header_at(vhd_context_t *ctx, vhd_header_t *header, off_t off) in vhd_read_header_at() argument
985 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_header_at()
1009 ctx->file, off, err); in vhd_read_header_at()
1018 off_t off; in vhd_read_header() local
1025 off = ctx->footer.data_offset; in vhd_read_header()
1026 return vhd_read_header_at(ctx, header, off); in vhd_read_header()
1034 off_t off; in vhd_read_bat() local
1044 off = ctx->header.table_offset; in vhd_read_bat()
1054 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_bat()
1082 off_t off; in vhd_read_batmap_header() local
1087 err = vhd_batmap_header_offset(ctx, &off); in vhd_read_batmap_header()
1091 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_batmap_header()
1127 off_t off; in vhd_read_batmap_map() local
1139 off = batmap->header.batmap_offset; in vhd_read_batmap_map()
1140 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_batmap_map()
1662 const char *parent, off_t off, uint32_t code, in vhd_parent_locator_write_at() argument
1728 err = vhd_seek(ctx, off, SEEK_SET); in vhd_parent_locator_write_at()
1771 loc->data_offset = off; in vhd_parent_locator_write_at()
1778 vhd_footer_offset_at_eof(vhd_context_t *ctx, off_t *off) in vhd_footer_offset_at_eof() argument
1783 *off = vhd_position(ctx) - sizeof(vhd_footer_t); in vhd_footer_offset_at_eof()
1793 off_t off; in vhd_read_bitmap() local
1813 off = vhd_sectors_to_bytes(blk); in vhd_read_bitmap()
1816 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_bitmap()
1843 off_t end, off; in vhd_read_block() local
1862 off = vhd_sectors_to_bytes(blk + ctx->bm_secs); in vhd_read_block()
1875 if (end < off + ctx->header.block_size) { in vhd_read_block()
1876 size = end - off; in vhd_read_block()
1880 err = vhd_seek(ctx, off, SEEK_SET); in vhd_read_block()
1897 vhd_write_footer_at(vhd_context_t *ctx, vhd_footer_t *footer, off_t off) in vhd_write_footer_at() argument
1919 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_footer_at()
1930 ctx->file, off, err); in vhd_write_footer_at()
1939 off_t off; in vhd_write_footer() local
1942 err = vhd_footer_offset_at_eof(ctx, &off); in vhd_write_footer()
1944 err = vhd_end_of_data(ctx, &off); in vhd_write_footer()
1948 err = vhd_write_footer_at(ctx, footer, off); in vhd_write_footer()
1959 vhd_write_header_at(vhd_context_t *ctx, vhd_header_t *header, off_t off) in vhd_write_header_at() argument
1988 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_header_at()
1997 ctx->file, off, err); in vhd_write_header_at()
2006 off_t off; in vhd_write_header() local
2011 off = ctx->footer.data_offset; in vhd_write_header()
2012 return vhd_write_header_at(ctx, header, off); in vhd_write_header()
2019 off_t off; in vhd_write_bat() local
2036 off = ctx->header.table_offset; in vhd_write_bat()
2039 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_bat()
2062 off_t off; in vhd_write_batmap() local
2083 off = b.header.batmap_offset; in vhd_write_batmap()
2086 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_batmap()
2103 err = vhd_batmap_header_offset(ctx, &off); in vhd_write_batmap()
2109 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_batmap()
2138 off_t off; in vhd_write_bitmap() local
2159 off = vhd_sectors_to_bytes(blk); in vhd_write_bitmap()
2162 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_bitmap()
2177 off_t off; in vhd_write_block() local
2198 off = vhd_sectors_to_bytes(blk + ctx->bm_secs); in vhd_write_block()
2201 err = vhd_seek(ctx, off, SEEK_SET); in vhd_write_block()
2230 off_t off; in vhd_seek() local
2232 off = lseek(ctx->fd, offset, whence); in vhd_seek()
2233 if (off == (off_t)-1) { in vhd_seek()
2586 off_t off; in vhd_write_parent_locators() local
2594 off = ctx->batmap.header.batmap_offset + in vhd_write_parent_locators()
2596 if (off & (VHD_SECTOR_SIZE - 1)) in vhd_write_parent_locators()
2597 off = vhd_bytes_padded(off); in vhd_write_parent_locators()
2612 err = vhd_parent_locator_write_at(ctx, parent, off, code, in vhd_write_parent_locators()
2617 off += vhd_parent_locator_size(ctx->header.loc + i); in vhd_write_parent_locators()
2706 off_t off; in vhd_create_batmap() local
2719 err = vhd_batmap_header_offset(ctx, &off); in vhd_create_batmap()
2723 header->batmap_offset = off + in vhd_create_batmap()
2838 off_t off; in __vhd_create() local
2923 off = vhd_position(&ctx); in __vhd_create()
2924 if (off == (off_t)-1) { in __vhd_create()
2930 off -= sizeof(vhd_footer_t); in __vhd_create()
2932 err = vhd_write_footer_at(&ctx, &ctx.footer, off); in __vhd_create()
2999 off_t off; in __vhd_io_dynamic_read_link() local
3009 off = ctx->bat.bat[blk]; in __vhd_io_dynamic_read_link()
3013 if (off == DD_BLK_UNUSED) { in __vhd_io_dynamic_read_link()
3055 off_t off; in __raw_read_link() local
3067 off = lseek(fd, vhd_sectors_to_bytes(sec), SEEK_SET); in __raw_read_link()
3068 if (off == (off_t)-1) { in __raw_read_link()
3201 off_t off, max; in __vhd_io_allocate_block() local
3211 off = max; in __vhd_io_allocate_block()
3220 err = vhd_seek(ctx, off, SEEK_SET); in __vhd_io_allocate_block()
3250 off_t off; in __vhd_io_dynamic_write() local
3271 off = ctx->bat.bat[blk]; in __vhd_io_dynamic_write()
3272 if (off == DD_BLK_UNUSED) { in __vhd_io_dynamic_write()
3277 off = ctx->bat.bat[blk]; in __vhd_io_dynamic_write()
3280 off += ctx->bm_secs + sec; in __vhd_io_dynamic_write()
3281 err = vhd_seek(ctx, vhd_sectors_to_bytes(off), SEEK_SET); in __vhd_io_dynamic_write()