int locked_pages = 0;
int all_uptodate = 1;
int num_pages;
- unsigned long num_reads = 0;
struct btrfs_bio_ctrl bio_ctrl = {
.opf = REQ_OP_READ,
.mirror_num = mirror_num,
*/
for (i = 0; i < num_pages; i++) {
page = eb->pages[i];
- if (!PageUptodate(page)) {
- num_reads++;
+ if (!PageUptodate(page))
all_uptodate = 0;
- }
}
if (all_uptodate) {
clear_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags);
eb->read_mirror = 0;
- atomic_set(&eb->io_pages, num_reads);
+ atomic_set(&eb->io_pages, num_pages);
/*
* It is possible for release_folio to clear the TREE_REF bit before we
* set io_pages. See check_buffer_tree_ref for a more detailed comment.
for (i = 0; i < num_pages; i++) {
page = eb->pages[i];
- if (!PageUptodate(page)) {
- ClearPageError(page);
- submit_extent_page(&bio_ctrl, page_offset(page), page,
- PAGE_SIZE, 0);
- } else {
- unlock_page(page);
- }
+ ClearPageError(page);
+ submit_extent_page(&bio_ctrl, page_offset(page), page,
+ PAGE_SIZE, 0);
}
submit_one_bio(&bio_ctrl);