Whamcloud - gitweb
LU-13814 clio: add io to cio_submit 75/52075/21
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 23 Feb 2024 16:02:35 +0000 (11:02 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 23 Apr 2024 19:43:51 +0000 (19:43 +0000)
cp_owner is going away for transient pages, so we need to
remove its usage to find the top level IO.  Here that means
passing the IO down through a few layers.

Signed-off-by: Patrick Farrell <patrick.farrell@oracle.com>
Change-Id: I7fac0e53a7831247b846261c1c734c9d6e43a7d2
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52075
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
lustre/include/cl_object.h
lustre/include/lustre_osc.h
lustre/lov/lov_io.c
lustre/obdclass/cl_io.c
lustre/osc/osc_io.c

index 281d7e3..c5f8f47 100644 (file)
@@ -1515,6 +1515,7 @@ struct cl_io_operations {
         * executed on them.
         */
        int  (*cio_submit)(const struct lu_env *env,
+                          struct cl_io *io,
                           const struct cl_io_slice *slice,
                           enum cl_req_type crt, struct cl_2queue *queue);
        /**
index 29f2c19..d1a45d8 100644 (file)
@@ -675,8 +675,9 @@ void osc_update_next_shrink(struct client_obd *cli);
 void osc_schedule_grant_work(void);
 
 /* osc_io.c */
-int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
-                 enum cl_req_type crt, struct cl_2queue *queue);
+int osc_io_submit(const struct lu_env *env, struct cl_io *io,
+                 const struct cl_io_slice *ios, enum cl_req_type crt,
+                 struct cl_2queue *queue);
 int osc_io_commit_async(const struct lu_env *env,
                        const struct cl_io_slice *ios,
                        struct cl_page_list *qin, int from, int to,
index 5cca7f3..aa3c71a 100644 (file)
@@ -1350,6 +1350,7 @@ static int lov_io_lru_reserve(const struct lu_env *env,
  * lov_device::ld_mutex mutex.
  */
 static int lov_io_submit(const struct lu_env *env,
+                        struct cl_io *io,
                         const struct cl_io_slice *ios,
                         enum cl_req_type crt, struct cl_2queue *queue)
 {
@@ -1804,6 +1805,7 @@ static void lov_empty_io_fini(const struct lu_env *env,
 }
 
 static int lov_empty_io_submit(const struct lu_env *env,
+                              struct cl_io *io,
                               const struct cl_io_slice *ios,
                               enum cl_req_type crt, struct cl_2queue *queue)
 {
index b686e6e..8e334f0 100644 (file)
@@ -655,7 +655,7 @@ int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io,
        list_for_each_entry(scan, &io->ci_layers, cis_linkage) {
                if (scan->cis_iop->cio_submit == NULL)
                        continue;
-               result = scan->cis_iop->cio_submit(env, scan, crt, queue);
+               result = scan->cis_iop->cio_submit(env, io, scan, crt, queue);
                if (result != 0)
                        break;
        }
index 947af47..b7e50ea 100644 (file)
@@ -119,15 +119,16 @@ static int osc_io_read_ahead(const struct lu_env *env,
  * or, if page is already submitted, changes osc flags through
  * osc_set_async_flags().
  */
-int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
-                 enum cl_req_type crt, struct cl_2queue *queue)
+int osc_io_submit(const struct lu_env *env, struct cl_io *io,
+                 const struct cl_io_slice *ios, enum cl_req_type crt,
+                 struct cl_2queue *queue)
 {
        struct cl_page    *page;
        struct cl_page    *tmp;
+       struct cl_io      *top_io = cl_io_top(io);
        struct client_obd *cli  = NULL;
        struct osc_object *osc  = NULL; /* to keep gcc happy */
        struct osc_page   *opg;
-       struct cl_io      *io;
        LIST_HEAD(list);
 
        struct cl_page_list *qin      = &queue->c2_qin;
@@ -168,9 +169,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
         cl_page_list_for_each_safe(page, tmp, qin) {
                 struct osc_async_page *oap;
 
-                /* Top level IO. */
-                io = page->cp_owner;
-                LASSERT(io != NULL);
+               LASSERT(top_io != NULL);
 
                opg = osc_cl_page_osc(page, osc);
                oap = &opg->ops_oap;
@@ -183,7 +182,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
                         break;
                 }
 
-                result = cl_page_prep(env, io, page, crt);
+               result = cl_page_prep(env, top_io, page, crt);
                if (result != 0) {
                         LASSERT(result < 0);
                         if (result != -EALREADY)
@@ -227,7 +226,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
                }
 
                if (sync_queue) {
-                       result = osc_queue_sync_pages(env, io, osc, &list,
+                       result = osc_queue_sync_pages(env, top_io, osc, &list,
                                                      brw_flags);
                        if (result < 0)
                                break;
@@ -237,7 +236,8 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios,
        }
 
        if (queued > 0)
-               result = osc_queue_sync_pages(env, io, osc, &list, brw_flags);
+               result = osc_queue_sync_pages(env, top_io, osc, &list,
+                                             brw_flags);
 
        /* Update c/mtime for sync write. LU-7310 */
        if (crt == CRT_WRITE && qout->pl_nr > 0 && result == 0) {