u64 group_depth;
unsigned group_count;
+ unsigned max_io_size;
+
unsigned comps_index;
unsigned num_comps;
/* variable length */
objio_seg->group_count = 1;
}
+ /* Cache this calculation it will hit for every page */
+ objio_seg->max_io_size = (BIO_MAX_PAGES_KMALLOC * PAGE_SIZE -
+ objio_seg->stripe_unit) *
+ objio_seg->group_width;
+
*outp = &objio_seg->lseg;
return 0;
return _write_exec(ios);
}
+static bool objio_pg_test(struct nfs_pageio_descriptor *pgio,
+ struct nfs_page *prev, struct nfs_page *req)
+{
+ if (!pnfs_generic_pg_test(pgio, prev, req))
+ return false;
+
+ return pgio->pg_count + req->wb_bytes <=
+ OBJIO_LSEG(pgio->pg_lseg)->max_io_size;
+}
+
static struct pnfs_layoutdriver_type objlayout_type = {
.id = LAYOUT_OSD2_OBJECTS,
.name = "LAYOUT_OSD2_OBJECTS",
.read_pagelist = objlayout_read_pagelist,
.write_pagelist = objlayout_write_pagelist,
- .pg_test = pnfs_generic_pg_test,
+ .pg_test = objio_pg_test,
.free_deviceid_node = objio_free_deviceid_node,