maxidx = ((isize + PAGE_SIZE - 1) >> PAGE_SHIFT) - 1;
start = ktime_get();
+ /* add partial pages for read to prepare them for write */
for (i = 0; i < npages; i++) {
/*
if (lnb[i].lnb_len == PAGE_SIZE)
continue;
+ /* for compressed components, any partial pages have already
+ * been read up, so we should never add one here for the
+ * partial page reads
+ */
+ LASSERT(!(lnb[i].lnb_flags & OBD_BRW_COMPRESSED));
if (maxidx >= lnb[i].lnb_page->index) {
osd_iobuf_add_page(iobuf, &lnb[i]);
timediff = ktime_us_delta(end, start);
lprocfs_counter_add(osd->od_stats, LPROC_OSD_GET_PAGE, timediff);
+ /* do read to prepare partial pages for write */
if (iobuf->dr_npages) {
rc = osd_ldiskfs_map_inode_pages(inode, iobuf, osd, 0,
0, 0, NULL);
if (likely(rc == 0)) {
rc = osd_do_bio(osd, inode, iobuf, 0, 0);
- /* do IO stats for preparation reads */
osd_fini_iobuf(osd, iobuf);
}
}