• Christoph Hellwig's avatar
    btrfs: handle checksum generation in the storage layer · f8a53bb5
    Christoph Hellwig authored
    Instead of letting the callers of btrfs_submit_bio deal with checksumming
    the (meta)data in the bio and making decisions on when to offload the
    checksumming to the bio, leave that to btrfs_submit_bio.  Do do so the
    existing btrfs_submit_bio function is split into an upper and a lower
    half, so that the lower half can be offloaded to a workqueue.
    
    Note that this changes the behavior for direct writes to raid56 volumes so
    that async checksum offloading is not skipped when more I/O is expected.
    This runs counter to the argument explaining why it was done, although I
    can't measure any affects of the change.  Commits later in this series
    will make sure the entire direct writes is offloaded to the workqueue
    at once and thus make sure it is sent to the raid56 code from a single
    thread.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    f8a53bb5
disk-io.h 5.3 KB