Btrfs: remove btrfs_sector_sum structure
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 19 Jun 2013 02:36:09 +0000 (10:36 +0800)
committerJosef Bacik <jbacik@fusionio.com>
Tue, 2 Jul 2013 15:50:47 +0000 (11:50 -0400)
commitf51a4a1826ff810eb9c00cadff8978b028c40756
tree20185a1b681194a39513f346f72e6d8ef605b8e1
parent7ee9e4405f264e9eda808aa5ca4522746a1af9c1
Btrfs: remove btrfs_sector_sum structure

Using the structure btrfs_sector_sum to keep the checksum value is
unnecessary, because the extents that btrfs_sector_sum points to are
continuous, we can find out the expected checksums by btrfs_ordered_sum's
bytenr and the offset, so we can remove btrfs_sector_sum's bytenr. After
removing bytenr, there is only one member in the structure, so it makes
no sense to keep the structure, just remove it, and use a u32 array to
store the checksum value.

By this change, we don't use the while loop to get the checksums one by
one. Now, we can get several checksum value at one time, it improved the
performance by ~74% on my SSD (31MB/s -> 54MB/s).

test command:
 # dd if=/dev/zero of=/mnt/btrfs/file0 bs=1M count=1024 oflag=sync

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/file-item.c
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.h
fs/btrfs/relocation.c
fs/btrfs/scrub.c
This page took 0.025674 seconds and 5 git commands to generate.