]> git.baikalelectronics.ru Git - kernel.git/commit
direct-io: add a hook for the fs to provide its own submit_bio function
authorJosef Bacik <josef@redhat.com>
Sun, 23 May 2010 15:00:55 +0000 (11:00 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 25 May 2010 14:34:55 +0000 (10:34 -0400)
commitb122a5011427e54d76e18983fed034cace0a03b5
tree269200329390f450d2bc7f0858a8ed114a418374
parent0e1c53f0ecb6323efccfe71baf294d05b574b1d5
direct-io: add a hook for the fs to provide its own submit_bio function

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: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/direct-io.c
include/linux/fs.h