The cdp_cl_pages array is how we are still keeping cl_pages
available, so reducing use of it is the next step.
This is the start of that process, in this case in
osc_queue_dio_pages.
Test-Parameters: fortestonly
Test-Parameters: forjanitoronly
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Ifd2f5ad63b20df8475f83447a6d9b3d56be3ca70
struct cl_page *page;
struct osc_page *opg;
int mppr = cli->cl_max_pages_per_rpc;
+ int page_count = to_page - from_page + 1;
pgoff_t start = CL_PAGE_EOF;
bool can_merge = true;
enum cl_req_type crt;
- int page_count = 0;
pgoff_t end = 0;
int i;
ENTRY;
else
crt = CRT_WRITE;
+ /* we should never have more pages than can fit in an RPC, but if we do
+ * we must allow sending of a larger RPC
+ */
+ while (page_count > mppr)
+ mppr = mppr << 1;
+
+ if (unlikely(cdp->cdp_from > 0 || cdp->cdp_to < PAGE_SIZE - 1))
+ can_merge = false;
+
for (i = from_page; i <= to_page; i++) {
pgoff_t index;
end = index;
if (index < start)
start = index;
- ++page_count;
- mppr <<= (page_count > mppr);
-
- if (unlikely(oap->oap_count < PAGE_SIZE))
- can_merge = false;
}
ext = osc_extent_alloc(obj);