- /* Calculate the maxium buffer length for each read request */
- max_buf_size = OUT_UPDATE_REPLY_SIZE - cfs_size_round(sizeof(*orr)) -
- cfs_size_round(sizeof(struct object_update_result)) -
- cfs_size_round(offsetof(struct object_update_reply,
- ourp_lens[1]));
- while (total_length > 0) {
- size_t read_length;
-
- /* Because it needs send the update buffer right away,
- * just create an update buffer, instead of attaching the
- * update_remote list of the thandle. */
- update = osp_update_request_create(dt_dev);
- if (IS_ERR(update))
- GOTO(out, rc = PTR_ERR(update));
-
- read_length = total_length > max_buf_size ?
- max_buf_size : total_length;
-
- rc = osp_update_rpc_pack(env, read, update, OUT_READ,
- lu_object_fid(&dt->do_lu),
- read_length, offset);
- if (rc != 0) {
- CERROR("%s: cannot insert update: rc = %d\n",
- dt_dev->dd_lu_dev.ld_obd->obd_name, rc);
- GOTO(out, rc);
- }
-
- rc = osp_remote_sync(env, osp, update, &req);
- if (rc < 0)
- GOTO(out, rc);
+ /* Because it needs send the update buffer right away,
+ * just create an update buffer, instead of attaching the
+ * update_remote list of the thandle. */
+ update = osp_update_request_create(dt_dev);
+ if (IS_ERR(update))
+ GOTO(out, rc = PTR_ERR(update));