diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-02-20 14:06:05 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-20 14:06:05 -0500 |
commit | e942f883bc6651d50be139477baf6fb0eed3d5bb (patch) | |
tree | e1d19783e9c8b42198a69c17c9719fb90f302847 /fs/btrfs/inode.c | |
parent | b2c6b3e0611c58fbeb6b9c0892b6249f7bdfaf6b (diff) | |
parent | 0e4e02636611dbf89a2f36320a32054f9936d6cb (diff) |
Merge branch 'raid56-experimental' into for-linus-3.9
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Conflicts:
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/volumes.c
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1aa98be54ce0..4e6a11c2cfdd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/ratelimit.h> | 40 | #include <linux/ratelimit.h> |
41 | #include <linux/mount.h> | 41 | #include <linux/mount.h> |
42 | #include <linux/btrfs.h> | 42 | #include <linux/btrfs.h> |
43 | #include <linux/blkdev.h> | ||
43 | #include "compat.h" | 44 | #include "compat.h" |
44 | #include "ctree.h" | 45 | #include "ctree.h" |
45 | #include "disk-io.h" | 46 | #include "disk-io.h" |
@@ -1605,7 +1606,7 @@ static void btrfs_clear_bit_hook(struct inode *inode, | |||
1605 | * extent_io.c merge_bio_hook, this must check the chunk tree to make sure | 1606 | * extent_io.c merge_bio_hook, this must check the chunk tree to make sure |
1606 | * we don't create bios that span stripes or chunks | 1607 | * we don't create bios that span stripes or chunks |
1607 | */ | 1608 | */ |
1608 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | 1609 | int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, |
1609 | size_t size, struct bio *bio, | 1610 | size_t size, struct bio *bio, |
1610 | unsigned long bio_flags) | 1611 | unsigned long bio_flags) |
1611 | { | 1612 | { |
@@ -1620,7 +1621,7 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | |||
1620 | 1621 | ||
1621 | length = bio->bi_size; | 1622 | length = bio->bi_size; |
1622 | map_length = length; | 1623 | map_length = length; |
1623 | ret = btrfs_map_block(root->fs_info, READ, logical, | 1624 | ret = btrfs_map_block(root->fs_info, rw, logical, |
1624 | &map_length, NULL, 0); | 1625 | &map_length, NULL, 0); |
1625 | /* Will always return 0 with map_multi == NULL */ | 1626 | /* Will always return 0 with map_multi == NULL */ |
1626 | BUG_ON(ret < 0); | 1627 | BUG_ON(ret < 0); |
@@ -6464,19 +6465,24 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, | |||
6464 | int async_submit = 0; | 6465 | int async_submit = 0; |
6465 | 6466 | ||
6466 | map_length = orig_bio->bi_size; | 6467 | map_length = orig_bio->bi_size; |
6467 | ret = btrfs_map_block(root->fs_info, READ, start_sector << 9, | 6468 | ret = btrfs_map_block(root->fs_info, rw, start_sector << 9, |
6468 | &map_length, NULL, 0); | 6469 | &map_length, NULL, 0); |
6469 | if (ret) { | 6470 | if (ret) { |
6470 | bio_put(orig_bio); | 6471 | bio_put(orig_bio); |
6471 | return -EIO; | 6472 | return -EIO; |
6472 | } | 6473 | } |
6473 | |||
6474 | if (map_length >= orig_bio->bi_size) { | 6474 | if (map_length >= orig_bio->bi_size) { |
6475 | bio = orig_bio; | 6475 | bio = orig_bio; |
6476 | goto submit; | 6476 | goto submit; |
6477 | } | 6477 | } |
6478 | 6478 | ||
6479 | async_submit = 1; | 6479 | /* async crcs make it difficult to collect full stripe writes. */ |
6480 | if (btrfs_get_alloc_profile(root, 1) & | ||
6481 | (BTRFS_BLOCK_GROUP_RAID5 | BTRFS_BLOCK_GROUP_RAID6)) | ||
6482 | async_submit = 0; | ||
6483 | else | ||
6484 | async_submit = 1; | ||
6485 | |||
6480 | bio = btrfs_dio_bio_alloc(orig_bio->bi_bdev, start_sector, GFP_NOFS); | 6486 | bio = btrfs_dio_bio_alloc(orig_bio->bi_bdev, start_sector, GFP_NOFS); |
6481 | if (!bio) | 6487 | if (!bio) |
6482 | return -ENOMEM; | 6488 | return -ENOMEM; |
@@ -6518,7 +6524,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, | |||
6518 | bio->bi_end_io = btrfs_end_dio_bio; | 6524 | bio->bi_end_io = btrfs_end_dio_bio; |
6519 | 6525 | ||
6520 | map_length = orig_bio->bi_size; | 6526 | map_length = orig_bio->bi_size; |
6521 | ret = btrfs_map_block(root->fs_info, READ, | 6527 | ret = btrfs_map_block(root->fs_info, rw, |
6522 | start_sector << 9, | 6528 | start_sector << 9, |
6523 | &map_length, NULL, 0); | 6529 | &map_length, NULL, 0); |
6524 | if (ret) { | 6530 | if (ret) { |