summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-06-06 19:14:26 +0200
committerDavid Sterba <dsterba@suse.com>2017-08-16 16:12:04 +0200
commit4b81ba48c66b1f927449585aa2a13bad8d91fcb4 (patch)
tree6e6d243303f90e8e8c4dcbdd68276e032d6f0c9b /fs
parentf1c77c55cda19445a490036bce497ed3af9696d7 (diff)
btrfs: merge REQ_OP and REQ_ flags to one parameter in submit_extent_page
The function submit_extent_page has 15(!) parameters right now, op and op_flags are effectively one value stored to bio::bi_opf, no need to pass them separately. So it's 14 parameters now. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 339f39caa0b7..ea4947c97505 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2756,8 +2756,10 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page,
}
-static int submit_extent_page(unsigned int op, unsigned int op_flags,
- struct extent_io_tree *tree,
+/*
+ * @opf: bio REQ_OP_* and REQ_* flags as one value
+ */
+static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
struct writeback_control *wbc,
struct page *page, sector_t sector,
size_t size, unsigned long offset,
@@ -2804,7 +2806,7 @@ static int submit_extent_page(unsigned int op, unsigned int op_flags,
bio->bi_end_io = end_io_func;
bio->bi_private = tree;
bio->bi_write_hint = page->mapping->host->i_write_hint;
- bio_set_op_attrs(bio, op, op_flags);
+ bio->bi_opf = opf;
if (wbc) {
wbc_init_bio(wbc, bio);
wbc_account_io(wbc, page, page_size);
@@ -3059,7 +3061,7 @@ static int __do_readpage(struct extent_io_tree *tree,
continue;
}
- ret = submit_extent_page(REQ_OP_READ, read_flags, tree, NULL,
+ ret = submit_extent_page(REQ_OP_READ | read_flags, tree, NULL,
page, sector, disk_io_size, pg_offset,
bdev, bio,
end_bio_extent_readpage, mirror_num,
@@ -3428,7 +3430,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
page->index, cur, end);
}
- ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc,
+ ret = submit_extent_page(REQ_OP_WRITE | write_flags, tree, wbc,
page, sector, iosize, pg_offset,
bdev, &epd->bio,
end_bio_extent_writepage,
@@ -3746,7 +3748,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, tree, wbc,
+ ret = submit_extent_page(REQ_OP_WRITE | write_flags, tree, wbc,
p, offset >> 9, PAGE_SIZE, 0, bdev,
&epd->bio,
end_bio_extent_buffer_writepage,