Whamcloud - gitweb
LU-13814 clio: remove cl_page_prep for transients 85/52085/10
authorPatrick Farrell <pfarrell@whamcloud.com>
Sun, 17 Sep 2023 19:01:14 +0000 (15:01 -0400)
committerPatrick Farrell <pfarrell@whamcloud.com>
Sun, 17 Sep 2023 19:01:14 +0000 (15:01 -0400)
cl_page_prep no longer does anything for transient pages,
finish cleaning that up and make it explicit with asserts.

Test-Parameters: forjanitoronly
Test-Parameters: fortestonly
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I3285a69f971530ba0407de128430bb2497900d11

lustre/lov/lov_io.c
lustre/obdclass/cl_page.c
lustre/osc/osc_io.c

index 2ae0c90..dd6c43f 100644 (file)
@@ -1331,7 +1331,7 @@ static int lov_io_submit(const struct lu_env *env,
                         * the pages will be transient. We don't care about
                         * the return code of cl_page_prep() at all.
                         */
-                       (void) cl_page_prep(env, ios->cis_io, page, crt);
+                       LASSERT(page->cp_type == CPT_TRANSIENT);
                        cl_page_completion(env, page, crt, 0);
                        continue;
                }
index 996ad97..14a7909 100644 (file)
@@ -897,10 +897,8 @@ static void cl_page_io_start(const struct lu_env *env,
          * Page is queued for IO, change its state.
          */
         ENTRY;
-       if (pg->cp_type != CPT_TRANSIENT) {
-               cl_page_owner_clear(pg);
-               cl_page_state_set(env, pg, cl_req_type_state(crt));
-       }
+       cl_page_owner_clear(pg);
+       cl_page_state_set(env, pg, cl_req_type_state(crt));
         EXIT;
 }
 
@@ -914,8 +912,7 @@ int cl_page_prep(const struct lu_env *env, struct cl_io *io,
        struct page *vmpage = cp->cp_vmpage;
        int rc;
 
-       if (cp->cp_type == CPT_TRANSIENT)
-               GOTO(start, rc = 0);
+       LASSERT(cp->cp_type != CPT_TRANSIENT);
        PASSERT(env, cp, crt < CRT_NR);
        PINVRNT(env, cp, cl_page_is_owned(cp, io));
        PINVRNT(env, cp, cl_page_invariant(cp));
@@ -933,7 +930,6 @@ int cl_page_prep(const struct lu_env *env, struct cl_io *io,
                if (cp->cp_sync_io == NULL)
                        set_page_writeback(vmpage);
        }
-start:
 
        cl_page_io_start(env, cp, crt);
        rc = 0;
@@ -1010,9 +1006,7 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *cp,
 
        ENTRY;
        PASSERT(env, cp, crt == CRT_WRITE);
-
-       if (cp->cp_type == CPT_TRANSIENT)
-               GOTO(out, rc = 0);
+       LASSERT(cp->cp_type != CPT_TRANSIENT);
 
        lock_page(vmpage);
        unlock = true;
@@ -1037,7 +1031,6 @@ int cl_page_make_ready(const struct lu_env *env, struct cl_page *cp,
                LBUG();
        }
 
-out:
        if (rc == 0) {
                PASSERT(env, cp, cp->cp_state == CPS_CACHED);
                cl_page_io_start(env, cp, crt);
index 67a63ca..cd6bee2 100644 (file)
@@ -140,6 +140,7 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io,
        unsigned int ppc_bits; /* pages per chunk bits */
        unsigned int ppc;
        bool sync_queue = false;
+       bool dio = false;
 
        LASSERT(qin->pl_nr > 0);
 
@@ -157,8 +158,10 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io,
                brw_flags |= OBD_BRW_NDELAY;
 
        page = cl_page_list_first(qin);
-       if (page->cp_type == CPT_TRANSIENT)
+       if (page->cp_type == CPT_TRANSIENT) {
                brw_flags |= OBD_BRW_NOCACHE;
+               dio = true;
+       }
        if (lnet_is_rdma_only_page(page->cp_vmpage))
                brw_flags |= OBD_BRW_RDMA_ONLY;
 
@@ -182,23 +185,24 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io,
                         break;
                 }
 
-               result = cl_page_prep(env, top_io, page, crt);
-               if (result != 0) {
-                        LASSERT(result < 0);
-                        if (result != -EALREADY)
-                                break;
-                        /*
-                         * Handle -EALREADY error: for read case, the page is
-                         * already in UPTODATE state; for write, the page
-                         * is not dirty.
-                         */
-                        result = 0;
-                       continue;
-                }
+               if (!dio) {
+                       result = cl_page_prep(env, top_io, page, crt);
+                       if (result != 0) {
+                               LASSERT(result < 0);
+                               if (result != -EALREADY)
+                                       break;
+                               /*
+                                * Handle -EALREADY error: for read case, the
+                                * page is already in UPTODATE state; for
+                                * write, the page is not dirty.
+                                */
+                               result = 0;
+                               continue;
+                       }
+               }
 
-               if (page->cp_type != CPT_TRANSIENT) {
+               if (!dio)
                        oap->oap_async_flags = ASYNC_URGENT|ASYNC_READY|ASYNC_COUNT_STABLE;
-               }
 
                osc_page_submit(env, opg, crt, brw_flags);
                list_add_tail(&oap->oap_pending_item, &list);