[PATCH 1/2] btrfs: switch the page and disk_bytenr argument position for submit_extent_page()

Qu Wenruo
2022-09-12T06:29:07Z

Normally we put (page, pg_len, pg_offset) arguments together, just like
what __bio_add_page() does.

But in submit_extent_page(), what we got is, (page, disk_bytenr, pg_len,
pg_offset), which sometimes can be confusing.

Change the order to (disk_bytenr, page, pg_len, pg_offset) to make it
to follow the common schema.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/extent_io.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index cea7d09c2dc1..dd0697555385 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3356,7 +3356,7 @@ static int alloc_new_bio(struct btrfs_inode *inode,
static int submit_extent_page(blk_opf_t opf,
struct writeback_control *wbc,
struct btrfs_bio_ctrl *bio_ctrl,
- struct page *page, u64 disk_bytenr,
+ u64 disk_bytenr, struct page *page,
size_t size, unsigned long pg_offset,
btrfs_bio_end_io_t end_io_func,
enum btrfs_compression_type compress_type,
@@ -3674,7 +3674,7 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached,
}

ret = submit_extent_page(REQ_OP_READ | read_flags, NULL,
- bio_ctrl, page, disk_bytenr, iosize,
+ bio_ctrl, disk_bytenr, page, iosize,
pg_offset, end_bio_extent_readpage,
this_bio_flag, force_bio_submit);
if (ret) {
@@ -3988,8 +3988,8 @@ static noinline_for_stack int __extent_writepage_io(struct btrfs_inode *inode,
btrfs_page_clear_dirty(fs_info, page, cur, iosize);

ret = submit_extent_page(op | write_flags, wbc,
- &epd->bio_ctrl, page,
- disk_bytenr, iosize,
+ &epd->bio_ctrl, disk_bytenr,
+ page, iosize,
cur - page_offset(page),
end_bio_extent_writepage,
0, false);
@@ -4485,7 +4485,7 @@ static int write_one_subpage_eb(struct extent_buffer *eb,
clear_page_dirty_for_io(page);

ret = submit_extent_page(REQ_OP_WRITE | write_flags, wbc,
- &epd->bio_ctrl, page, eb->start, eb->len,
+ &epd->bio_ctrl, eb->start, page, eb->len,
eb->start - page_offset(page),
end_bio_subpage_eb_writepage, 0, false);
if (ret) {
@@ -4525,7 +4525,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
clear_page_dirty_for_io(p);
set_page_writeback(p);
ret = submit_extent_page(REQ_OP_WRITE | write_flags, wbc,
- &epd->bio_ctrl, p, disk_bytenr,
+ &epd->bio_ctrl, disk_bytenr, p,
PAGE_SIZE, 0,
end_bio_extent_buffer_writepage,
0, false);
@@ -6782,7 +6782,7 @@ static int read_extent_buffer_subpage(struct extent_buffer *eb, int wait,

btrfs_subpage_start_reader(fs_info, page, eb->start, eb->len);
ret = submit_extent_page(REQ_OP_READ, NULL, &bio_ctrl,
- page, eb->start, eb->len,
+ eb->start, page, eb->len,
eb->start - page_offset(page),
end_bio_extent_readpage, 0, true);
if (ret) {
@@ -6887,7 +6887,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num)

ClearPageError(page);
err = submit_extent_page(REQ_OP_READ, NULL,
- &bio_ctrl, page, page_offset(page),
+ &bio_ctrl, page_offset(page), page,
PAGE_SIZE, 0, end_bio_extent_readpage,
0, false);
if (err) {
--
2.37.3