From: Patrick Farrell Date: Sun, 24 Sep 2023 21:09:49 +0000 (-0400) Subject: LU-13814 osc: Move osc_page members to osc_async_page X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F52204%2F18;p=fs%2Flustre-release.git LU-13814 osc: Move osc_page members to osc_async_page We're going to start using osc_async_page separately from osc_page, since it's used for both DIO and buffered, but osc_page is not. This moves all of the members which are needed for DIO. This commit deliberately ignores some packing related issues which will be handled *much* later, since the names and members of these structs will keep changing. Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: I994af9563142201a2c7193735ac02568735bd8d5 --- diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index c199adf..69d8cc3 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -78,7 +78,11 @@ struct osc_async_page { unsigned int oap_page_off:PAGE_SHIFT, oap_cmd:OBD_BRW_WRITE, - oap_async_flags:OAP_ASYNC_BITS; + oap_async_flags:OAP_ASYNC_BITS, + /** + * Set if the page must be transferred with OBD_BRW_SRVLOCK. + */ + oap_srvlock:1; } __attribute__((packed)); #define oap_page oap_brw_page.bp_page @@ -501,18 +505,14 @@ struct osc_page { /** * Boolean, true iff page is under transfer. Used for sanity checking. */ - unsigned char ops_transfer_pinned:1, - /** - * in LRU? - */ + unsigned int ops_transfer_pinned:1, + /** + * in LRU? + */ ops_in_lru:1, - /** - * Set if the page must be transferred with OBD_BRW_SRVLOCK. - */ - ops_srvlock:1, - /** - * If the page is in osc_object::oo_tree. - */ + /** + * If the page is in osc_object::oo_tree. + */ ops_intree:1; }; diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index 184a6e75..3d9187f 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -1424,7 +1424,7 @@ static void mdc_req_attr_set(const struct lu_env *env, struct cl_object *obj, struct osc_page *opg; opg = osc_cl_page_osc(attr->cra_page, cl2osc(obj)); - if (!opg->ops_srvlock) { + if (!opg->ops_oap.oap_srvlock) { int rc; rc = mdc_get_lock_handle(env, cl2osc(obj), diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index aa061a5..2a755c5 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -2279,7 +2279,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io, RETURN(-EBUSY); /* Set the OBD_BRW_SRVLOCK before the page is queued. */ - brw_flags |= ops->ops_srvlock ? OBD_BRW_SRVLOCK : 0; + brw_flags |= ops->ops_oap.oap_srvlock ? OBD_BRW_SRVLOCK : 0; if (io->ci_noquota) { brw_flags |= OBD_BRW_NOQUOTA; cmd |= OBD_BRW_NOQUOTA; @@ -2423,9 +2423,9 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io, osc_object_lock(osc); if (ext->oe_nr_pages == 0) - ext->oe_srvlock = ops->ops_srvlock; + ext->oe_srvlock = ops->ops_oap.oap_srvlock; else - LASSERT(ext->oe_srvlock == ops->ops_srvlock); + LASSERT(ext->oe_srvlock == ops->ops_oap.oap_srvlock); ++ext->oe_nr_pages; list_add_tail(&oap->oap_pending_item, &ext->oe_pages); osc_object_unlock(osc); diff --git a/lustre/osc/osc_object.c b/lustre/osc/osc_object.c index 610ca49..7f7ab35 100644 --- a/lustre/osc/osc_object.c +++ b/lustre/osc/osc_object.c @@ -387,7 +387,7 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj, /* if srvlock is set, don't look for a local lock, since we won't use * it and shouldn't note it in the RPC */ - if (flags & OBD_MD_FLHANDLE && !opg->ops_srvlock) { + if (flags & OBD_MD_FLHANDLE && !opg->ops_oap.oap_srvlock) { struct ldlm_lock *lock; lock = osc_dlmlock_at_pgoff(env, cl2osc(obj), osc_index(opg), diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 78dfa5d..ccc4435 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -125,7 +125,7 @@ static int osc_page_print(const struct lu_env *env, cli, obj, /* 3 */ opg->ops_transfer_pinned, - opg->ops_srvlock, + opg->ops_oap.oap_srvlock, /* 4 */ cli->cl_r_in_flight, cli->cl_w_in_flight, cli->cl_max_rpcs_in_flight, @@ -255,7 +255,7 @@ int osc_page_init(const struct lu_env *env, struct cl_io *io, if (result != 0) return result; - opg->ops_srvlock = osc_io_srvlock(oio); + opg->ops_oap.oap_srvlock = osc_io_srvlock(oio); if ((lnet_is_rdma_only_page(cl_page->cp_vmpage) || CFS_FAIL_CHECK(OBD_FAIL_OSC_UNALIGNED_RDMA_ONLY)) && diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index fa3aade..361efb3 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2607,7 +2607,7 @@ static int brw_interpret(const struct lu_env *env, } /* Extend KMS if it's not a lockless write */ if (loi->loi_kms < last_off && - oap2osc_page(last)->ops_srvlock == 0) { + last->oap_srvlock == 0) { attr->cat_kms = last_off; valid |= CAT_KMS; }