struct lu_attr *la, struct obdo *oa,
int objcount, struct obd_ioobj *obj,
struct niobuf_remote *rnb, int *nr_local,
- struct niobuf_local *lnb)
+ struct niobuf_local *lnb, int chunk_size)
{
struct ofd_object *fo;
int i, j, k, rc = 0, tot_bytes = 0;
if (cmd == OBD_BRW_WRITE) {
la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
rc = ofd_preprw_write(env, exp, ofd, fid, &info->fti_attr, oa,
- objcount, obj, rnb, nr_local, lnb);
+ objcount, obj, rnb, nr_local, lnb,
+ chunk_size);
} else if (cmd == OBD_BRW_READ) {
tgt_grant_prepare_read(env, exp, oa);
rc = ofd_preprw_read(env, exp, ofd, fid, &info->fti_attr, oa,
const char *obd_name = exp->exp_obd->obd_name;
/* '1' for consistency with code that checks !mpflag to restore */
unsigned int mpflags = 1;
+ struct ost_layout_compr *olc;
+ enum ll_compr_type type;
+ int chunk_size = 0;
ktime_t kstart;
int nob = 0;
local_nb = tbc->tbc_lnb;
+
+ olc = &body->oa.o_layout_compr;
+ type = olc->ol_compr_type;
+ if (type != LL_COMPR_TYPE_NONE) {
+ unsigned int chunk_log_bits;
+
+ chunk_log_bits = olc->ol_compr_chunk_log_bits;
+ chunk_size = COMPR_GET_CHUNK_SIZE(chunk_log_bits);
+ }
+
rc = tgt_brw_lock(tsi->tsi_env, exp, &tsi->tsi_resid, remote_nb, &lockh,
LCK_PW, niocount);
if (rc != 0)
npages = PTLRPC_MAX_BRW_PAGES;
kstart = ktime_get();
rc = obd_preprw(tsi->tsi_env, OBD_BRW_WRITE, exp, &repbody->oa,
- objcount, ioo, remote_nb, &npages, local_nb, 0);
+ objcount, ioo, remote_nb, &npages, local_nb,
+ chunk_size);
if (rc < 0)
GOTO(out_lock, rc);
if (body->oa.o_valid & OBD_MD_FLFLAGS &&