diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-04-19 19:49:09 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:55:01 -0400 |
commit | d4c7ca86b59400cdab645b9a974a6ca4ec2f9f62 (patch) | |
tree | d6ccceebdecb0140ec4313ab5cac571920e75f4b /fs/btrfs/extent_io.c | |
parent | 0a3896d0f563d4472c75ab2c26afd8940d24b5a1 (diff) |
Btrfs: use REQ_META for all metadata IO
We need to tag metadata io with REQ_META to avoid priority inversion when using
io throttling cqroups. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 617b5779b95b..2107a06679c5 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2684,7 +2684,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, | |||
2684 | struct page *page, | 2684 | struct page *page, |
2685 | get_extent_t *get_extent, | 2685 | get_extent_t *get_extent, |
2686 | struct bio **bio, int mirror_num, | 2686 | struct bio **bio, int mirror_num, |
2687 | unsigned long *bio_flags) | 2687 | unsigned long *bio_flags, int rw) |
2688 | { | 2688 | { |
2689 | struct inode *inode = page->mapping->host; | 2689 | struct inode *inode = page->mapping->host; |
2690 | u64 start = page_offset(page); | 2690 | u64 start = page_offset(page); |
@@ -2830,7 +2830,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, | |||
2830 | } | 2830 | } |
2831 | 2831 | ||
2832 | pnr -= page->index; | 2832 | pnr -= page->index; |
2833 | ret = submit_extent_page(READ, tree, page, | 2833 | ret = submit_extent_page(rw, tree, page, |
2834 | sector, disk_io_size, pg_offset, | 2834 | sector, disk_io_size, pg_offset, |
2835 | bdev, bio, pnr, | 2835 | bdev, bio, pnr, |
2836 | end_bio_extent_readpage, mirror_num, | 2836 | end_bio_extent_readpage, mirror_num, |
@@ -2863,7 +2863,7 @@ int extent_read_full_page(struct extent_io_tree *tree, struct page *page, | |||
2863 | int ret; | 2863 | int ret; |
2864 | 2864 | ||
2865 | ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num, | 2865 | ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num, |
2866 | &bio_flags); | 2866 | &bio_flags, READ); |
2867 | if (bio) | 2867 | if (bio) |
2868 | ret = submit_one_bio(READ, bio, mirror_num, bio_flags); | 2868 | ret = submit_one_bio(READ, bio, mirror_num, bio_flags); |
2869 | return ret; | 2869 | return ret; |
@@ -3287,7 +3287,7 @@ static int write_one_eb(struct extent_buffer *eb, | |||
3287 | u64 offset = eb->start; | 3287 | u64 offset = eb->start; |
3288 | unsigned long i, num_pages; | 3288 | unsigned long i, num_pages; |
3289 | unsigned long bio_flags = 0; | 3289 | unsigned long bio_flags = 0; |
3290 | int rw = (epd->sync_io ? WRITE_SYNC : WRITE); | 3290 | int rw = (epd->sync_io ? WRITE_SYNC : WRITE) | REQ_META; |
3291 | int ret = 0; | 3291 | int ret = 0; |
3292 | 3292 | ||
3293 | clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags); | 3293 | clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags); |
@@ -3724,14 +3724,14 @@ int extent_readpages(struct extent_io_tree *tree, | |||
3724 | continue; | 3724 | continue; |
3725 | for (i = 0; i < nr; i++) { | 3725 | for (i = 0; i < nr; i++) { |
3726 | __extent_read_full_page(tree, pagepool[i], get_extent, | 3726 | __extent_read_full_page(tree, pagepool[i], get_extent, |
3727 | &bio, 0, &bio_flags); | 3727 | &bio, 0, &bio_flags, READ); |
3728 | page_cache_release(pagepool[i]); | 3728 | page_cache_release(pagepool[i]); |
3729 | } | 3729 | } |
3730 | nr = 0; | 3730 | nr = 0; |
3731 | } | 3731 | } |
3732 | for (i = 0; i < nr; i++) { | 3732 | for (i = 0; i < nr; i++) { |
3733 | __extent_read_full_page(tree, pagepool[i], get_extent, | 3733 | __extent_read_full_page(tree, pagepool[i], get_extent, |
3734 | &bio, 0, &bio_flags); | 3734 | &bio, 0, &bio_flags, READ); |
3735 | page_cache_release(pagepool[i]); | 3735 | page_cache_release(pagepool[i]); |
3736 | } | 3736 | } |
3737 | 3737 | ||
@@ -4703,7 +4703,8 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, | |||
4703 | ClearPageError(page); | 4703 | ClearPageError(page); |
4704 | err = __extent_read_full_page(tree, page, | 4704 | err = __extent_read_full_page(tree, page, |
4705 | get_extent, &bio, | 4705 | get_extent, &bio, |
4706 | mirror_num, &bio_flags); | 4706 | mirror_num, &bio_flags, |
4707 | READ | REQ_META); | ||
4707 | if (err) | 4708 | if (err) |
4708 | ret = err; | 4709 | ret = err; |
4709 | } else { | 4710 | } else { |
@@ -4712,7 +4713,8 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, | |||
4712 | } | 4713 | } |
4713 | 4714 | ||
4714 | if (bio) { | 4715 | if (bio) { |
4715 | err = submit_one_bio(READ, bio, mirror_num, bio_flags); | 4716 | err = submit_one_bio(READ | REQ_META, bio, mirror_num, |
4717 | bio_flags); | ||
4716 | if (err) | 4718 | if (err) |
4717 | return err; | 4719 | return err; |
4718 | } | 4720 | } |