From ca7c5b061f02d60d3761ee649b36e01c89b08bfc Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Sat, 9 Sep 2023 18:48:19 -0400 Subject: [PATCH] LU-13814 osc: rename osc_async_flags Async flags are used for all osc pages, rename them accordingly. Test-Parameters: trivial Test-Parameters: forjanitoronly Signed-off-by: Patrick Farrell Change-Id: Ibf808bcad5f03d950b4d2d05fb11f047fd28f311 --- lustre/include/lustre_osc.h | 18 ++++++++---------- lustre/osc/osc_cache.c | 24 ++++++++++++------------ lustre/osc/osc_io.c | 2 +- lustre/osc/osc_page.c | 6 +++--- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index 7f5ec97..949d80b 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -61,15 +61,15 @@ struct osc_quota_info { }; enum otp_flags { - ASYNC_READY = 0x1, /* ap_make_ready will not be called before + OTP_READY = 0x1, /* ake_ready will not be called before * this page is added to an rpc */ - ASYNC_URGENT = 0x2, /* page must be put into RPC before return */ - ASYNC_COUNT_STABLE = 0x4, /* ap_refresh_count will not be called + OTP_URGENT = 0x2, /* page must be put into RPC before return */ + OTP_COUNT_STABLE = 0x4, /* refresh_count will not be called to give the caller a chance to update or cancel the size of the io */ - ASYNC_HP = 0x8, - OTP_ASYNC_MAX, - OTP_ASYNC_BITS = 4 + OTP_HP = 0x8, + OTP_FLAG_MAX, + OTP_FLAG_BITS = 4 }; struct osc_transfer_page { @@ -84,7 +84,7 @@ struct osc_transfer_page { unsigned int otp_page_off:PAGE_SHIFT, otp_cmd:OBD_BRW_WRITE, - otp_flags:OTP_ASYNC_BITS, + otp_flags:OTP_FLAG_BITS, /** * Set if the page must be transferred with OBD_BRW_SRVLOCK. */ @@ -97,7 +97,7 @@ struct osc_transfer_page { static inline struct osc_transfer_page *brw_page2otp(struct brw_page *pga) { - BUILD_BUG_ON(OTP_ASYNC_MAX - 1 >= (1 << OTP_ASYNC_BITS)); + BUILD_BUG_ON(OTP_FLAG_MAX - 1 >= (1 << OTP_FLAG_BITS)); return container_of(pga, struct osc_transfer_page, otp_brw_page); } @@ -546,8 +546,6 @@ extern struct kmem_cache *osc_obdo_kmem; extern struct lu_context_key osc_key; extern struct lu_context_key osc_session_key; -#define OSC_FLAGS (ASYNC_URGENT|ASYNC_READY) - /* osc_page.c */ int osc_dio_pages_init(const struct lu_env *env, struct cl_object *obj, struct cl_dio_pages *cdp, pgoff_t index); diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index 5089c70..d76a1f3 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -1112,17 +1112,17 @@ static int osc_extent_make_ready(const struct lu_env *env, if (last == NULL || last->otp_obj_off < otp->otp_obj_off) last = otp; - /* checking ASYNC_READY is race safe */ - if ((otp->otp_flags & ASYNC_READY) != 0) + /* checking OTP_READY is race safe */ + if ((otp->otp_flags & OTP_READY) != 0) continue; rc = osc_make_ready(env, otp, OBD_BRW_WRITE); switch (rc) { case 0: - otp->otp_flags |= ASYNC_READY; + otp->otp_flags |= OTP_READY; break; case -EALREADY: - LASSERT((otp->otp_flags & ASYNC_READY) != 0); + LASSERT((otp->otp_flags & OTP_READY) != 0); break; default: LASSERTF(0, "unknown return code: %d\n", rc); @@ -1133,22 +1133,22 @@ static int osc_extent_make_ready(const struct lu_env *env, LASSERT(last != NULL); /* the last page is the only one we need to refresh its count by * the size of file. */ - if (!(last->otp_flags & ASYNC_COUNT_STABLE)) { + if (!(last->otp_flags & OTP_COUNT_STABLE)) { int last_otp_count = osc_refresh_count(env, obj, last, OBD_BRW_WRITE); LASSERTF(last_otp_count > 0, "last_otp_count %d\n", last_otp_count); LASSERT(last->otp_page_off + last_otp_count <= PAGE_SIZE); last->otp_count = last_otp_count; - last->otp_flags |= ASYNC_COUNT_STABLE; + last->otp_flags |= OTP_COUNT_STABLE; } /* for the rest of pages, we don't need to call osf_refresh_count() * because it's known they are not the last page */ list_for_each_entry(otp, &ext->oe_pages, otp_pending_item) { - if (!(otp->otp_flags & ASYNC_COUNT_STABLE)) { + if (!(otp->otp_flags & OTP_COUNT_STABLE)) { otp->otp_count = PAGE_SIZE - otp->otp_page_off; - otp->otp_flags |= ASYNC_COUNT_STABLE; + otp->otp_flags |= OTP_COUNT_STABLE; } } @@ -2033,7 +2033,7 @@ __must_hold(osc) } /** - * prepare pages for ASYNC io and put pages in send queue. + * prepare pages for OTP io and put pages in send queue. * * \param cmd OBD_BRW_* macroses * \param lop pending pages @@ -2242,8 +2242,8 @@ int osc_prep_transfer_page(struct osc_object *osc, struct osc_page *ops, * cl_page_clip later to set this. */ if (page->cp_type == CPT_TRANSIENT) - otp->otp_flags |= ASYNC_COUNT_STABLE|ASYNC_URGENT| - ASYNC_READY; + otp->otp_flags |= OTP_COUNT_STABLE|OTP_URGENT| + OTP_READY; INIT_LIST_HEAD(&otp->otp_pending_item); INIT_LIST_HEAD(&otp->otp_rpc_item); @@ -2527,7 +2527,7 @@ int osc_flush_async_page(const struct lu_env *env, struct cl_io *io, if (rc) GOTO(out, rc); - otp->otp_flags |= ASYNC_READY|ASYNC_URGENT; + otp->otp_flags |= OTP_READY|OTP_URGENT; if (current->flags & PF_MEMALLOC) ext->oe_memalloc = 1; diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 0139c92..797266f 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -202,7 +202,7 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io, } if (!dio) - otp->otp_flags = ASYNC_URGENT|ASYNC_READY|ASYNC_COUNT_STABLE; + otp->otp_flags = OTP_URGENT|OTP_READY|OTP_COUNT_STABLE; osc_page_submit(env, opg, crt, brw_flags); list_add_tail(&otp->otp_pending_item, &list); diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index 9b46fd9..2433b67 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -196,7 +196,7 @@ static void osc_page_clip(const struct lu_env *env, otp->otp_page_off = from; otp->otp_count = to - from; - otp->otp_flags |= ASYNC_COUNT_STABLE; + otp->otp_flags |= OTP_COUNT_STABLE; } static int osc_page_flush(const struct lu_env *env, @@ -320,8 +320,8 @@ void osc_page_submit(const struct lu_env *env, struct osc_page *opg, struct osc_transfer_page *otp = &opg->ops_otp; struct osc_io *oio = osc_env_io(env); - LASSERT(otp->otp_flags & ASYNC_READY); - LASSERT(otp->otp_flags & ASYNC_COUNT_STABLE); + LASSERT(otp->otp_flags & OTP_READY); + LASSERT(otp->otp_flags & OTP_COUNT_STABLE); otp->otp_cmd = crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ; otp->otp_brw_flags = OBD_BRW_SYNC | brw_flags; -- 1.8.3.1