Skip to content

Commit

Permalink
Btrfs: Make sure bio pages are adjacent during bulk csumming
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 6885f30 commit 2e1a992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
unsigned long map_len;
unsigned long map_start;


path = btrfs_alloc_path();
BUG_ON(!path);
again:
Expand Down Expand Up @@ -315,8 +314,11 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
if (bio_index < bio->bi_vcnt) {
item = (struct btrfs_csum_item *)((char *)item +
BTRFS_CRC32_SIZE);
if (item < item_end)
if (item < item_end && offset + PAGE_CACHE_SIZE ==
page_offset(bvec->bv_page)) {
offset = page_offset(bvec->bv_page);
goto next_bvec;
}
}
if (eb_token) {
unmap_extent_buffer(leaf, eb_token, KM_IRQ1);
Expand Down

0 comments on commit 2e1a992

Please sign in to comment.