diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-02-20 15:44:32 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:00 -0400 |
commit | 2e1a992e3103624af48f1501aaad4e4d8317f88c (patch) | |
tree | 51e9107af5ffabfce1b2b366a8e3ecbd234a24e5 /fs/btrfs/file-item.c | |
parent | 6885f308b557020efce6ef9c1fcc96adaabecbb6 (diff) |
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.c | 6 |
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, | |||
161 | unsigned long map_len; | 161 | unsigned long map_len; |
162 | unsigned long map_start; | 162 | unsigned long map_start; |
163 | 163 | ||
164 | |||
165 | path = btrfs_alloc_path(); | 164 | path = btrfs_alloc_path(); |
166 | BUG_ON(!path); | 165 | BUG_ON(!path); |
167 | again: | 166 | again: |
@@ -315,8 +314,11 @@ next_bvec: | |||
315 | if (bio_index < bio->bi_vcnt) { | 314 | if (bio_index < bio->bi_vcnt) { |
316 | item = (struct btrfs_csum_item *)((char *)item + | 315 | item = (struct btrfs_csum_item *)((char *)item + |
317 | BTRFS_CRC32_SIZE); | 316 | BTRFS_CRC32_SIZE); |
318 | if (item < item_end) | 317 | if (item < item_end && offset + PAGE_CACHE_SIZE == |
318 | page_offset(bvec->bv_page)) { | ||
319 | offset = page_offset(bvec->bv_page); | ||
319 | goto next_bvec; | 320 | goto next_bvec; |
321 | } | ||
320 | } | 322 | } |
321 | if (eb_token) { | 323 | if (eb_token) { |
322 | unmap_extent_buffer(leaf, eb_token, KM_IRQ1); | 324 | unmap_extent_buffer(leaf, eb_token, KM_IRQ1); |