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/ctree.h | |
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/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 086cb0525cd1..92d892f92075 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1142,11 +1142,9 @@ int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans, | |||
1142 | struct btrfs_root *root, | 1142 | struct btrfs_root *root, |
1143 | struct btrfs_path *path, u64 objectid, | 1143 | struct btrfs_path *path, u64 objectid, |
1144 | u64 bytenr, int mod); | 1144 | u64 bytenr, int mod); |
1145 | int btrfs_csum_file_block(struct btrfs_trans_handle *trans, | 1145 | int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, |
1146 | struct btrfs_root *root, | 1146 | struct btrfs_root *root, struct inode *inode, |
1147 | struct inode *inode, | 1147 | struct bio *bio); |
1148 | u64 objectid, u64 offset, | ||
1149 | char *data, size_t len); | ||
1150 | struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, | 1148 | struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, |
1151 | struct btrfs_root *root, | 1149 | struct btrfs_root *root, |
1152 | struct btrfs_path *path, | 1150 | struct btrfs_path *path, |