Lines Matching refs:clstrsz
82 uint64_t clstrsz; in round_clstr() local
84 clstrsz = 1UL << clstr_log2sz; in round_clstr()
85 return ((ofs + clstrsz - 1) & ~(clstrsz - 1)); in round_clstr()
139 u_int clstrsz, l1idx, l2idx; in qcow_write() local
144 clstrsz = 1U << clstr_log2sz; in qcow_write()
145 blk_clstrsz = clstrsz / secsz; in qcow_write()
174 hdr = calloc(1, clstrsz); in qcow_write()
187 be64enc(&hdr->u.v1.l1_offset, clstrsz * l1clno); in qcow_write()
195 be64enc(&hdr->u.v2.l1_offset, clstrsz * l1clno); in qcow_write()
196 be64enc(&hdr->u.v2.refcnt_offset, clstrsz * rcclno); in qcow_write()
204 if (sparse_write(fd, hdr, clstrsz) < 0) { in qcow_write()
212 ofs = clstrsz * l2clno; in qcow_write()
215 l1tbl = calloc(clstr_l1tblsz, clstrsz); in qcow_write()
228 ofs += clstrsz; in qcow_write()
234 if (sparse_write(fd, l1tbl, clstrsz * clstr_l1tblsz) < 0) { in qcow_write()
246 rctbl = calloc(clstr_rctblsz, clstrsz); in qcow_write()
253 ofs += clstrsz; in qcow_write()
256 if (sparse_write(fd, rctbl, clstrsz * clstr_rctblsz) < 0) { in qcow_write()
264 l2tbl = malloc(clstrsz); in qcow_write()
273 memset(l2tbl, 0, clstrsz); in qcow_write()
274 blkofs = (lba_t)l1idx * blk_clstrsz * (clstrsz >> 3); in qcow_write()
275 for (l2idx = 0; l2idx < (clstrsz >> 3); l2idx++) { in qcow_write()
281 ofs += clstrsz; in qcow_write()
284 if (sparse_write(fd, l2tbl, clstrsz) < 0) { in qcow_write()
296 rcblk = calloc(clstr_rcblks, clstrsz); in qcow_write()
303 if (sparse_write(fd, rcblk, clstrsz * clstr_rcblks) < 0) { in qcow_write()