-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-static int echo_client_ubrw(struct obd_device *obd, int rw,
- struct obdo *oa, struct lov_stripe_md *lsm,
- obd_off offset, obd_size count, char *buffer,
- struct obd_trans_info *oti)
-{
- struct echo_client_obd *ec = &obd->u.echocli;
- obd_count npages;
- struct brw_page *pga;
- struct brw_page *pgp;
- obd_off off;
- struct kiobuf *kiobuf;
- int i;
- int rc;
-
- LASSERT (rw == OBD_BRW_WRITE ||
- rw == OBD_BRW_READ);
-
- /* NB: for now, only whole pages, page aligned */
-
- if (count <= 0 ||
- ((long)buffer & (PAGE_SIZE - 1)) != 0 ||
- (count & (PAGE_SIZE - 1)) != 0 ||
- (lsm != NULL && lsm->lsm_object_id != oa->o_id))
- return (-EINVAL);
-
- /* XXX think again with misaligned I/O */
- npages = count >> PAGE_SHIFT;
-
- OBD_ALLOC(pga, npages * sizeof(*pga));
- if (pga == NULL)
- return (-ENOMEM);
-
- rc = alloc_kiovec (1, &kiobuf);
- if (rc != 0)
- goto out_1;
-
- rc = map_user_kiobuf ((rw == OBD_BRW_READ) ? READ : WRITE,
- kiobuf, (unsigned long)buffer, count);
- if (rc != 0)
- goto out_2;
-
- LASSERT (kiobuf->offset == 0);
- LASSERT (kiobuf->nr_pages == npages);
-
- for (i = 0, off = offset, pgp = pga;
- i < npages;
- i++, off += PAGE_SIZE, pgp++) {
- pgp->disk_offset = pgp->page_offset = off;
- pgp->pg = kiobuf->maplist[i];
- pgp->count = PAGE_SIZE;
- pgp->flag = 0;
- }
-
- rc = obd_brw(rw, ec->ec_exp, oa, lsm, npages, pga, oti);
-
- // if (rw == OBD_BRW_READ)
- // mark_dirty_kiobuf (kiobuf, count);
-
- unmap_kiobuf (kiobuf);
- out_2:
- free_kiovec (1, &kiobuf);
- out_1:
- OBD_FREE(pga, npages * sizeof(*pga));
- return (rc);
-}
-#else