summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-11-26 16:15:16 -0800
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit015a739c7c238768fbfa4eea8ea2ebc1a35e7bb1 (patch)
tree837d361510ce5fa58c0f9c4535ea497cfd359c56 /fs/btrfs/extent_map.c
parenteef1c494a2d4212e13c67d05e9cc3cd1e6dfed5d (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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index a4e9096754f..55f272c335c 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,
struct writeback_control *wbc)
{
int ret;
+ struct address_space *mapping = page->mapping;
struct extent_page_data epd = {
.bio = NULL,
.tree = tree,
.get_extent = get_extent,
};
+ struct writeback_control wbc_writepages = {
+ .bdi = wbc->bdi,
+ .sync_mode = WB_SYNC_NONE,
+ .older_than_this = NULL,
+ .nr_to_write = 64,
+ .range_start = page_offset(page) + PAGE_CACHE_SIZE,
+ .range_end = (loff_t)-1,
+ };
+
ret = __extent_writepage(page, wbc, &epd);
+
+ write_cache_pages(mapping, &wbc_writepages, __extent_writepage, &epd);
if (epd.bio)
submit_one_bio(WRITE, epd.bio);
return ret;