From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/3] btrfs: Remove extent_page_data argument from writepage_delalloc
Date: Thu, 8 Nov 2018 10:18:07 +0200 [thread overview]
Message-ID: <20181108081808.16920-3-nborisov@suse.com> (raw)
In-Reply-To: <20181108081808.16920-1-nborisov@suse.com>
The only remaining use of the 'epd' argument in writepage_delalloc is
to reference the extent_io_tree which was set in extent_writepages. Since
it is guaranteed that page->mapping of any page passed to
writepage_delalloc (and __extent_writepage as the sole caller) to be
equal to that passed in extent_writepages we can directly get the
io_tree via the already passed inode (which is also taken from
page->mapping->host). No functional changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/extent_io.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index e1ce07b2d33a..cca9d3cbe74a 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3202,12 +3202,12 @@ static void update_nr_written(struct writeback_control *wbc,
* This returns < 0 if there were errors (page still locked)
*/
static noinline_for_stack int writepage_delalloc(struct inode *inode,
- struct page *page, struct writeback_control *wbc,
- struct extent_page_data *epd,
- u64 delalloc_start,
- unsigned long *nr_written)
+ struct page *page,
+ struct writeback_control *wbc,
+ u64 delalloc_start,
+ unsigned long *nr_written)
{
- struct extent_io_tree *tree = epd->tree;
+ struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
u64 page_end = delalloc_start + PAGE_SIZE - 1;
u64 nr_delalloc;
u64 delalloc_to_write = 0;
@@ -3471,8 +3471,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
set_page_extent_mapped(page);
if (!epd->extent_locked) {
- ret = writepage_delalloc(inode, page, wbc, epd, start,
- &nr_written);
+ ret = writepage_delalloc(inode, page, wbc, start, &nr_written);
if (ret == 1)
goto done_unlocked;
if (ret)
--
2.17.1
next prev parent reply other threads:[~2018-11-08 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 8:18 [PATCH 0/3] Cleanups following optional extent_io_ops callbacks removal Nikolay Borisov
2018-11-08 8:18 ` [PATCH 1/3] btrfs: Move epd::extent_locked check to writepage_delalloc's caller Nikolay Borisov
2018-11-08 8:18 ` Nikolay Borisov [this message]
2018-11-08 8:18 ` [PATCH 3/3] btrfs: Remove unused extent_state argument from btrfs_writepage_endio_finish_ordered Nikolay Borisov
2018-11-12 19:02 ` David Sterba
2018-11-12 18:58 ` [PATCH 0/3] Cleanups following optional extent_io_ops callbacks removal David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181108081808.16920-3-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox