Whamcloud - gitweb
LU-11398 ptlrpc: clean up rq_interpret_reply callbacks 03/33203/6
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 19 Sep 2018 07:07:23 +0000 (03:07 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Jan 2019 04:46:52 +0000 (04:46 +0000)
Clean up the function prototypes of several rq_interpret_reply
callback functions to match the function pointer type instead
of using typecasting to avoid the risk of bad function pointers.

Clean up related code to match code style.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I2df73304a8884c1cc838b9c9344d3fd9443ebbe5
Reviewed-on: https://review.whamcloud.com/33203
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed:
lustre/include/lustre_net.h
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/lfsck/lfsck_layout.c
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_locks.c
lustre/osc/osc_io.c
lustre/osc/osc_request.c
lustre/osp/osp_precreate.c
lustre/osp/osp_sync.c
lustre/osp/osp_trans.c
lustre/ptlrpc/client.c
lustre/ptlrpc/import.c

index 9f68ae7..76f8ae5 100644 (file)
@@ -1124,13 +1124,14 @@ struct ptlrpc_request {
 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
index 5362e8d..55c6710 100644 (file)
@@ -709,14 +709,15 @@ static int ldlm_handle_ast_error(const struct lu_env *env,
 }
 
 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:
@@ -729,7 +730,7 @@ static int ldlm_cb_interpret(const struct lu_env *env,
                 *   -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");
@@ -1118,22 +1119,24 @@ int ldlm_server_glimpse_ast(struct ldlm_lock *lock, void *data)
        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);
 
index 54a570f..8c4e555 100644 (file)
@@ -1049,8 +1049,9 @@ EXPORT_SYMBOL(ldlm_cli_enqueue);
  */
 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;
 
@@ -1232,7 +1233,7 @@ int ldlm_cli_convert(struct ldlm_lock *lock, __u32 *flags)
 
        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);
@@ -2359,9 +2360,9 @@ static int ldlm_chain_lock_for_replay(struct ldlm_lock *lock, void *closure)
 }
 
 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;
@@ -2481,7 +2482,7 @@ static int replay_one_lock(struct obd_import *imp, struct ldlm_lock *lock)
        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);
index 4008174..3f22ac3 100644 (file)
@@ -4576,12 +4576,12 @@ lfsck_layout_slave_async_interpret(const struct lu_env *env,
                                   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,
index c06749e..3565f2b 100644 (file)
@@ -619,8 +619,9 @@ int mdc_enqueue_fini(struct ptlrpc_request *req, osc_enqueue_upcall_f upcall,
 }
 
 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;
@@ -764,8 +765,7 @@ no_match:
                        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);
@@ -1147,9 +1147,9 @@ struct mdc_data_version_args {
 
 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;
 
index dc42f57..6e7df6b 100644 (file)
@@ -1228,18 +1228,18 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
 }
 
 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;
index d4ef2d1..a1cb094 100644 (file)
@@ -662,9 +662,9 @@ struct osc_data_version_args {
 
 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;
 
index 6b56631..5b67cdb 100644 (file)
@@ -180,24 +180,25 @@ out:
 }
 
 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,
@@ -229,8 +230,7 @@ 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);
@@ -417,7 +417,7 @@ int osc_punch_send(struct obd_export *exp, struct obdo *oa,
 
        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;
@@ -431,14 +431,13 @@ int osc_punch_send(struct obd_export *exp, struct obdo *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)
@@ -549,13 +548,13 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
 }
 
 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;
 }
 
@@ -741,14 +740,14 @@ static struct grant_thread_data client_gtd;
 
 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);
        }
 
@@ -756,7 +755,8 @@ static int osc_shrink_grant_interpret(const struct lu_env *env,
        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;
 }
 
@@ -1941,11 +1941,13 @@ static int osc_brw_redo_request(struct ptlrpc_request *request,
                         }
                 }
         }
-        /* 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()) */
@@ -2019,19 +2021,22 @@ static void osc_release_ppga(struct brw_page **ppga, size_t count)
 }
 
 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) {
@@ -2411,8 +2416,9 @@ int osc_enqueue_fini(struct ptlrpc_request *req, osc_enqueue_upcall_f upcall,
 }
 
 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;
@@ -2613,8 +2619,7 @@ no_match:
                                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
@@ -2677,36 +2682,36 @@ int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
 }
 
 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,
@@ -2744,7 +2749,7 @@ 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;
index 10d77e8..db6851e 100644 (file)
@@ -114,9 +114,9 @@ static void osp_statfs_timer_cb(cfs_timer_cb_arg_t data)
  * \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;
@@ -205,7 +205,7 @@ static int osp_statfs_update(const struct lu_env *env, 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;
 
index b21d5af..c4dece9 100644 (file)
@@ -548,10 +548,10 @@ static void osp_sync_request_commit_cb(struct ptlrpc_request *req)
  * \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);
index 9b92c45..a69a9cb 100644 (file)
@@ -602,17 +602,17 @@ static void osp_update_callback_fini(const struct lu_env *env,
  * \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;
 
index 1ea3b9f..828504e 100644 (file)
@@ -2955,9 +2955,9 @@ EXPORT_SYMBOL(ptlrpc_queue_wait);
  */
 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;
@@ -3105,23 +3105,22 @@ int ptlrpc_replay_req(struct ptlrpc_request *req)
        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);
@@ -3399,9 +3398,9 @@ static void ptlrpcd_add_work_req(struct ptlrpc_request *req)
 }
 
 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);
index 8ca1dec..6cf814b 100644 (file)
@@ -107,8 +107,8 @@ EXPORT_SYMBOL(ptlrpc_import_enter_resend);
 
 
 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
@@ -1332,13 +1332,12 @@ out:
  * \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) {
@@ -1662,7 +1661,7 @@ EXPORT_SYMBOL(ptlrpc_disconnect_import);
 
 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;