]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/btrfs/inode.c
Btrfs: checksum file data at bio submission time instead of during writepage
authorChris Mason <chris.mason@oracle.com>
Wed, 20 Feb 2008 17:07:25 +0000 (12:07 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:00 +0000 (11:04 -0400)
commit065631f6dccea07bfad48d8981369f6d9cfd6e2b
treed9d5736f61d225d0418cf298092ac36fbe6099e2
parent0740c82bc7585a23e100c9a59d5e2abbf99459fb
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>
fs/btrfs/ctree.h
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/file-item.c
fs/btrfs/inode.c