struct blk_plug plug;
unsigned page_idx;
+ if (!nr_pages)
+ return;
+
blk_start_plug(&plug);
if (mapping->a_ops->readpages) {
out:
blk_finish_plug(&plug);
+
+ BUG_ON(!list_empty(pages));
}
/*
* contiguous pages before continuing with the next
* batch.
*/
- if (nr_pages)
- read_pages(mapping, filp, &page_pool, nr_pages,
+ read_pages(mapping, filp, &page_pool, nr_pages,
gfp_mask);
nr_pages = 0;
continue;
* uptodate then the caller will launch readpage again, and
* will then handle the error.
*/
- if (nr_pages)
- read_pages(mapping, filp, &page_pool, nr_pages, gfp_mask);
- BUG_ON(!list_empty(&page_pool));
+ read_pages(mapping, filp, &page_pool, nr_pages, gfp_mask);
}
/*