Btrfs: cut down stack usage in btree_write_cache_pages
authorChris Mason <clm@fb.com>
Tue, 20 May 2014 03:55:27 +0000 (20:55 -0700)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:56 +0000 (17:20 -0700)
This adds noinline_for_stack to two helpers used by
btree_write_cache_pages.  It shaves us down from 424 bytes on the
stack to 280.

Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent_io.c

index 0f425dea4523cca91c680e0684f165cfaaa9ff5f..51299c261d56d9839b74552098b0a7341aaf56a5 100644 (file)
@@ -3393,9 +3393,10 @@ void wait_on_extent_buffer_writeback(struct extent_buffer *eb)
                    TASK_UNINTERRUPTIBLE);
 }
 
-static int lock_extent_buffer_for_io(struct extent_buffer *eb,
-                                    struct btrfs_fs_info *fs_info,
-                                    struct extent_page_data *epd)
+static noinline_for_stack int
+lock_extent_buffer_for_io(struct extent_buffer *eb,
+                         struct btrfs_fs_info *fs_info,
+                         struct extent_page_data *epd)
 {
        unsigned long i, num_pages;
        int flush = 0;
@@ -3500,7 +3501,7 @@ static void end_bio_extent_buffer_writepage(struct bio *bio, int err)
        bio_put(bio);
 }
 
-static int write_one_eb(struct extent_buffer *eb,
+static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
                        struct btrfs_fs_info *fs_info,
                        struct writeback_control *wbc,
                        struct extent_page_data *epd)