diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2017-08-24 20:19:48 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-09-26 08:48:14 -0400 |
commit | ff40adf7fbdff96860b1153332c0b1c7bab6e0c1 (patch) | |
tree | 1d4dab82592fbe67b656e41c401d860efc6fd618 | |
parent | db95c876c568cef951fbbd4c0118cb5386e4bb99 (diff) |
Btrfs: use the new helper wbc_to_write_flags
This updates btrfs to use the helper wbc_to_write_flags which has been
applied in ext4/xfs/f2fs/block.
Please note that, with this, btrfs's dirty pages written by a
writeback job will carry the flag REQ_BACKGROUND, which is currently
used by writeback-throttle to determine whether it should go to get a
request or wait.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d17783d70228..4ead6da5a645 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -3471,8 +3471,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc, | |||
3471 | unsigned int write_flags = 0; | 3471 | unsigned int write_flags = 0; |
3472 | unsigned long nr_written = 0; | 3472 | unsigned long nr_written = 0; |
3473 | 3473 | ||
3474 | if (wbc->sync_mode == WB_SYNC_ALL) | 3474 | write_flags = wbc_to_write_flags(wbc); |
3475 | write_flags = REQ_SYNC; | ||
3476 | 3475 | ||
3477 | trace___extent_writepage(page, inode, wbc); | 3476 | trace___extent_writepage(page, inode, wbc); |
3478 | 3477 | ||
@@ -3718,7 +3717,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, | |||
3718 | unsigned long i, num_pages; | 3717 | unsigned long i, num_pages; |
3719 | unsigned long bio_flags = 0; | 3718 | unsigned long bio_flags = 0; |
3720 | unsigned long start, end; | 3719 | unsigned long start, end; |
3721 | unsigned int write_flags = (epd->sync_io ? REQ_SYNC : 0) | REQ_META; | 3720 | unsigned int write_flags = wbc_to_write_flags(wbc) | REQ_META; |
3722 | int ret = 0; | 3721 | int ret = 0; |
3723 | 3722 | ||
3724 | clear_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags); | 3723 | clear_bit(EXTENT_BUFFER_WRITE_ERR, &eb->bflags); |