add patch rename-ext4_xattr_check_names-to-ext4_xattr_check_entries
[ext4-patch-queue.git] / dont-allocate-io_end-for-writeback-from-ext4_writepage
blobd65ccca7dfc2b719d33c25586f36490b2e30442e
1 ext4: don't allocate io_end for writeback from ext4_writepage()
3 From: Jan Kara <jack@suse.cz>
5 ext4_writepage() writes out only mapped buffers with allocated
6 underlying blocks. Thus there's no need for io_end structure
7 and we can avoid allocating it.
9 Signed-off-by: Jan Kara <jack@suse.cz>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 ---
12  fs/ext4/inode.c | 8 --------
13  1 file changed, 8 deletions(-)
15 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
16 index 4247d8d25687..baa87e7d1426 100644
17 --- a/fs/ext4/inode.c
18 +++ b/fs/ext4/inode.c
19 @@ -2107,16 +2107,8 @@ static int ext4_writepage(struct page *page,
20                 return __ext4_journalled_writepage(page, len);
22         ext4_io_submit_init(&io_submit, wbc);
23 -       io_submit.io_end = ext4_init_io_end(inode, GFP_NOFS);
24 -       if (!io_submit.io_end) {
25 -               redirty_page_for_writepage(wbc, page);
26 -               unlock_page(page);
27 -               return -ENOMEM;
28 -       }
29         ret = ext4_bio_write_page(&io_submit, page, len, wbc, keep_towrite);
30         ext4_io_submit(&io_submit);
31 -       /* Drop io_end reference we got from init */
32 -       ext4_put_io_end_defer(io_submit.io_end);
33         return ret;
34  }
36 -- 
37 2.12.0