btrfs: open code extent_read_full_page to its sole caller
This makes reading the code a tad easier by decreasing the level of indirection by one. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
fd513000eb
commit
0f20881249
@@ -3141,9 +3141,9 @@ __get_extent_map(struct inode *inode, struct page *page, size_t pg_offset,
|
||||
* XXX JDM: This needs looking at to ensure proper page locking
|
||||
* return 0 on success, otherwise return error
|
||||
*/
|
||||
static int __do_readpage(struct page *page, struct extent_map **em_cached,
|
||||
struct bio **bio, unsigned long *bio_flags,
|
||||
unsigned int read_flags, u64 *prev_em_start)
|
||||
int btrfs_do_readpage(struct page *page, struct extent_map **em_cached,
|
||||
struct bio **bio, unsigned long *bio_flags,
|
||||
unsigned int read_flags, u64 *prev_em_start)
|
||||
{
|
||||
struct inode *inode = page->mapping->host;
|
||||
u64 start = page_offset(page);
|
||||
@@ -3358,26 +3358,12 @@ static inline void contiguous_readpages(struct page *pages[], int nr_pages,
|
||||
btrfs_lock_and_flush_ordered_range(inode, start, end, NULL);
|
||||
|
||||
for (index = 0; index < nr_pages; index++) {
|
||||
__do_readpage(pages[index], em_cached, bio, bio_flags,
|
||||
REQ_RAHEAD, prev_em_start);
|
||||
btrfs_do_readpage(pages[index], em_cached, bio, bio_flags,
|
||||
REQ_RAHEAD, prev_em_start);
|
||||
put_page(pages[index]);
|
||||
}
|
||||
}
|
||||
|
||||
int extent_read_full_page(struct page *page, struct bio **bio,
|
||||
unsigned long *bio_flags)
|
||||
{
|
||||
struct btrfs_inode *inode = BTRFS_I(page->mapping->host);
|
||||
u64 start = page_offset(page);
|
||||
u64 end = start + PAGE_SIZE - 1;
|
||||
int ret;
|
||||
|
||||
btrfs_lock_and_flush_ordered_range(inode, start, end, NULL);
|
||||
|
||||
ret = __do_readpage(page, NULL, bio, bio_flags, 0, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void update_nr_written(struct writeback_control *wbc,
|
||||
unsigned long nr_written)
|
||||
{
|
||||
|
Reference in New Issue
Block a user