if (pos == NULL)
break;
+ /* If there is a gap at the start of this page, it can't merge
+ * with any previous page, so we'll hand the network a
+ * "fragmented" page array that it can't transfer in 1 RDMA */
+ if (page_count != 0 && oap->oap_page_off != 0)
+ break;
+
/* take the page out of our book-keeping */
list_del_init(&oap->oap_pending_item);
lop_update_pending(cli, lop, cmd, -1);
list_del_init(&oap->oap_urgent_item);
if (page_count == 0)
- starting_offset = (oap->oap_obj_off +oap->oap_page_off)&
+ starting_offset = (oap->oap_obj_off + oap->oap_page_off) &
(PTLRPC_MAX_BRW_SIZE - 1);
/* ask the caller for the size of the io as the rpc leaves. */
oap->oap_count) & (PTLRPC_MAX_BRW_SIZE - 1);
if (ending_offset == 0)
break;
+
+ /* If there is a gap at the end of this page, it can't merge
+ * with any subsequent pages, so we'll hand the network a
+ * "fragmented" page array that it can't transfer in 1 RDMA */
+ if (oap->oap_page_off + oap->oap_count < PAGE_SIZE)
+ break;
}
osc_wake_cache_waiters(cli);