struct osp_async_update_args {
struct dt_update_request *oaua_update;
+ atomic_t *oaua_count;
+ wait_queue_head_t *oaua_waitq;
bool oaua_flow_control;
};
index++;
}
+ if (oaua->oaua_count != NULL && atomic_dec_and_test(oaua->oaua_count))
+ wake_up_all(oaua->oaua_waitq);
+
dt_update_request_destroy(dt_update);
return 0;
args = ptlrpc_req_async_args(req);
args->oaua_update = update;
+ args->oaua_count = NULL;
+ args->oaua_waitq = NULL;
+ args->oaua_flow_control = false;
req->rq_interpret_reply = osp_async_update_interpret;
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
}
* \param[in] env pointer to the thread context
* \param[in] op operation type, see 'enum update_type'
* \param[in] obj pointer to the operation target
- * \param[in] count array size of the subsequent @lens and @bufs
- * \param[in] lens buffer length array for the subsequent @bufs
+ * \param[in] count array size of the subsequent \a lens and \a bufs
+ * \param[in] lens buffer length array for the subsequent \a bufs
* \param[in] bufs the buffers to compose the request
* \param[in] data pointer to the data used by the interpreter
* \param[in] interpreter pointer to the interpreter function
rc = out_prep_update_req(env, osp->opd_obd->u.cli.cl_import,
dt_update->dur_buf.ub_req, &req);
if (rc == 0) {
+ down_read(&osp->opd_async_updates_rwsem);
+
args = ptlrpc_req_async_args(req);
args->oaua_update = dt_update;
+ args->oaua_count = &osp->opd_async_updates_count;
+ args->oaua_waitq = &osp->opd_syn_barrier_waitq;
args->oaua_flow_control = flow_control;
req->rq_interpret_reply =
osp_async_update_interpret;
+
+ atomic_inc(args->oaua_count);
+ up_read(&osp->opd_async_updates_rwsem);
+
ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
} else {
dt_update_request_destroy(dt_update);