add patch show-more-binary-mount-options
[ext4-patch-queue.git] / use-generic_writepages-instead-of-__writepage-write_cache_pages
blobdf80d688930b5e3126cc9f6c71b533e514cb5457
1 ext4: use generic_writepages instead of __writepage/write_cache_pages
3 From: Goldwyn Rodrigues <rgoldwyn@suse.com>
5 Code cleanup. Instead of writing an internal static function, use the
6 available generic_writepages().
8 Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 ---
11  fs/ext4/inode.c | 15 +--------------
12  1 file changed, 1 insertion(+), 14 deletions(-)
14 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
15 index c94780075b04..97f57769e02a 100644
16 --- a/fs/ext4/inode.c
17 +++ b/fs/ext4/inode.c
18 @@ -2694,15 +2694,6 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
19         return err;
20  }
22 -static int __writepage(struct page *page, struct writeback_control *wbc,
23 -                      void *data)
25 -       struct address_space *mapping = data;
26 -       int ret = ext4_writepage(page, wbc);
27 -       mapping_set_error(mapping, ret);
28 -       return ret;
31  static int ext4_writepages(struct address_space *mapping,
32                            struct writeback_control *wbc)
33  {
34 @@ -2740,11 +2731,7 @@ static int ext4_writepages(struct address_space *mapping,
35                 goto out_writepages;
37         if (ext4_should_journal_data(inode)) {
38 -               struct blk_plug plug;
40 -               blk_start_plug(&plug);
41 -               ret = write_cache_pages(mapping, wbc, __writepage, mapping);
42 -               blk_finish_plug(&plug);
43 +               ret = generic_writepages(mapping, wbc);
44                 goto out_writepages;
45         }