Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129005
b: refs/heads/master
c: ff5b7ee
h: refs/heads/master
i:
  129003: 0cf97a5
v: v3
  • Loading branch information
Yan Zheng authored and Chris Mason committed Nov 10, 2008
1 parent 3ebafe3 commit dcba927
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2b1c41cf94d7f839fe9ede5f3ead92698a93fb3
refs/heads/master: ff5b7ee33d82414bf4baf299c21fb703bcc89629
6 changes: 2 additions & 4 deletions trunk/fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
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;

Expand All @@ -524,9 +523,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
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;
Expand All @@ -545,7 +543,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
}
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)) {
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/btrfs/extent_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct extent_map {
/* all of these are in bytes */
u64 start;
u64 len;
u64 orig_start;
u64 block_start;
u64 block_len;
unsigned long flags;
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
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)
Expand All @@ -243,6 +244,7 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,

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;

Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3949,6 +3949,8 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
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;
Expand Down Expand Up @@ -3988,6 +3990,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
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;
Expand Down

0 comments on commit dcba927

Please sign in to comment.