diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-09-14 14:39:16 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-10-07 12:13:21 +0200 |
commit | 0f208812493f4ce17910633ad3f7f3b7c8c35cd3 (patch) | |
tree | 06c991d1672507df10dea5b609d9be189c96cb4c /fs/btrfs/inode.c | |
parent | fd513000eb279347df1f5a7ce720ae66b4ac3b1b (diff) | |
download | lwn-0f208812493f4ce17910633ad3f7f3b7c8c35cd3.tar.gz lwn-0f208812493f4ce17910633ad3f7f3b7c8c35cd3.zip |
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4b40d9703be6..c5b24a029eb3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8040,11 +8040,16 @@ static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, int btrfs_readpage(struct file *file, struct page *page) { - struct bio *bio = NULL; + struct btrfs_inode *inode = BTRFS_I(page->mapping->host); + u64 start = page_offset(page); + u64 end = start + PAGE_SIZE - 1; unsigned long bio_flags = 0; + struct bio *bio = NULL; int ret; - ret = extent_read_full_page(page, &bio, &bio_flags); + btrfs_lock_and_flush_ordered_range(inode, start, end, NULL); + + ret = btrfs_do_readpage(page, NULL, &bio, &bio_flags, 0, NULL); if (bio) ret = submit_one_bio(bio, 0, bio_flags); return ret; |