From: Patrick Farrell Date: Wed, 30 Aug 2023 15:10:26 +0000 (-0400) Subject: LU-13814 osc: simplify osc_dio_page_submit X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fba76cbd8d8ea96c6a50dbfdbab6e5403e702e79;p=fs%2Flustre-release.git LU-13814 osc: simplify osc_dio_page_submit Remove more code from osc_dio_page_submit, with the goal of eliminating it entirely. Test-Parameters: fortestonly Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: Id408aad01c2e81a126dd04807819aed9d29fca6b --- diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index aec534a..acf7e23 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -553,7 +553,7 @@ void osc_lru_add_batch(struct client_obd *cli, struct list_head *list); void osc_page_submit(const struct lu_env *env, struct osc_page *opg, enum cl_req_type crt, int brw_flags); void osc_dio_page_submit(const struct lu_env *env, struct osc_page *opg, - enum cl_req_type crt, int *brw_flags); + enum cl_req_type crt, int brw_flags); int lru_queue_work(const struct lu_env *env, void *data); long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, long target, bool force); diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index ad28e56..f230ad0 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -265,6 +265,7 @@ int osc_dio_submit(const struct lu_env *env, struct cl_io *io, { struct osc_object *osc = cl2osc(ios->cis_obj); struct cl_io *top_io = cl_io_top(io); + struct osc_io *oio = osc_env_io(env); struct client_obd *cli = osc_cli(osc); struct page *vmpage; LIST_HEAD(list); @@ -293,6 +294,11 @@ int osc_dio_submit(const struct lu_env *env, struct cl_io *io, if (lnet_is_rdma_only_page(vmpage)) brw_flags |= OBD_BRW_RDMA_ONLY; + brw_flags |= OBD_BRW_SYNC; + + if (oio->oi_cap_sys_resource) + brw_flags |= OBD_BRW_SYS_RESOURCE; + /* * NOTE: here @page is a top-level page. This is done to avoid * creation of sub-page-list. @@ -309,7 +315,7 @@ int osc_dio_submit(const struct lu_env *env, struct cl_io *io, if (from == -1) from = i; - osc_dio_page_submit(env, opg, crt, &brw_flags); + osc_dio_page_submit(env, opg, crt, brw_flags); list_add_tail(&oap->oap_pending_item, &list); queued++; diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 35fe70e..78dfa5d 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -301,21 +301,11 @@ EXPORT_SYMBOL(osc_page_init); * Helper function called by osc_io_submit() for every page in a dio */ void osc_dio_page_submit(const struct lu_env *env, struct osc_page *opg, - enum cl_req_type crt, int *brw_flags) + enum cl_req_type crt, int brw_flags) { struct osc_async_page *oap = &opg->ops_oap; - struct osc_io *oio = osc_env_io(env); - - LASSERT(oap->oap_async_flags & ASYNC_READY); - LASSERT(oap->oap_async_flags & ASYNC_COUNT_STABLE); - - oap->oap_cmd = crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ; - oap->oap_brw_flags = OBD_BRW_SYNC | *brw_flags; - - if (oio->oi_cap_sys_resource) - oap->oap_brw_flags |= OBD_BRW_SYS_RESOURCE; - *brw_flags = oap->oap_brw_flags; + oap->oap_brw_flags = brw_flags; } /**