summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-02-20 21:44:32 +0100
committerChris Mason <chris.mason@oracle.com>2008-09-25 17:04:00 +0200
commit2e1a992e3103624af48f1501aaad4e4d8317f88c (patch)
tree51e9107af5ffabfce1b2b366a8e3ecbd234a24e5 /fs/btrfs/file-item.c
parentBtrfs: Misc 2.6.25 updates (diff)
downloadlinux-2e1a992e3103624af48f1501aaad4e4d8317f88c.tar.xz
linux-2e1a992e3103624af48f1501aaad4e4d8317f88c.zip
Btrfs: Make sure bio pages are adjacent during bulk csumming
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index ee25e50e7c04..e17cce33fe95 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -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:
@@ -315,8 +314,11 @@ next_bvec:
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);