return -EPROTO;
}
-int filter_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
- obd_count oa_bufs, struct brw_page *pga,
- struct obd_trans_info *oti)
-{
- struct obd_ioobj ioo;
- struct niobuf_local *lnb;
- struct niobuf_remote *rnb;
- obd_count i;
- int ret = 0, npages;
- ENTRY;
-
- OBD_ALLOC(lnb, oa_bufs * sizeof(struct niobuf_local));
- OBD_ALLOC(rnb, oa_bufs * sizeof(struct niobuf_remote));
-
- if (lnb == NULL || rnb == NULL)
- GOTO(out, ret = -ENOMEM);
-
- for (i = 0; i < oa_bufs; i++) {
- lnb[i].page = pga[i].pg;
- rnb[i].offset = pga[i].off;
- rnb[i].len = pga[i].count;
- lnb[i].flags = rnb[i].flags = pga[i].flag;
- }
-
- obdo_to_ioobj(oinfo->oi_oa, &ioo);
- ioo.ioo_bufcnt = oa_bufs;
-
- npages = oa_bufs;
- ret = filter_preprw(cmd, exp, oinfo->oi_oa, 1, &ioo,
- rnb, &npages, lnb, oti, oinfo_capa(oinfo));
- if (ret != 0)
- GOTO(out, ret);
- LASSERTF(oa_bufs == npages, "%u != %u\n", oa_bufs, npages);
-
- ret = filter_commitrw(cmd, exp, oinfo->oi_oa, 1, &ioo, rnb,
- npages, lnb, oti, ret);
-
-out:
- if (lnb)
- OBD_FREE(lnb, oa_bufs * sizeof(struct niobuf_local));
- if (rnb)
- OBD_FREE(rnb, oa_bufs * sizeof(struct niobuf_remote));
- RETURN(ret);
-}