Fix btrfs_get_extent and get_block corner cases, and disable O_DIRECT reads

The generic O_DIRECT code assumes all the bios have the same bdev,
which isn't true for multi-device btrfs.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-04-22 13:26:46 -04:00
parent 409c6118d3
commit e1c4b7451e
3 changed files with 25 additions and 14 deletions

View File

@@ -1161,7 +1161,6 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
int total_devs = 1;
length = bio->bi_size;
map_tree = &root->fs_info->mapping_tree;
map_length = length;
@@ -1192,6 +1191,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
}
bio->bi_sector = multi->stripes[dev_nr].physical >> 9;
dev = multi->stripes[dev_nr].dev;
bio->bi_bdev = dev->bdev;
spin_lock(&dev->io_lock);
dev->total_ios++;