Lines Matching refs:extent
156 static void dbg_print_extent(char *desc, struct ext2fs_extent *extent) in dbg_print_extent() argument
161 extent->e_lblk, extent->e_lblk + extent->e_len - 1, in dbg_print_extent()
162 extent->e_len, extent->e_pblk); in dbg_print_extent()
163 if (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF) in dbg_print_extent()
165 if (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT) in dbg_print_extent()
167 if (extent->e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT) in dbg_print_extent()
169 if (!extent->e_flags) in dbg_print_extent()
253 struct ext2fs_extent extent; in ext2fs_punch_extent() local
275 retval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent); in ext2fs_punch_extent()
283 dbg_print_extent("main loop", &extent); in ext2fs_punch_extent()
284 next = extent.e_lblk + extent.e_len; in ext2fs_punch_extent()
289 if (start <= extent.e_lblk) { in ext2fs_punch_extent()
290 if (end < extent.e_lblk) in ext2fs_punch_extent()
295 free_start = extent.e_pblk; in ext2fs_punch_extent()
296 lfree_start = extent.e_lblk; in ext2fs_punch_extent()
298 free_count = end - extent.e_lblk + 1; in ext2fs_punch_extent()
300 free_count = extent.e_len; in ext2fs_punch_extent()
301 extent.e_len -= free_count; in ext2fs_punch_extent()
302 extent.e_lblk += free_count; in ext2fs_punch_extent()
303 extent.e_pblk += free_count; in ext2fs_punch_extent()
310 newlen = start - extent.e_lblk; in ext2fs_punch_extent()
311 free_start = extent.e_pblk + newlen; in ext2fs_punch_extent()
312 lfree_start = extent.e_lblk + newlen; in ext2fs_punch_extent()
313 free_count = extent.e_len - newlen; in ext2fs_punch_extent()
314 extent.e_len = newlen; in ext2fs_punch_extent()
320 newex.e_pblk = extent.e_pblk + in ext2fs_punch_extent()
321 (end + 1 - extent.e_lblk); in ext2fs_punch_extent()
324 newex.e_flags = extent.e_flags; in ext2fs_punch_extent()
326 extent.e_len = start - extent.e_lblk; in ext2fs_punch_extent()
327 free_start = extent.e_pblk + extent.e_len; in ext2fs_punch_extent()
328 lfree_start = extent.e_lblk + extent.e_len; in ext2fs_punch_extent()
343 if (extent.e_len) { in ext2fs_punch_extent()
344 dbg_print_extent("replacing", &extent); in ext2fs_punch_extent()
345 retval = ext2fs_extent_replace(handle, 0, &extent); in ext2fs_punch_extent()
394 &extent); in ext2fs_punch_extent()