diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-11-26 19:15:16 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | 015a739c7c238768fbfa4eea8ea2ebc1a35e7bb1 (patch) | |
tree | 837d361510ce5fa58c0f9c4535ea497cfd359c56 /fs/btrfs/extent_map.c | |
parent | eef1c494a2d4212e13c67d05e9cc3cd1e6dfed5d (diff) |
Btrfs: Handle writeback under high memory pressure better
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index a4e9096754fc..55f272c335c6 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -1861,13 +1861,25 @@ int extent_write_full_page(struct extent_map_tree *tree, struct page *page, | |||
1861 | struct writeback_control *wbc) | 1861 | struct writeback_control *wbc) |
1862 | { | 1862 | { |
1863 | int ret; | 1863 | int ret; |
1864 | struct address_space *mapping = page->mapping; | ||
1864 | struct extent_page_data epd = { | 1865 | struct extent_page_data epd = { |
1865 | .bio = NULL, | 1866 | .bio = NULL, |
1866 | .tree = tree, | 1867 | .tree = tree, |
1867 | .get_extent = get_extent, | 1868 | .get_extent = get_extent, |
1868 | }; | 1869 | }; |
1870 | struct writeback_control wbc_writepages = { | ||
1871 | .bdi = wbc->bdi, | ||
1872 | .sync_mode = WB_SYNC_NONE, | ||
1873 | .older_than_this = NULL, | ||
1874 | .nr_to_write = 64, | ||
1875 | .range_start = page_offset(page) + PAGE_CACHE_SIZE, | ||
1876 | .range_end = (loff_t)-1, | ||
1877 | }; | ||
1878 | |||
1869 | 1879 | ||
1870 | ret = __extent_writepage(page, wbc, &epd); | 1880 | ret = __extent_writepage(page, wbc, &epd); |
1881 | |||
1882 | write_cache_pages(mapping, &wbc_writepages, __extent_writepage, &epd); | ||
1871 | if (epd.bio) | 1883 | if (epd.bio) |
1872 | submit_one_bio(WRITE, epd.bio); | 1884 | submit_one_bio(WRITE, epd.bio); |
1873 | return ret; | 1885 | return ret; |