From: Johann Lombardi Date: Tue, 5 Jul 2011 18:29:35 +0000 (+0200) Subject: LU-498 pass oap instead of cookie to osc_teardown_async_page/osc_queue_async_io X-Git-Tag: 2.0.66.0~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8d1508dc531ae166346c3084604855069f30c117;hp=c0f12e41fbe766785ea0f6bb2db3a4801a4f3ff5 LU-498 pass oap instead of cookie to osc_teardown_async_page/osc_queue_async_io Now that queue_async_io & teardown_async_page are not obd operations any more, we don't need to use a cookie and can just pass the correct type. Change-Id: Iaf2ddf48bfee5c386064bb30e5392345c074c827 Signed-off-by: Johann Lombardi Reviewed-on: http://review.whamcloud.com/1081 Tested-by: Hudson Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index 9928169..f598fce 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -154,14 +154,13 @@ int osc_oap_interrupted(const struct lu_env *env, struct osc_async_page *oap); void loi_list_maint(struct client_obd *cli, struct lov_oinfo *loi); void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli); -int osc_queue_async_io(const struct lu_env *env, - struct obd_export *exp, struct lov_stripe_md *lsm, - struct lov_oinfo *loi, void *cookie, - int cmd, obd_off off, int count, - obd_flag brw_flags, enum async_flags async_flags); -int osc_teardown_async_page(struct obd_export *exp, - struct lov_stripe_md *lsm, - struct lov_oinfo *loi, void *cookie); +int osc_queue_async_io(const struct lu_env *env, struct obd_export *exp, + struct lov_stripe_md *lsm, struct lov_oinfo *loi, + struct osc_async_page *oap, int cmd, obd_off off, + int count, obd_flag brw_flags, + enum async_flags async_flags); +int osc_teardown_async_page(struct obd_export *exp, struct lov_stripe_md *lsm, + struct lov_oinfo *loi, struct osc_async_page *oap); int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *cfg); int osc_set_async_flags_base(struct client_obd *cli, struct lov_oinfo *loi, struct osc_async_page *oap, diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a6dd7cc..8530428 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2958,28 +2958,18 @@ int osc_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm, RETURN(0); } -struct osc_async_page *oap_from_cookie(void *cookie) -{ - struct osc_async_page *oap = cookie; - if (oap->oap_magic != OAP_MAGIC) - return ERR_PTR(-EINVAL); - return oap; -}; - -int osc_queue_async_io(const struct lu_env *env, - struct obd_export *exp, struct lov_stripe_md *lsm, - struct lov_oinfo *loi, void *cookie, - int cmd, obd_off off, int count, - obd_flag brw_flags, enum async_flags async_flags) +int osc_queue_async_io(const struct lu_env *env, struct obd_export *exp, + struct lov_stripe_md *lsm, struct lov_oinfo *loi, + struct osc_async_page *oap, int cmd, obd_off off, + int count, obd_flag brw_flags, + enum async_flags async_flags) { struct client_obd *cli = &exp->exp_obd->u.cli; - struct osc_async_page *oap; int rc = 0; ENTRY; - oap = oap_from_cookie(cookie); - if (IS_ERR(oap)) - RETURN(PTR_ERR(oap)); + if (oap->oap_magic != OAP_MAGIC) + RETURN(-EINVAL); if (cli->cl_import == NULL || cli->cl_import->imp_invalid) RETURN(-EIO); @@ -3091,19 +3081,16 @@ int osc_set_async_flags_base(struct client_obd *cli, RETURN(0); } -int osc_teardown_async_page(struct obd_export *exp, - struct lov_stripe_md *lsm, - struct lov_oinfo *loi, void *cookie) +int osc_teardown_async_page(struct obd_export *exp, struct lov_stripe_md *lsm, + struct lov_oinfo *loi, struct osc_async_page *oap) { struct client_obd *cli = &exp->exp_obd->u.cli; struct loi_oap_pages *lop; - struct osc_async_page *oap; int rc = 0; ENTRY; - oap = oap_from_cookie(cookie); - if (IS_ERR(oap)) - RETURN(PTR_ERR(oap)); + if (oap->oap_magic != OAP_MAGIC) + RETURN(-EINVAL); if (loi == NULL) loi = lsm->lsm_oinfo[0];