From: Patrick Farrell Date: Wed, 30 Aug 2023 19:02:46 +0000 (-0400) Subject: LU-13814 osc: remove use of cp_obj X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ec0083876628ea601fda711a26b72ff228536d25;p=fs%2Flustre-release.git LU-13814 osc: remove use of cp_obj Since we're going to lose the cl_page, we need to remove usage of its members from the code which handles DIO pages. This removes cp_obj usage from the one place where it's used by the DIO code, by adding it to the BRW async args. Test-Parameters: fortestonly Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: Ic53b872d930305c345a03c75dc21a613874bf3c8 --- diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index acf7e23..c199adf 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -517,6 +517,7 @@ struct osc_page { }; struct osc_brw_async_args { + struct cl_object *aa_obj; struct obdo *aa_oa; int aa_requested_nob; int aa_nio_count; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 72af8f4..fa3aade 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1504,7 +1504,8 @@ static inline void osc_release_bounce_pages(struct brw_page **pga, static int osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, u32 page_count, struct brw_page **pga, - struct ptlrpc_request **reqp, int resend) + struct ptlrpc_request **reqp, struct cl_object *clobj, + int resend) { struct ptlrpc_request *req; struct ptlrpc_bulk_desc *desc; @@ -1648,9 +1649,6 @@ retry_encrypt: if (pa) OBD_FREE_PTR_ARRAY_LARGE(pa, page_count); } else if (opc == OST_WRITE && inode && IS_ENCRYPTED(inode)) { - struct osc_async_page *oap = brw_page2oap(pga[0]); - struct cl_page *clpage = oap2cl_page(oap); - struct cl_object *clobj = clpage->cp_obj; struct cl_attr attr = { 0 }; struct lu_env *env; __u16 refcheck; @@ -1950,6 +1948,7 @@ no_bulk: aa->aa_resends = 0; aa->aa_ppga = pga; aa->aa_cli = cli; + aa->aa_obj = clobj; INIT_LIST_HEAD(&aa->aa_oaps); *reqp = req; @@ -2413,7 +2412,7 @@ static int osc_brw_redo_request(struct ptlrpc_request *request, rc = osc_brw_prep_request(lustre_msg_get_opc(request->rq_reqmsg) == OST_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ, aa->aa_cli, aa->aa_oa, aa->aa_page_count, - aa->aa_ppga, &new_req, 1); + aa->aa_ppga, &new_req, aa->aa_obj, 1); if (rc) RETURN(rc); @@ -2794,7 +2793,8 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, } sort_brw_pages(pga, page_count); - rc = osc_brw_prep_request(cmd, cli, oa, page_count, pga, &req, 0); + rc = osc_brw_prep_request(cmd, cli, oa, page_count, pga, &req, + cl_object_top(osc2cl(obj)), 0); if (rc != 0) { CERROR("prep_req failed: %d\n", rc); GOTO(out, rc); @@ -2910,7 +2910,7 @@ void osc_send_empty_rpc(struct osc_object *osc, pgoff_t start) oa.o_flags = OBD_FL_NORPC; rc = osc_brw_prep_request(OBD_BRW_READ, osc_cli(osc), &oa, 1, &pga, - &req, 0); + &req, cl_object_top(osc2cl(osc)), 0); /* If we succeeded we ship it off, if not there's no point in doing * anything. Also no resends.