mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
Btrfs: Optimize csum insertion to create larger items when possible
This reduces the number of calls to btrfs_extend_item and greatly lowers the cpu usage while writing large files. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
5ee78ac70f
commit
f578d4bd7e
3 changed files with 38 additions and 2 deletions
|
@ -118,7 +118,7 @@ int btrfs_writepage_io_hook(struct page *page, u64 start, u64 end)
|
|||
trans = btrfs_start_transaction(root, 1);
|
||||
btrfs_set_trans_block_group(trans, inode);
|
||||
kaddr = kmap(page);
|
||||
btrfs_csum_file_block(trans, root, inode->i_ino,
|
||||
btrfs_csum_file_block(trans, root, inode, inode->i_ino,
|
||||
start, kaddr + offset, end - start + 1);
|
||||
kunmap(page);
|
||||
ret = btrfs_end_transaction(trans, root);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue