mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
Btrfs: Handle data checksumming on bios that span multiple ordered extents
Data checksumming is done right before the bio is sent down the IO stack, which means a single bio might span more than one ordered extent. In this case, the checksumming data is split between two ordered extents. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
eb84ae039e
commit
3edf7d33f4
5 changed files with 69 additions and 31 deletions
|
@ -351,12 +351,8 @@ int __btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
|
|||
{
|
||||
struct btrfs_root *root = BTRFS_I(inode)->root;
|
||||
int ret = 0;
|
||||
struct btrfs_ordered_sum *sums;
|
||||
|
||||
ret = btrfs_csum_one_bio(root, bio, &sums);
|
||||
BUG_ON(ret);
|
||||
|
||||
ret = btrfs_add_ordered_sum(inode, sums);
|
||||
ret = btrfs_csum_one_bio(root, inode, bio);
|
||||
BUG_ON(ret);
|
||||
|
||||
return btrfs_map_bio(root, rw, bio, mirror_num, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue