• Josef Bacik's avatar
    direct-io: add a hook for the fs to provide its own submit_bio function · facd07b0
    Josef Bacik authored
    Because BTRFS can do RAID and such, we need our own submit hook so we can setup
    the bio's in the correct fashion, and handle checksum errors properly.  So there
    are a few changes here
    
    1) The submit_io hook.  This is straightforward, just call this instead of
    submit_bio.
    
    2) Allow the fs to return -ENOTBLK for reads.  Usually this has only worked for
    writes, since writes can fallback onto buffered IO.  But BTRFS needs the option
    of falling back on buffered IO if it encounters a compressed extent, since we
    need to read the entire extent in and decompress it.  So if we get -ENOTBLK back
    from get_block we'll return back and fallback on buffered just like the write
    case.
    
    I've tested these changes with fsx and everything seems to work.  Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    facd07b0
direct-io.c 34.8 KB