Whamcloud - gitweb
LU-13814 osc: simplify osc_dio_page_submit 82/52182/21
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 30 Aug 2023 15:10:26 +0000 (11:10 -0400)
committerPatrick Farrell <pfarrell@whamcloud.com>
Tue, 26 Sep 2023 18:58:30 +0000 (14:58 -0400)
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 <pfarrell@whamcloud.com>
Change-Id: Id408aad01c2e81a126dd04807819aed9d29fca6b

lustre/include/lustre_osc.h
lustre/osc/osc_io.c
lustre/osc/osc_page.c

index aec534a..acf7e23 100644 (file)
@@ -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);
index ad28e56..f230ad0 100644 (file)
@@ -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++;
index 35fe70e..78dfa5d 100644 (file)
@@ -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;
 }
 
 /**