Whamcloud - gitweb
LU-13814 clio: Improve cl_io_submit_sync comments 73/52073/20
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 23 Aug 2023 22:46:53 +0000 (18:46 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Mar 2024 05:48:55 +0000 (05:48 +0000)
Add notes on what cl_io_submit_sync is for.

Test-Parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I5e32f1a7e6893b63d82f14848a865f90d30fb079
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52073
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/cl_io.c

index 94e6bc8..ef674ae 100644 (file)
@@ -670,6 +670,9 @@ EXPORT_SYMBOL(cl_io_submit_rw);
 /**
  * Submit a sync_io and wait for the IO to be finished, or error happens.
  * If \a timeout is zero, it means to wait for the IO unconditionally.
+ *
+ * This is used for synchronous submission of an async IO, so the waiting is
+ * done here in this function and the IO is done when this function returns.
  */
 int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io,
                      enum cl_req_type iot, struct cl_2queue *queue,
@@ -682,6 +685,10 @@ int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io,
 
        cl_page_list_for_each(pg, &queue->c2_qin) {
                LASSERT(pg->cp_sync_io == NULL);
+               /* this is for sync submission of async IO, IO that was always
+                * sync (like DIO) is handled differently
+                */
+               LASSERT(pg->cp_type != CPT_TRANSIENT);
                pg->cp_sync_io = anchor;
        }