struct block_device *bdev;
struct bio *comp_bio;
u64 cur_disk_byte = (u64)bio->bi_sector << 9;
- u64 em_len;
struct extent_map *em;
int ret;
cb->errors = 0;
cb->inode = inode;
- cb->start = em->start;
+ cb->start = em->orig_start;
compressed_len = em->block_len;
- em_len = em->len;
free_extent_map(em);
cb->len = uncompressed_len;
}
cb->nr_pages = nr_pages;
- add_ra_bio_pages(inode, cb->start + em_len, cb);
+ add_ra_bio_pages(inode, em->start + em->len, cb);
if (!btrfs_test_opt(root, NODATASUM) &&
!btrfs_test_flag(inode, NODATASUM)) {
/* all of these are in bytes */
u64 start;
u64 len;
+ u64 orig_start;
u64 block_start;
u64 block_len;
unsigned long flags;
em->start < start) {
split->start = em->start;
split->len = start - em->start;
+ split->orig_start = em->orig_start;
split->block_start = em->block_start;
if (compressed)
split->start = start + len;
split->len = em->start + em->len - (start + len);
+ split->orig_start = em->orig_start;
split->bdev = em->bdev;
split->flags = flags;
found_type == BTRFS_FILE_EXTENT_PREALLOC) {
em->start = extent_start;
em->len = extent_end - extent_start;
+ em->orig_start = extent_start -
+ btrfs_file_extent_offset(leaf, item);
bytenr = btrfs_file_extent_disk_bytenr(leaf, item);
if (bytenr == 0) {
em->block_start = EXTENT_MAP_HOLE;
em->start = extent_start + extent_offset;
em->len = (copy_size + root->sectorsize - 1) &
~((u64)root->sectorsize - 1);
+ em->orig_start = EXTENT_MAP_INLINE;
if (compressed)
set_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
ptr = btrfs_file_extent_inline_start(item) + extent_offset;