if (!lsm || !lsm->lsm_object_id)
RETURN(-EBADF);
- if ((iobuf->offset & (blocksize - 1)) ||
- (iobuf->length & (blocksize - 1)))
+ /* FIXME: io smaller than PAGE_SIZE is broken on ia64 */
+ if ((iobuf->offset & (PAGE_SIZE - 1)) ||
+ (iobuf->length & (PAGE_SIZE - 1)))
RETURN(-EINVAL);
set = ptlrpc_prep_set();
lnb->page = page;
lnb->flags |= N_LOCAL_TEMP_PAGE;
} else if (!IS_ERR(page)) {
+ unsigned from = lnb->offset & ~PAGE_MASK, to = from + lnb->len;
(*pglocked)++;
- rc = mapping->a_ops->prepare_write(NULL, page,
- lnb->offset & ~PAGE_MASK,
- lnb->len);
+ rc = mapping->a_ops->prepare_write(NULL, page, from, to);
if (rc) {
if (rc != -ENOSPC)
CERROR("page index %lu, rc = %d\n", index, rc);