+ rc = osp_prep_update_req(env, osp->opd_obd->u.cli.cl_import, update,
+ &req);
+ if (rc != 0)
+ GOTO(out, rc);
+
+ nbufs = (rbuf->lb_len + OUT_BULK_BUFFER_SIZE - 1) /
+ OUT_BULK_BUFFER_SIZE;
+ /* allocate bulk descriptor */
+ desc = ptlrpc_prep_bulk_imp(req, nbufs, 1,
+ PTLRPC_BULK_PUT_SINK | PTLRPC_BULK_BUF_KVEC,
+ MDS_BULK_PORTAL, &ptlrpc_bulk_kvec_ops);
+ if (desc == NULL)
+ GOTO(out, rc = -ENOMEM);
+
+ /* split the buffer into small chunk size */
+ left_size = rbuf->lb_len;
+ for (i = 0; i < nbufs; i++) {
+ int read_size;
+
+ read_size = left_size > OUT_BULK_BUFFER_SIZE ?
+ OUT_BULK_BUFFER_SIZE : left_size;
+ desc->bd_frag_ops->add_iov_frag(desc, ptr, read_size);
+
+ ptr += read_size;
+ }
+
+ /* This will only be called with read-only update, and these updates
+ * might be used to retrieve update log during recovery process, so
+ * it will be allowed to send during recovery process */
+ req->rq_allow_replay = 1;
+ req->rq_bulk_read = 1;
+ /* send request to master and wait for RPC to complete */
+ rc = ptlrpc_queue_wait(req);
+ if (rc != 0)
+ GOTO(out, rc);
+
+ rc = sptlrpc_cli_unwrap_bulk_read(req, req->rq_bulk,
+ req->rq_bulk->bd_nob_transferred);