Commit e940e9a7 authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: rename page_size to io_size in submit_extent_page

The variable @page_size in submit_extent_page() is not related to page
size.

It can already be smaller than PAGE_SIZE, so rename it to io_size to
reduce confusion, this is especially important for later subpage
support.
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8b8bbd46
......@@ -3044,7 +3044,7 @@ static int submit_extent_page(unsigned int opf,
{
int ret = 0;
struct bio *bio;
size_t page_size = min_t(size_t, size, PAGE_SIZE);
size_t io_size = min_t(size_t, size, PAGE_SIZE);
sector_t sector = offset >> 9;
struct extent_io_tree *tree = &BTRFS_I(page->mapping->host)->io_tree;
......@@ -3060,12 +3060,12 @@ static int submit_extent_page(unsigned int opf,
else
contig = bio_end_sector(bio) == sector;
if (btrfs_bio_fits_in_stripe(page, page_size, bio, bio_flags))
if (btrfs_bio_fits_in_stripe(page, io_size, bio, bio_flags))
can_merge = false;
if (prev_bio_flags != bio_flags || !contig || !can_merge ||
force_bio_submit ||
bio_add_page(bio, page, page_size, pg_offset) < page_size) {
bio_add_page(bio, page, io_size, pg_offset) < io_size) {
ret = submit_one_bio(bio, mirror_num, prev_bio_flags);
if (ret < 0) {
*bio_ret = NULL;
......@@ -3074,13 +3074,13 @@ static int submit_extent_page(unsigned int opf,
bio = NULL;
} else {
if (wbc)
wbc_account_cgroup_owner(wbc, page, page_size);
wbc_account_cgroup_owner(wbc, page, io_size);
return 0;
}
}
bio = btrfs_bio_alloc(offset);
bio_add_page(bio, page, page_size, pg_offset);
bio_add_page(bio, page, io_size, pg_offset);
bio->bi_end_io = end_io_func;
bio->bi_private = tree;
bio->bi_write_hint = page->mapping->host->i_write_hint;
......@@ -3091,7 +3091,7 @@ static int submit_extent_page(unsigned int opf,
bdev = BTRFS_I(page->mapping->host)->root->fs_info->fs_devices->latest_bdev;
bio_set_dev(bio, bdev);
wbc_init_bio(wbc, bio);
wbc_account_cgroup_owner(wbc, page, page_size);
wbc_account_cgroup_owner(wbc, page, io_size);
}
*bio_ret = bio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment