Whamcloud - gitweb
LU-13814 clio: remove last DIO queue usage 62/52162/19
authorPatrick Farrell <pfarrell@whamcloud.com>
Sun, 24 Sep 2023 21:00:52 +0000 (17:00 -0400)
committerPatrick Farrell <pfarrell@whamcloud.com>
Tue, 26 Sep 2023 18:58:30 +0000 (14:58 -0400)
With cleanup of osc_dio_submit, we can remove the horrid
'convert to queue' function which converts the cl_dio_pages
array to a cl2queue.  There's still a lot left to do to
remove cl_pages for DIO, but this is a nice step.

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

lustre/include/cl_object.h
lustre/obdclass/cl_io.c
lustre/osc/osc_io.c

index 68bcc00..2d84e09 100644 (file)
@@ -2558,7 +2558,6 @@ void cl_sync_io_note(const struct lu_env *env, struct cl_sync_io *anchor,
                     int ioret);
 int cl_sync_io_wait_recycle(const struct lu_env *env, struct cl_sync_io *anchor,
                            long timeout, int ioret);
-void cl_dio_pages_2queue(struct cl_dio_pages *ldp);
 struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj,
                                    bool is_aio);
 struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio,
@@ -2602,7 +2601,6 @@ struct cl_dio_pages {
 
        struct cl_page          **cdp_cl_pages;
        struct cl_sync_io       *cdp_sync_io;
-       struct cl_2queue        cdp_queue;
        /** # of pages in the array. */
        size_t                  cdp_count;
        /* the file offset of the first page. */
index ffe351b..f2d9da2 100644 (file)
@@ -1209,20 +1209,6 @@ static inline void dio_aio_complete(struct kiocb *iocb, ssize_t res)
 #endif
 }
 
-void cl_dio_pages_2queue(struct cl_dio_pages *cdp)
-{
-       int i = 0;
-
-       cl_2queue_init(&cdp->cdp_queue);
-
-       for (i = 0; i < cdp->cdp_count; i++) {
-               struct cl_page *page = cdp->cdp_cl_pages[i];
-
-               cl_page_list_add(&cdp->cdp_queue.c2_qin, page, false);
-       }
-}
-EXPORT_SYMBOL(cl_dio_pages_2queue);
-
 static void cl_dio_aio_end(const struct lu_env *env, struct cl_sync_io *anchor)
 {
        struct cl_dio_aio *aio = container_of(anchor, typeof(*aio), cda_sync);
index e27482e..4f4d155 100644 (file)
@@ -259,12 +259,10 @@ int osc_io_submit(const struct lu_env *env, struct cl_io *io,
 }
 EXPORT_SYMBOL(osc_io_submit);
 
-int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
-                    const struct cl_io_slice *ios, enum cl_req_type crt,
-                    struct cl_dio_pages *cdp, struct cl_2queue *queue)
+int osc_dio_submit(const struct lu_env *env, struct cl_io *io,
+                 const struct cl_io_slice *ios, enum cl_req_type crt,
+                 struct cl_dio_pages *cdp)
 {
-       struct cl_page_list *qout     = &queue->c2_qout;
-       struct cl_page_list *qin      = &queue->c2_qin;
        struct osc_object *osc  = cl2osc(ios->cis_obj);
        struct cl_io      *top_io = cl_io_top(io);
        struct client_obd *cli  = osc_cli(osc);
@@ -283,9 +281,7 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
        int to = -1;
        int i = 0;
 
-       LASSERT(qin->pl_nr > 0);
-
-       CDEBUG(D_CACHE|D_READA, "%d %d\n", qin->pl_nr, crt);
+       CDEBUG(D_CACHE|D_READA, "%ld %d\n", cdp->cdp_count, crt);
 
        brw_flags = osc_io_srvlock(cl2osc_io(env, ios)) ? OBD_BRW_SRVLOCK : 0;
        brw_flags |= crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ;
@@ -316,8 +312,6 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
                osc_page_submit(env, opg, crt, brw_flags);
                list_add_tail(&oap->oap_pending_item, &list);
 
-               cl_page_list_move(qout, qin, page);
-
                queued++;
                total_queued++;
                if (queued == max_pages) {
@@ -369,30 +363,6 @@ int __osc_dio_submit(const struct lu_env *env, struct cl_io *io,
        CDEBUG(D_INFO, "%d/%ld %d\n", total_queued, cdp->cdp_count, result);
        return total_queued > 0 ? 0 : result;
 }
-
-int osc_dio_submit(const struct lu_env *env, struct cl_io *io,
-                 const struct cl_io_slice *ios, enum cl_req_type crt,
-                 struct cl_dio_pages *cdp)
-{
-       struct cl_2queue *queue;
-       int rc = 0;
-
-       cl_dio_pages_2queue(cdp);
-       queue = &cdp->cdp_queue;
-
-       rc = __osc_dio_submit(env, io, ios, crt, cdp, queue);
-
-       /* if submit failed, no pages were sent */
-       LASSERT(ergo(rc != 0, list_empty(&queue->c2_qout.pl_pages)));
-       while (queue->c2_qout.pl_nr > 0) {
-               struct cl_page *page;
-
-               page = cl_page_list_first(&queue->c2_qout);
-               cl_page_list_del(env, &queue->c2_qout, page, false);
-       }
-
-       RETURN(rc);
-}
 EXPORT_SYMBOL(osc_dio_submit);
 
 /**