static inline int ptlrpc_req_interpret(const struct lu_env *env,
struct ptlrpc_request *req, int rc)
{
- if (req->rq_interpret_reply != NULL) {
- req->rq_status = req->rq_interpret_reply(env, req,
- &req->rq_async_args,
- rc);
- return req->rq_status;
- }
- return rc;
+ if (req->rq_interpret_reply != NULL) {
+ req->rq_status = req->rq_interpret_reply(env, req,
+ &req->rq_async_args,
+ rc);
+ return req->rq_status;
+ }
+
+ return rc;
}
/** \addtogroup nrs
}
static int ldlm_cb_interpret(const struct lu_env *env,
- struct ptlrpc_request *req, void *data, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct ldlm_cb_async_args *ca = data;
- struct ldlm_lock *lock = ca->ca_lock;
- struct ldlm_cb_set_arg *arg = ca->ca_set_arg;
- ENTRY;
+ struct ldlm_cb_async_args *ca = args;
+ struct ldlm_lock *lock = ca->ca_lock;
+ struct ldlm_cb_set_arg *arg = ca->ca_set_arg;
- LASSERT(lock != NULL);
+ ENTRY;
+
+ LASSERT(lock != NULL);
switch (arg->type) {
case LDLM_GL_CALLBACK:
* -ELDLM_NO_LOCK_DATA when inode is cleared. LU-274
*/
if (unlikely(arg->gl_interpret_reply)) {
- rc = arg->gl_interpret_reply(env, req, data, rc);
+ rc = arg->gl_interpret_reply(env, req, args, rc);
} else if (rc == -ELDLM_NO_LOCK_DATA) {
LDLM_DEBUG(lock, "lost race - client has a lock but no "
"inode");
ca->ca_set_arg = arg;
ca->ca_lock = lock;
- /* server namespace, doesn't need lock */
- req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
- ldlm_lvbo_size(lock));
- ptlrpc_request_set_replen(req);
+ /* server namespace, doesn't need lock */
+ req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
+ ldlm_lvbo_size(lock));
+ ptlrpc_request_set_replen(req);
- req->rq_send_state = LUSTRE_IMP_FULL;
- /* ptlrpc_request_alloc_pack already set timeout */
- if (AT_OFF)
- req->rq_timeout = ldlm_get_rq_timeout();
+ req->rq_send_state = LUSTRE_IMP_FULL;
+ /* ptlrpc_request_alloc_pack already set timeout */
+ if (AT_OFF)
+ req->rq_timeout = ldlm_get_rq_timeout();
req->rq_interpret_reply = ldlm_cb_interpret;
- if (lock->l_export && lock->l_export->exp_nid_stats &&
- lock->l_export->exp_nid_stats->nid_ldlm_stats)
- lprocfs_counter_incr(lock->l_export->exp_nid_stats->nid_ldlm_stats,
- LDLM_GL_CALLBACK - LDLM_FIRST_OPC);
+ if (lock->l_export && lock->l_export->exp_nid_stats) {
+ struct nid_stat *nid_stats = lock->l_export->exp_nid_stats;
+
+ lprocfs_counter_incr(nid_stats->nid_ldlm_stats,
+ LDLM_GL_CALLBACK - LDLM_FIRST_OPC);
+ }
rc = ldlm_ast_fini(req, arg, lock, 0);
*/
static int lock_convert_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
- struct ldlm_async_args *aa, int rc)
+ void *args, int rc)
{
+ struct ldlm_async_args *aa = args;
struct ldlm_lock *lock;
struct ldlm_reply *reply;
aa = ptlrpc_req_async_args(req);
ldlm_lock2handle(lock, &aa->lock_handle);
- req->rq_interpret_reply = (ptlrpc_interpterer_t)lock_convert_interpret;
+ req->rq_interpret_reply = lock_convert_interpret;
ptlrpcd_add_req(req);
RETURN(0);
}
static int replay_lock_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- struct ldlm_async_args *aa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
+ struct ldlm_async_args *aa = args;
struct ldlm_lock *lock;
struct ldlm_reply *reply;
struct obd_export *exp;
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
aa = ptlrpc_req_async_args(req);
aa->lock_handle = body->lock_handle[0];
- req->rq_interpret_reply = (ptlrpc_interpterer_t)replay_lock_interpret;
+ req->rq_interpret_reply = replay_lock_interpret;
ptlrpcd_add_req(req);
RETURN(0);
void *args, int rc)
{
struct lfsck_layout_slave_async_args *llsaa = args;
- struct obd_export *exp = llsaa->llsaa_exp;
- struct lfsck_component *com = llsaa->llsaa_com;
- struct lfsck_layout_slave_target *llst = llsaa->llsaa_llst;
- struct lfsck_layout_slave_data *llsd = com->lc_data;
- struct lfsck_reply *lr = NULL;
- bool done = false;
+ struct obd_export *exp = llsaa->llsaa_exp;
+ struct lfsck_component *com = llsaa->llsaa_com;
+ struct lfsck_layout_slave_target *llst = llsaa->llsaa_llst;
+ struct lfsck_layout_slave_data *llsd = com->lc_data;
+ struct lfsck_reply *lr = NULL;
+ bool done = false;
if (rc != 0) {
/* It is probably caused by network trouble, or target crash,
}
int mdc_enqueue_interpret(const struct lu_env *env, struct ptlrpc_request *req,
- struct osc_enqueue_args *aa, int rc)
+ void *args, int rc)
{
+ struct osc_enqueue_args *aa = args;
struct ldlm_lock *lock;
struct lustre_handle *lockh = &aa->oa_lockh;
enum ldlm_mode mode = aa->oa_mode;
aa->oa_flags = flags;
aa->oa_lvb = lvb;
- req->rq_interpret_reply =
- (ptlrpc_interpterer_t)mdc_enqueue_interpret;
+ req->rq_interpret_reply = mdc_enqueue_interpret;
ptlrpcd_add_req(req);
} else {
ptlrpc_req_finished(req);
static int
mdc_data_version_interpret(const struct lu_env *env, struct ptlrpc_request *req,
- void *arg, int rc)
+ void *args, int rc)
{
- struct mdc_data_version_args *dva = arg;
+ struct mdc_data_version_args *dva = args;
struct osc_io *oio = dva->dva_oio;
const struct mdt_body *body;
}
static int mdc_intent_getattr_async_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- void *args, int rc)
+ struct ptlrpc_request *req,
+ void *args, int rc)
{
struct mdc_getattr_args *ga = args;
- struct obd_export *exp = ga->ga_exp;
- struct md_enqueue_info *minfo = ga->ga_minfo;
+ struct obd_export *exp = ga->ga_exp;
+ struct md_enqueue_info *minfo = ga->ga_minfo;
struct ldlm_enqueue_info *einfo = &minfo->mi_einfo;
- struct lookup_intent *it;
- struct lustre_handle *lockh;
- struct obd_device *obddev;
- struct ldlm_reply *lockrep;
- __u64 flags = LDLM_FL_HAS_INTENT;
+ struct lookup_intent *it;
+ struct lustre_handle *lockh;
+ struct obd_device *obddev;
+ struct ldlm_reply *lockrep;
+ __u64 flags = LDLM_FL_HAS_INTENT;
ENTRY;
it = &minfo->mi_it;
static int
osc_data_version_interpret(const struct lu_env *env, struct ptlrpc_request *req,
- void *arg, int rc)
+ void *args, int rc)
{
- struct osc_data_version_args *dva = arg;
+ struct osc_data_version_args *dva = args;
struct osc_io *oio = dva->dva_oio;
const struct ost_body *body;
}
static int osc_setattr_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- struct osc_setattr_args *sa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct ost_body *body;
- ENTRY;
+ struct osc_setattr_args *sa = args;
+ struct ost_body *body;
- if (rc != 0)
- GOTO(out, rc);
+ ENTRY;
- body = req_capsule_server_get(&req->rq_pill, &RMF_OST_BODY);
- if (body == NULL)
- GOTO(out, rc = -EPROTO);
+ if (rc != 0)
+ GOTO(out, rc);
+
+ body = req_capsule_server_get(&req->rq_pill, &RMF_OST_BODY);
+ if (body == NULL)
+ GOTO(out, rc = -EPROTO);
lustre_get_wire_obdo(&req->rq_import->imp_connect_data, sa->sa_oa,
&body->oa);
out:
- rc = sa->sa_upcall(sa->sa_cookie, rc);
- RETURN(rc);
+ rc = sa->sa_upcall(sa->sa_cookie, rc);
+ RETURN(rc);
}
int osc_setattr_async(struct obd_export *exp, struct obdo *oa,
/* Do not wait for response. */
ptlrpcd_add_req(req);
} else {
- req->rq_interpret_reply =
- (ptlrpc_interpterer_t)osc_setattr_interpret;
+ req->rq_interpret_reply = osc_setattr_interpret;
CLASSERT(sizeof(*sa) <= sizeof(req->rq_async_args));
sa = ptlrpc_req_async_args(req);
ptlrpc_request_set_replen(req);
- req->rq_interpret_reply = (ptlrpc_interpterer_t)osc_setattr_interpret;
+ req->rq_interpret_reply = osc_setattr_interpret;
CLASSERT(sizeof(*sa) <= sizeof(req->rq_async_args));
sa = ptlrpc_req_async_args(req);
sa->sa_oa = oa;
EXPORT_SYMBOL(osc_punch_send);
static int osc_sync_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- void *arg, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct osc_fsync_args *fa = arg;
- struct ost_body *body;
- struct cl_attr *attr = &osc_env_info(env)->oti_attr;
- unsigned long valid = 0;
- struct cl_object *obj;
+ struct osc_fsync_args *fa = args;
+ struct ost_body *body;
+ struct cl_attr *attr = &osc_env_info(env)->oti_attr;
+ unsigned long valid = 0;
+ struct cl_object *obj;
ENTRY;
if (rc != 0)
}
static int osc_destroy_interpret(const struct lu_env *env,
- struct ptlrpc_request *req, void *data,
- int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
atomic_dec(&cli->cl_destroy_in_flight);
wake_up(&cli->cl_destroy_waitq);
+
return 0;
}
static int osc_shrink_grant_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
- void *aa, int rc)
+ void *args, int rc)
{
+ struct osc_grant_args *aa = args;
struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
- struct obdo *oa = ((struct osc_grant_args *)aa)->aa_oa;
struct ost_body *body;
if (rc != 0) {
- __osc_update_grant(cli, oa->o_grant);
+ __osc_update_grant(cli, aa->aa_oa->o_grant);
GOTO(out, rc);
}
LASSERT(body);
osc_update_grant(cli, body);
out:
- OBD_SLAB_FREE_PTR(oa, osc_obdo_kmem);
+ OBD_SLAB_FREE_PTR(aa->aa_oa, osc_obdo_kmem);
+
return rc;
}
}
}
}
- /* New request takes over pga and oaps from old request.
- * Note that copying a list_head doesn't work, need to move it... */
- aa->aa_resends++;
- new_req->rq_interpret_reply = request->rq_interpret_reply;
- new_req->rq_async_args = request->rq_async_args;
+ /*
+ * New request takes over pga and oaps from old request.
+ * Note that copying a list_head doesn't work, need to move it...
+ */
+ aa->aa_resends++;
+ new_req->rq_interpret_reply = request->rq_interpret_reply;
+ new_req->rq_async_args = request->rq_async_args;
new_req->rq_commit_cb = request->rq_commit_cb;
/* cap resend delay to the current request timeout, this is similar to
* what ptlrpc does (see after_reply()) */
}
static int brw_interpret(const struct lu_env *env,
- struct ptlrpc_request *req, void *data, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct osc_brw_async_args *aa = data;
+ struct osc_brw_async_args *aa = args;
struct osc_extent *ext;
struct osc_extent *tmp;
struct client_obd *cli = aa->aa_cli;
- unsigned long transferred = 0;
- ENTRY;
+ unsigned long transferred = 0;
+
+ ENTRY;
- rc = osc_brw_fini_request(req, rc);
- CDEBUG(D_INODE, "request %p aa %p rc %d\n", req, aa, rc);
- /* When server return -EINPROGRESS, client should always retry
- * regardless of the number of times the bulk was resent already. */
+ rc = osc_brw_fini_request(req, rc);
+ CDEBUG(D_INODE, "request %p aa %p rc %d\n", req, aa, rc);
+ /*
+ * When server returns -EINPROGRESS, client should always retry
+ * regardless of the number of times the bulk was resent already.
+ */
if (osc_recoverable_error(rc) && !req->rq_no_delay) {
if (req->rq_import_generation !=
req->rq_import->imp_generation) {
}
int osc_enqueue_interpret(const struct lu_env *env, struct ptlrpc_request *req,
- struct osc_enqueue_args *aa, int rc)
+ void *args, int rc)
{
+ struct osc_enqueue_args *aa = args;
struct ldlm_lock *lock;
struct lustre_handle *lockh = &aa->oa_lockh;
enum ldlm_mode mode = aa->oa_mode;
aa->oa_flags = NULL;
}
- req->rq_interpret_reply =
- (ptlrpc_interpterer_t)osc_enqueue_interpret;
+ req->rq_interpret_reply = osc_enqueue_interpret;
if (rqset == PTLRPCD_SET)
ptlrpcd_add_req(req);
else
}
static int osc_statfs_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- struct osc_async_args *aa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct obd_statfs *msfs;
- ENTRY;
+ struct osc_async_args *aa = args;
+ struct obd_statfs *msfs;
- if (rc == -EBADR)
- /* The request has in fact never been sent
- * due to issues at a higher level (LOV).
- * Exit immediately since the caller is
- * aware of the problem and takes care
- * of the clean up */
- RETURN(rc);
+ ENTRY;
+ if (rc == -EBADR)
+ /*
+ * The request has in fact never been sent due to issues at
+ * a higher level (LOV). Exit immediately since the caller
+ * is aware of the problem and takes care of the clean up.
+ */
+ RETURN(rc);
- if ((rc == -ENOTCONN || rc == -EAGAIN) &&
- (aa->aa_oi->oi_flags & OBD_STATFS_NODELAY))
- GOTO(out, rc = 0);
+ if ((rc == -ENOTCONN || rc == -EAGAIN) &&
+ (aa->aa_oi->oi_flags & OBD_STATFS_NODELAY))
+ GOTO(out, rc = 0);
- if (rc != 0)
- GOTO(out, rc);
+ if (rc != 0)
+ GOTO(out, rc);
- msfs = req_capsule_server_get(&req->rq_pill, &RMF_OBD_STATFS);
- if (msfs == NULL) {
+ msfs = req_capsule_server_get(&req->rq_pill, &RMF_OBD_STATFS);
+ if (msfs == NULL)
GOTO(out, rc = -EPROTO);
- }
- *aa->aa_oi->oi_osfs = *msfs;
+ *aa->aa_oi->oi_osfs = *msfs;
out:
- rc = aa->aa_oi->oi_cb_up(aa->aa_oi, rc);
- RETURN(rc);
+ rc = aa->aa_oi->oi_cb_up(aa->aa_oi, rc);
+
+ RETURN(rc);
}
static int osc_statfs_async(struct obd_export *exp,
req->rq_no_delay = 1;
}
- req->rq_interpret_reply = (ptlrpc_interpterer_t)osc_statfs_interpret;
+ req->rq_interpret_reply = osc_statfs_interpret;
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
aa = ptlrpc_req_async_args(req);
aa->aa_oi = oinfo;
* \retval negative negated errno on error
*/
static int osp_statfs_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- union ptlrpc_async_args *aa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
+ union ptlrpc_async_args *aa = args;
struct obd_import *imp = req->rq_import;
struct obd_statfs *msfs;
struct osp_device *d;
req->rq_request_portal = OST_CREATE_PORTAL;
ptlrpc_at_set_req_timeout(req);
- req->rq_interpret_reply = (ptlrpc_interpterer_t)osp_statfs_interpret;
+ req->rq_interpret_reply = osp_statfs_interpret;
aa = ptlrpc_req_async_args(req);
aa->pointer_arg[0] = d;
* \retval 0 always
*/
static int osp_sync_interpret(const struct lu_env *env,
- struct ptlrpc_request *req, void *aa, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
+ struct osp_job_req_args *jra = args;
struct osp_device *d = req->rq_cb_data;
- struct osp_job_req_args *jra = aa;
if (jra->jra_magic != OSP_JOB_MAGIC) {
DEBUG_REQ(D_ERROR, req, "bad magic %u\n", jra->jra_magic);
* \retval negative error number on failure
*/
static int osp_update_interpret(const struct lu_env *env,
- struct ptlrpc_request *req, void *arg, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct object_update_reply *reply = NULL;
- struct osp_update_args *oaua = arg;
- struct osp_update_request *our = oaua->oaua_update;
- struct osp_thandle *oth;
- struct osp_update_callback *ouc;
- struct osp_update_callback *next;
- int count = 0;
- int index = 0;
- int rc1 = 0;
+ struct object_update_reply *reply = NULL;
+ struct osp_update_args *oaua = args;
+ struct osp_update_request *our = oaua->oaua_update;
+ struct osp_thandle *oth;
+ struct osp_update_callback *ouc;
+ struct osp_update_callback *next;
+ int count = 0;
+ int index = 0;
+ int rc1 = 0;
ENTRY;
*/
static int ptlrpc_replay_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
- void * data, int rc)
+ void *args, int rc)
{
- struct ptlrpc_replay_async_args *aa = data;
+ struct ptlrpc_replay_async_args *aa = args;
struct obd_import *imp = req->rq_import;
ENTRY;
aa = ptlrpc_req_async_args(req);
memset(aa, 0, sizeof(*aa));
- /* Prepare request to be resent with ptlrpcd */
- aa->praa_old_state = req->rq_send_state;
- req->rq_send_state = LUSTRE_IMP_REPLAY;
- req->rq_phase = RQ_PHASE_NEW;
- req->rq_next_phase = RQ_PHASE_UNDEFINED;
- if (req->rq_repmsg)
- aa->praa_old_status = lustre_msg_get_status(req->rq_repmsg);
- req->rq_status = 0;
- req->rq_interpret_reply = ptlrpc_replay_interpret;
- /* Readjust the timeout for current conditions */
- ptlrpc_at_set_req_timeout(req);
-
- /* Tell server the net_latency, so the server can calculate how long
- * it should wait for next replay */
- lustre_msg_set_service_time(req->rq_reqmsg,
- ptlrpc_at_get_net_latency(req));
- DEBUG_REQ(D_HA, req, "REPLAY");
+ /* Prepare request to be resent with ptlrpcd */
+ aa->praa_old_state = req->rq_send_state;
+ req->rq_send_state = LUSTRE_IMP_REPLAY;
+ req->rq_phase = RQ_PHASE_NEW;
+ req->rq_next_phase = RQ_PHASE_UNDEFINED;
+ if (req->rq_repmsg)
+ aa->praa_old_status = lustre_msg_get_status(req->rq_repmsg);
+ req->rq_status = 0;
+ req->rq_interpret_reply = ptlrpc_replay_interpret;
+ /* Readjust the timeout for current conditions */
+ ptlrpc_at_set_req_timeout(req);
+
+ /* Tell server net_latency to calculate how long to wait for reply. */
+ lustre_msg_set_service_time(req->rq_reqmsg,
+ ptlrpc_at_get_net_latency(req));
+ DEBUG_REQ(D_HA, req, "REPLAY");
atomic_inc(&req->rq_import->imp_replay_inflight);
spin_lock(&req->rq_lock);
}
static int work_interpreter(const struct lu_env *env,
- struct ptlrpc_request *req, void *data, int rc)
+ struct ptlrpc_request *req, void *args, int rc)
{
- struct ptlrpc_work_async_args *arg = data;
+ struct ptlrpc_work_async_args *arg = args;
LASSERT(ptlrpcd_check_work(req));
LASSERT(arg->cb != NULL);
static int ptlrpc_connect_interpret(const struct lu_env *env,
- struct ptlrpc_request *request,
- void * data, int rc);
+ struct ptlrpc_request *request,
+ void *args, int rc);
int ptlrpc_import_recovery_state_machine(struct obd_import *imp);
/* Only this function is allowed to change the import state when it is
* \see signal_completed_replay
*/
static int completed_replay_interpret(const struct lu_env *env,
- struct ptlrpc_request *req,
- void * data, int rc)
+ struct ptlrpc_request *req,
+ void *args, int rc)
{
ENTRY;
atomic_dec(&req->rq_import->imp_replay_inflight);
- if (req->rq_status == 0 &&
- !req->rq_import->imp_vbr_failed) {
+ if (req->rq_status == 0 && !req->rq_import->imp_vbr_failed) {
ptlrpc_import_recovery_state_machine(req->rq_import);
} else {
if (req->rq_import->imp_vbr_failed) {
static int ptlrpc_disconnect_idle_interpret(const struct lu_env *env,
struct ptlrpc_request *req,
- void *data, int rc)
+ void *args, int rc)
{
struct obd_import *imp = req->rq_import;
int connect = 0;