{
return lustre_pack_reply(req, 0, NULL, NULL);
}
+
+void target_committed_to_req(struct ptlrpc_request *req)
+{
+ struct obd_device *obd = req->rq_export->exp_obd;
+
+ if (!obd->obd_no_transno)
+ req->rq_repmsg->last_committed = obd->obd_last_committed;
+ else
+ DEBUG_REQ(D_IOCTL, req,
+ "not sending last_committed update");
+
+ CDEBUG(D_INFO, "last_committed "LPU64", xid "LPX64"\n",
+ obd->obd_last_committed, req->rq_xid);
+}
+EXPORT_SYMBOL(target_committed_to_req);
req->rq_repmsg->last_xid =
le64_to_cpu(med->med_mcd->mcd_last_xid);
- if (!obd->obd_no_transno) {
- req->rq_repmsg->last_committed =
- obd->obd_last_committed;
- } else {
- DEBUG_REQ(D_IOCTL, req,
- "not sending last_committed update");
- }
- CDEBUG(D_INFO, "last_transno "LPU64", last_committed "LPU64
- ", xid "LPU64"\n",
- mds->mds_last_transno, obd->obd_last_committed,
- req->rq_xid);
+ target_committed_to_req(req);
}
out:
}
#endif
-static int ost_brw_read(struct ptlrpc_request *req)
+static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
{
struct ptlrpc_bulk_desc *desc;
struct niobuf_remote *remote_nb;
struct obd_ioobj *ioo;
struct ost_body *body, *repbody;
struct l_wait_info lwi;
- struct obd_trans_info oti = { 0 };
int size[1] = { sizeof(*body) };
int comms_error = 0;
int niocount;
GOTO(out_local, rc = -ENOMEM);
rc = obd_preprw(OBD_BRW_READ, req->rq_export, &body->oa, 1,
- ioo, npages, pp_rnb, local_nb, &oti);
+ ioo, npages, pp_rnb, local_nb, oti);
if (rc != 0)
GOTO(out_bulk, rc);
/* Must commit after prep above in all cases */
rc = obd_commitrw(OBD_BRW_READ, req->rq_export, &body->oa, 1,
- ioo, npages, local_nb, &oti, rc);
+ ioo, npages, local_nb, oti, rc);
if (rc == 0) {
repbody = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*repbody));
LASSERT(rc <= 0);
if (rc == 0) {
req->rq_status = nob;
+ target_committed_to_req(req);
ptlrpc_reply(req);
} else if (!comms_error) {
/* only reply if comms OK */
+ target_committed_to_req(req);
req->rq_status = rc;
ptlrpc_error(req);
} else {
out:
if (rc == 0) {
oti_to_request(oti, req);
+ target_committed_to_req(req);
rc = ptlrpc_reply(req);
} else if (!comms_error) {
/* Only reply if there was no comms problem with bulk */
+ target_committed_to_req(req);
req->rq_status = rc;
ptlrpc_error(req);
} else {
out_pp_rnb:
free_per_page_niobufs(npages, pp_rnb, remote_nb);
out:
+ target_committed_to_req(req);
if (rc) {
req->rq_status = rc;
ptlrpc_error(req);
- } else
+ } else {
ptlrpc_reply(req);
+ }
return rc;
}
case OST_READ:
CDEBUG(D_INODE, "read\n");
OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
- rc = ost_brw_read(req);
+ rc = ost_brw_read(req, oti);
LASSERT(current->journal_info == NULL);
/* ost_brw sends its own replies */
RETURN(rc);
EXIT;
/* If we're DISCONNECTing, the export_data is already freed */
- if (!rc && req->rq_reqmsg->opc != OST_DISCONNECT) {
- if (!obd->obd_no_transno) {
- req->rq_repmsg->last_committed =
- obd->obd_last_committed;
- } else {
- DEBUG_REQ(D_IOCTL, req,
- "not sending last_committed update");
- }
- CDEBUG(D_INFO, "last_committed "LPU64", xid "LPX64"\n",
- obd->obd_last_committed, req->rq_xid);
- }
+ if (!rc && req->rq_reqmsg->opc != OST_DISCONNECT)
+ target_committed_to_req(req);
out:
if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_LAST_REPLAY) {