diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-02-20 12:07:25 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:00 -0400 |
commit | 065631f6dccea07bfad48d8981369f6d9cfd6e2b (patch) | |
tree | d9d5736f61d225d0418cf298092ac36fbe6099e2 /fs/btrfs/extent_io.c | |
parent | 0740c82bc7585a23e100c9a59d5e2abbf99459fb (diff) |
Btrfs: checksum file data at bio submission time instead of during writepage
When we checkum file data during writepage, the checksumming is done one
page at a time, making it difficult to do bulk metadata modifications
to insert checksums for large ranges of the file at once.
This patch changes btrfs to checksum on a per-bio basis instead. The
bios are checksummed before they are handed off to the block layer, so
each bio is contiguous and only has pages from the same inode.
Checksumming on a bio basis allows us to insert and modify the file
checksum items in large groups. It also allows the checksumming to
be done more easily by async worker threads.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index fb6400895ed6..e8130c876330 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1705,6 +1705,8 @@ static int submit_one_bio(int rw, struct bio *bio) | |||
1705 | (unsigned long long)bio->bi_sector); | 1705 | (unsigned long long)bio->bi_sector); |
1706 | WARN_ON(1); | 1706 | WARN_ON(1); |
1707 | } | 1707 | } |
1708 | if (tree->ops && tree->ops->submit_bio_hook) | ||
1709 | tree->ops->submit_bio_hook(rw, bio); | ||
1708 | 1710 | ||
1709 | submit_bio(rw, bio); | 1711 | submit_bio(rw, bio); |
1710 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) | 1712 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) |