From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 7/8] btrfs: sink arugment tree to contiguous_readpages
Date: Wed, 5 Feb 2020 19:09:40 +0100 [thread overview]
Message-ID: <02eb803895120f3c2bf85eb7f8fc79c7e1b3f6a6.1580925977.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1580925977.git.dsterba@suse.com>
The tree pointer can be safely read from the inode, use it and drop the
redundant argument.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/extent_io.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 015993ccf333..157a0cf0b492 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3281,8 +3281,7 @@ static int __do_readpage(struct extent_io_tree *tree,
return ret;
}
-static inline void contiguous_readpages(struct extent_io_tree *tree,
- struct page *pages[], int nr_pages,
+static inline void contiguous_readpages(struct page *pages[], int nr_pages,
u64 start, u64 end,
struct extent_map **em_cached,
struct bio **bio,
@@ -3290,10 +3289,9 @@ static inline void contiguous_readpages(struct extent_io_tree *tree,
u64 *prev_em_start)
{
struct btrfs_inode *inode = BTRFS_I(pages[0]->mapping->host);
+ struct extent_io_tree *tree = &inode->io_tree;
int index;
- ASSERT(tree == &inode->io_tree);
-
btrfs_lock_and_flush_ordered_range(inode, start, end, NULL);
for (index = 0; index < nr_pages; index++) {
@@ -4292,7 +4290,6 @@ int extent_readpages(struct address_space *mapping, struct list_head *pages,
unsigned long bio_flags = 0;
struct page *pagepool[16];
struct extent_map *em_cached = NULL;
- struct extent_io_tree *tree = &BTRFS_I(mapping->host)->io_tree;
int nr = 0;
u64 prev_em_start = (u64)-1;
@@ -4319,7 +4316,7 @@ int extent_readpages(struct address_space *mapping, struct list_head *pages,
ASSERT(contig_start + nr * PAGE_SIZE - 1 == contig_end);
- contiguous_readpages(tree, pagepool, nr, contig_start,
+ contiguous_readpages(pagepool, nr, contig_start,
contig_end, &em_cached, &bio, &bio_flags,
&prev_em_start);
}
--
2.25.0
next prev parent reply other threads:[~2020-02-05 18:09 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 18:09 [PATCH 0/8] Cleanup io_tree arguments in extent read/write path David Sterba
2020-02-05 18:09 ` [PATCH 1/8] btrfs: remove extent_page_data::tree David Sterba
2020-02-06 8:34 ` Anand Jain
2020-02-06 13:32 ` Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 2/8] btrfs: drop argument tree from submit_extent_page David Sterba
2020-02-06 5:58 ` Anand Jain
2020-02-06 13:47 ` David Sterba
2020-02-11 5:00 ` Anand Jain
2020-02-06 13:33 ` Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 3/8] btrfs: add assertions for tree == inode->io_tree to extent IO helpers David Sterba
2020-02-06 13:34 ` Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 4/8] btrfs: drop argument tree from btrfs_lock_and_flush_ordered_range David Sterba
2020-02-06 13:38 ` Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 5/8] btrfs: sink argument tree to extent_read_full_page David Sterba
2020-02-06 13:40 ` Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 6/8] btrfs: sink argument tree to __extent_read_full_page David Sterba
2020-02-06 13:40 ` Johannes Thumshirn
2020-02-05 18:09 ` David Sterba [this message]
2020-02-06 13:42 ` [PATCH 7/8] btrfs: sink arugment tree to contiguous_readpages Johannes Thumshirn
2020-02-05 18:09 ` [PATCH 8/8] btrfs: sink argument tree to __do_readpage David Sterba
2020-02-06 13:43 ` Johannes Thumshirn
2020-02-06 13:24 ` [PATCH 0/8] Cleanup io_tree arguments in extent read/write path Nikolay Borisov
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=02eb803895120f3c2bf85eb7f8fc79c7e1b3f6a6.1580925977.git.dsterba@suse.com \
--to=dsterba@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